Module: TT::Win32::Shim
- Includes:
- Fiddle
- Defined in:
- TT_Lib2/win32_shim.rb
Overview
Defined Under Namespace
Constant Summary
- FALSE =
0
- TRUE =
1
- GA_PARENT =
1
- GA_ROOT =
2
- GA_ROOTOWNER =
3
Class Method Summary collapse
-
.get_main_window_handle ⇒ Integer
TT::Win32.get_main_window_handle.
Class Method Details
.get_main_window_handle ⇒ Integer
TT::Win32.get_main_window_handle
Returns the window handle of the SketchUp window for the input queue of the calling ruby method.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'TT_Lib2/win32_shim.rb', line 46 def self.get_main_window_handle thread_id = Kernel32.GetCurrentThreadId() main_hwnd = 0 param = 0 enumWindowsProc = Closure::BlockCaller.new(TYPE_INT, [TYPE_VOIDP, TYPE_VOIDP]) { |hwnd, lparam| main_hwnd = User32.GetAncestor(hwnd, GA_ROOTOWNER) next FALSE } User32.EnumThreadWindows(thread_id, enumWindowsProc, param) main_hwnd end |