Module: Win32

Includes:
APIMapper
Defined in:
lib/Win32/Base.rb,
lib/Win32/User32.rb,
lib/Win32/Process.rb,
lib/Win32/Registry.rb,
lib/Win32/APIMapper.rb,
lib/Win32/NetResources.rb,
lib/Win32/WindowManager.rb,
lib/Win32/VirtualDesktop.rb

Overview


This module mounts SAMBA (Win32) network resources

Defined Under Namespace

Modules: APIMapper, NetResources Classes: Error, LangID, LastErrorInfo, Process, ProcessInfo, RegKey, RegistryError, SecurityAttributes, StartupInfo, VirtualDesktop, VirtualDesktops, WindowManager

Constant Summary collapse

MB_OK =
0x00000000
MB_OKCANCEL =
0x00000001
MB_ABORTRETRYIGNORE =
0x00000002
MB_YESNOCANCEL =
0x00000003
MB_YESNO =
0x00000004
MB_RETRYCANCEL =
0x00000005
MB_ICONHAND =
0x00000010
MB_ICONQUESTION =
0x00000020
MB_ICONEXCLAMATION =
0x00000030
MB_ICONASTERISK =
0x00000040
MB_USERICON =
0x00000080
MB_ICONWARNING =
MB_ICONEXCLAMATION
MB_ICONERROR =
MB_ICONHAND
MB_ICONINFORMATION =
MB_ICONASTERISK
MB_ICONSTOP =
MB_ICONHAND
NULL =

Constants

0
SW_HIDE =
0
SW_SHOWNORMAL =
1
SW_NORMAL =
1
SW_SHOWMINIMIZED =
2
SW_SHOWMAXIMIZED =
3
SW_MAXIMIZE =
3
SW_SHOWNOACTIVATE =
4
SW_SHOW =
5
SW_MINIMIZE =
6
SW_SHOWMINNOACTIVE =
7
SW_SHOWNA =
8
SW_RESTORE =
9
SW_SHOWDEFAULT =
10
SW_FORCEMINIMIZE =
11
SW_MAX =
11
GWL_WNDPROC =
(-4)
GWL_HINSTANCE =
(-6)
GWL_HWNDPARENT =
(-8)
GWL_STYLE =
(-16)
GWL_EXSTYLE =
(-20)
GWL_USERDATA =
(-21)
GWL_ID =
(-12)
WS_OVERLAPPED =
0x00000000
WS_POPUP =
0x80000000
WS_CHILD =
0x40000000
WS_MINIMIZE =
0x20000000
WS_VISIBLE =
0x10000000
WS_DISABLED =
0x08000000
WS_CLIPSIBLINGS =
0x04000000
WS_CLIPCHILDREN =
0x02000000
WS_MAXIMIZE =
0x01000000
WS_CAPTION =

/* WS_BORDER | WS_DLGFRAME =*/

0x00C00000
WS_BORDER =
0x00800000
WS_DLGFRAME =
0x00400000
WS_VSCROLL =
0x00200000
WS_HSCROLL =
0x00100000
WS_SYSMENU =
0x00080000
WS_THICKFRAME =
0x00040000
WS_GROUP =
0x00020000
WS_TABSTOP =
0x00010000
WS_MINIMIZEBOX =
0x00020000
WS_MAXIMIZEBOX =
0x00010000
WS_TILED =
WS_OVERLAPPED
WS_ICONIC =
WS_MINIMIZE
WS_SIZEBOX =
WS_THICKFRAME
WS_OVERLAPPEDWINDOW =

Common Window Styles

(WS_OVERLAPPED     | 
WS_CAPTION        | 
WS_SYSMENU        | 
WS_THICKFRAME     |
WS_MINIMIZEBOX    |
WS_MAXIMIZEBOX)
WS_POPUPWINDOW =
(WS_POPUP          |
WS_BORDER         |
WS_SYSMENU)
WS_CHILDWINDOW =
(WS_CHILD)
WS_TILEDWINDOW =
WS_OVERLAPPEDWINDOW
WS_EX_DLGMODALFRAME =

Extended Window Styles

0x00000001
WS_EX_NOPARENTNOTIFY =
0x00000004
WS_EX_TOPMOST =
0x00000008
WS_EX_ACCEPTFILES =
0x00000010
WS_EX_TRANSPARENT =
0x00000020
WS_EX_MDICHILD =
0x00000040
WS_EX_TOOLWINDOW =
0x00000080
WS_EX_WINDOWEDGE =
0x00000100
WS_EX_CLIENTEDGE =
0x00000200
WS_EX_CONTEXTHELP =
0x00000400
WS_EX_RIGHT =
0x00001000
WS_EX_LEFT =
0x00000000
WS_EX_RTLREADING =
0x00002000
WS_EX_LTRREADING =
0x00000000
WS_EX_LEFTSCROLLBAR =
0x00004000
WS_EX_RIGHTSCROLLBAR =
0x00000000
WS_EX_CONTROLPARENT =
0x00010000
WS_EX_STATICEDGE =
0x00020000
WS_EX_APPWINDOW =
0x00040000
WS_EX_OVERLAPPEDWINDOW =
(WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
WS_EX_PALETTEWINDOW =
(WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
GW_HWNDFIRST =

GetWindow() Constants

0
GW_HWNDLAST =
1
GW_HWNDNEXT =
2
GW_HWNDPREV =
3
GW_OWNER =
4
GW_CHILD =
5
GW_ENABLEDPOPUP =
6
GW_MAX =
6
User32 =

Functions

DL.dlopen("user32")
EnumWindows =
User32['EnumWindows', 'IPL']
PostMessage =
User32['PostMessage', 'ILILL']
GetClassName =
User32['GetClassName', 'ILpI']
FindWindowEx =
User32["FindWindowEx", "IIIPP"]
RegisterWindowMessage =
User32["RegisterWindowMessage", "IP"]
SendMessage =
User32["SendMessage", "IIIII"]
ShowWindow =
User32["ShowWindow", "III"]
GetWindowLong =
User32["GetWindowLong", "III"]
GetWindow =
User32["GetWindow", "III"]
GetTopWindow =
User32["GetTopWindow", "II"]
IsIconic =
User32["IsIconic", "II"]
GetWindowLong_2 =
Win32API.new("user32","GetWindowLong", ["I","I"],"I")
GetWindow_2 =
Win32API.new("user32","GetWindow", ["I","I"],"I")
GetClassName_2 =
Win32API.new("user32", "GetClassName", ["I", "P", "I"], "I")

Constants included from APIMapper

APIMapper::DLL, APIMapper::HANDLE, APIMapper::IN, APIMapper::NAME, APIMapper::OUT

Class Method Summary collapse

Methods included from APIMapper

Initialize, #WCall, WCall

Class Method Details

.MessageBox(p_strTitle, p_strMessage, p_nIcon = 0) ⇒ Object



86
87
88
89
90
91
# File 'lib/Win32/Base.rb', line 86

def Win32.MessageBox(p_strTitle, p_strMessage, p_nIcon = 0)
	APIMapper.WCall("MessageBox",
					0,
					p_strMessage.to_ucs2(true), p_strTitle.to_ucs2(true),
					p_nIcon)
end