vendor/vendor_gems/rdp-win32screenshot-0.0.9/lib/win32/util.rb
def windows_hierarchy with_info = false          
          all = {}
          desktop_hwnd = BitmapMaker.desktop_window
          root = {:hwnd => desktop_hwnd, :children => []}
          root.merge!(get_info(desktop_hwnd)) if with_info
          parents = []
          parents << root
          window_callback = FFI::Function.new(:bool, [ :long, :pointer ], { :convention => :stdcall }) do |hwnd, param|
            # this is a child of the most recent parent
            myself = {:hwnd => hwnd, :children => []}
            myself.merge!(get_info(hwnd)) if with_info
            parents[-1][:children] << myself
            parents << myself
            if !all[hwnd]
              all[hwnd] = true
              BitmapMaker.enum_child_windows(hwnd, window_callback, nil)
            end
            
            parents.pop
            true
          end
          BitmapMaker.enum_child_windows(desktop_hwnd, window_callback, nil)
          root
        end
# just returns a long list of hwnd's...
# unless with_info is true
# then it will return all hwnds with full info about each window
just returns a long list of hwnd's
unless with_info is true
then it will return all hwnds with full info about each window
just returns a long list of hwnd ' s unless with_info is true then it will return all hwnds with full info about each window
def windows_hierarchy with_info = false          
          all = {}
          desktop_hwnd = BitmapMaker.desktop_window
          root = {:hwnd => desktop_hwnd, :children => []}
          root.merge!(get_info(desktop_hwnd)) if with_info
          parents = []
          parents << root
          window_callback = FFI::Function.new(:bool, [ :long, :pointer ], { :convention => :stdcall }) do |hwnd, param|
            myself = {:hwnd => hwnd, :children => []}
            myself.merge!(get_info(hwnd)) if with_info
            parents[-1][:children] << myself
            parents << myself
            if !all[hwnd]
              all[hwnd] = true
              BitmapMaker.enum_child_windows(hwnd, window_callback, nil)
            end
            parents.pop
            true
          end
          BitmapMaker.enum_child_windows(desktop_hwnd, window_callback, nil)
          root
        end
def windows_hierarchy with_info = false all = { } desktop_hwnd = BitmapMaker . desktop_window root = { :hwnd => desktop_hwnd , :children => [ ] } root . merge! ( get_info ( desktop_hwnd ) ) if with_info parents = [ ] parents << root window_callback = FFI :: Function . new ( :bool , [ :long , :pointer ] , { :convention => :stdcall } ) do | hwnd , param | myself = { :hwnd => hwnd , :children => [ ] } myself . merge! ( get_info ( hwnd ) ) if with_info parents [ - 1 ] [ :children ] << myself parents << myself if ! all [ hwnd ] all [ hwnd ] = true BitmapMaker . enum_child_windows ( hwnd , window_callback , nil ) end parents . pop true end BitmapMaker . enum_child_windows ( desktop_hwnd , window_callback , nil ) root end
just returns a long list of hwnd's...
unless with_info is true
then it will return all hwnds with full info about each window
just returns a long list of hwnd ' s ... unless with_info is true then it will return all hwnds with full info about each window
# this is a child of the most recent parent
with_info