windows-pr 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +10 -0
- data/MANIFEST +2 -0
- data/Rakefile +18 -6
- data/doc/conversion_guide.txt +1 -0
- data/lib/windows/network/winsock.rb +4 -4
- data/lib/windows/process.rb +23 -1
- data/lib/windows/window/classes.rb +48 -0
- data/lib/windows/window/menu.rb +100 -0
- data/lib/windows/window/message.rb +6 -1
- data/lib/windows/window/timer.rb +2 -2
- data/test/tc_com_automation.rb +15 -0
- data/test/tc_network_winsock.rb +34 -0
- data/test/tc_process.rb +8 -13
- data/test/tc_window_classes.rb +33 -0
- data/test/tc_window_dialog.rb +33 -0
- data/test/tc_window_menu.rb +29 -0
- data/test/tc_window_message.rb +33 -0
- data/test/tc_window_properties.rb +29 -0
- data/test/tc_window_timer.rb +29 -0
- data/windows-pr.gemspec +1 -1
- metadata +20 -2
data/CHANGES
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
= 1.0.1 - 9-Feb-2009
|
2
|
+
* Added the Windows::Window::Menu module.
|
3
|
+
* Added the Windows::Window::Classes module.
|
4
|
+
* Added tests for several Windows::Window::XXX modules that weren't
|
5
|
+
previously covered.
|
6
|
+
* Now properly wraps some methods in the Windows::Network::Winsock module
|
7
|
+
that weren't supported on Windows 2000.
|
8
|
+
* Added the IsWow64Process function to the Windows::Process module.
|
9
|
+
* Added the windows_64? helper method to the Windows::Process module.
|
10
|
+
|
1
11
|
= 1.0.0 - 5-Feb-2009
|
2
12
|
* Fixed the prototype for DuplicateHandle() in the Windows::Handle module.
|
3
13
|
|
data/MANIFEST
CHANGED
@@ -56,7 +56,9 @@ lib/windows/network/winsock.rb
|
|
56
56
|
|
57
57
|
lib/windows/ntfs/winternl.rb
|
58
58
|
|
59
|
+
lib/windows/window/classes.rb
|
59
60
|
lib/windows/window/dialog.rb
|
61
|
+
lib/windows/window/menu.rb
|
60
62
|
lib/windows/window/message.rb
|
61
63
|
lib/windows/window/properties.rb
|
62
64
|
lib/windows/window/timer.rb
|
data/Rakefile
CHANGED
@@ -5,18 +5,22 @@ include Config
|
|
5
5
|
|
6
6
|
desc "Install the windows-pr package (non-gem)"
|
7
7
|
task :install do
|
8
|
-
sitelibdir
|
9
|
-
installdir
|
10
|
-
installdir_msvcrt
|
11
|
-
installdir_gdi
|
12
|
-
installdir_com
|
8
|
+
sitelibdir = CONFIG["sitelibdir"]
|
9
|
+
installdir = File.join(sitelibdir, 'windows')
|
10
|
+
installdir_msvcrt = File.join(installdir, 'msvcrt')
|
11
|
+
installdir_gdi = File.join(installdir, 'gdi')
|
12
|
+
installdir_com = File.join(installdir, 'com')
|
13
13
|
installdir_network = File.join(installdir, 'network')
|
14
|
+
installdir_window = File.join(installdir, 'window')
|
15
|
+
installdir_ntfs = File.join(installdir, 'ntfs')
|
14
16
|
|
15
17
|
FileUtils.mkdir_p(installdir)
|
16
18
|
FileUtils.mkdir_p(installdir_msvcrt)
|
17
19
|
FileUtils.mkdir_p(installdir_gdi)
|
18
20
|
FileUtils.mkdir_p(installdir_com)
|
19
21
|
FileUtils.mkdir_p(installdir_network)
|
22
|
+
FileUtils.mkdir_p(installdir_window)
|
23
|
+
FileUtils.mkdir_p(installdir_ntfs)
|
20
24
|
|
21
25
|
Dir["lib/windows/*.rb"].each{ |file|
|
22
26
|
FileUtils.cp(file, installdir, :verbose => true)
|
@@ -36,7 +40,15 @@ task :install do
|
|
36
40
|
|
37
41
|
Dir["lib/windows/network/*.rb"].each{ |file|
|
38
42
|
FileUtils.cp(file, installdir_network, :verbose => true)
|
39
|
-
}
|
43
|
+
}
|
44
|
+
|
45
|
+
Dir["lib/windows/window/*.rb"].each{ |file|
|
46
|
+
FileUtils.cp(file, installdir_window, :verbose => true)
|
47
|
+
}
|
48
|
+
|
49
|
+
Dir["lib/windows/ntfs/*.rb"].each{ |file|
|
50
|
+
FileUtils.cp(file, installdir_ntfs, :verbose => true)
|
51
|
+
}
|
40
52
|
end
|
41
53
|
|
42
54
|
desc "Install the windows-pr package as a gem"
|
data/doc/conversion_guide.txt
CHANGED
@@ -37,16 +37,12 @@ module Windows
|
|
37
37
|
API.new('closesocket', 'L', 'I', 'ws2_32')
|
38
38
|
API.new('connect', 'LPI', 'I', 'ws2_32')
|
39
39
|
API.new('EnumProtocols', 'PPP', 'I', 'mswsock')
|
40
|
-
API.new('freeaddrinfo', 'P', 'V', 'ws2_32')
|
41
|
-
API.new('FreeAddrInfoW', 'P', 'V', 'ws2_32')
|
42
40
|
API.new('GetAcceptExSockaddrs', 'PLLLPPPP', 'V', 'mswsock')
|
43
41
|
API.new('GetAddressByName', 'LPPPLPPPPP', 'V', 'mswsock')
|
44
|
-
API.new('getaddrinfo', 'PPPP', 'I', 'ws2_32')
|
45
42
|
API.new('gethostbyaddr', 'PII', 'L', 'ws2_32')
|
46
43
|
API.new('gethostbyname', 'P', 'L', 'ws2_32')
|
47
44
|
API.new('gethostname', 'PI', 'I', 'ws2_32')
|
48
45
|
API.new('GetNameByType', 'PPL', 'I', 'mswsock')
|
49
|
-
API.new('getnameinfo', 'PLPLPLI', 'I', 'ws2_32')
|
50
46
|
API.new('getpeername', 'LPP', 'I', 'ws2_32')
|
51
47
|
API.new('getprotobyname', 'P', 'L', 'ws2_32')
|
52
48
|
API.new('getprotobynumber', 'L', 'L', 'ws2_32')
|
@@ -104,7 +100,11 @@ module Windows
|
|
104
100
|
begin
|
105
101
|
API.new('ConnectEx', 'LPIPLPP', 'B', 'mswsock')
|
106
102
|
API.new('DisconnectEx', 'LPLL', 'B', 'mswsock')
|
103
|
+
API.new('freeaddrinfo', 'P', 'V', 'ws2_32')
|
104
|
+
API.new('FreeAddrInfoW', 'P', 'V', 'ws2_32')
|
105
|
+
API.new('getaddrinfo', 'PPPP', 'I', 'ws2_32')
|
107
106
|
API.new('GetAddrInfoW', 'PPPP', 'I', 'mswsock')
|
107
|
+
API.new('getnameinfo', 'PLPLPLI', 'I', 'ws2_32')
|
108
108
|
API.new('GetNameInfoW', 'PLPLPLI', 'I', 'ws2_32')
|
109
109
|
rescue Win32::API::LoadLibraryError
|
110
110
|
# Do nothing, not supported on your platform.
|
data/lib/windows/process.rb
CHANGED
@@ -9,6 +9,8 @@ module Windows
|
|
9
9
|
API.auto_constant = true
|
10
10
|
API.auto_method = true
|
11
11
|
API.auto_unicode = true
|
12
|
+
|
13
|
+
# Process access rights
|
12
14
|
|
13
15
|
PROCESS_ALL_ACCESS = 0x1F0FFF
|
14
16
|
PROCESS_CREATE_PROCESS = 0x0080
|
@@ -26,6 +28,8 @@ module Windows
|
|
26
28
|
SYNCHRONIZE = 1048576
|
27
29
|
STILL_ACTIVE = 259
|
28
30
|
|
31
|
+
# Process priority flags
|
32
|
+
|
29
33
|
ABOVE_NORMAL_PRIORITY_CLASS = 0x00008000
|
30
34
|
BELOW_NORMAL_PRIORITY_CLASS = 0x00004000
|
31
35
|
HIGH_PRIORITY_CLASS = 0x00000080
|
@@ -34,6 +38,7 @@ module Windows
|
|
34
38
|
REALTIME_PRIORITY_CLASS = 0x00000100
|
35
39
|
|
36
40
|
# Process creation flags
|
41
|
+
|
37
42
|
CREATE_BREAKAWAY_FROM_JOB = 0x01000000
|
38
43
|
CREATE_DEFAULT_ERROR_MODE = 0x04000000
|
39
44
|
CREATE_NEW_CONSOLE = 0x00000010
|
@@ -96,12 +101,29 @@ module Windows
|
|
96
101
|
API.new('TerminateProcess', 'LL', 'B')
|
97
102
|
API.new('WaitForInputIdle', 'LL', 'L', 'user32')
|
98
103
|
API.new('WTSEnumerateProcesses', 'LLLPP', 'B', 'wtsapi32')
|
99
|
-
|
104
|
+
|
100
105
|
begin
|
101
106
|
API.new('GetProcessId', 'L', 'L')
|
102
107
|
API.new('GetProcessHandleCount', 'LP', 'B')
|
108
|
+
API.new('IsWow64Process', 'LP', 'B')
|
103
109
|
rescue Win32::API::LoadLibraryError
|
104
110
|
# Windows XP or later
|
105
111
|
end
|
112
|
+
|
113
|
+
# Helper method to determine if you're on a 64 bit version of Windows
|
114
|
+
def windows_64?
|
115
|
+
bool = false
|
116
|
+
|
117
|
+
if defined? IsWow64Process
|
118
|
+
buf = 0.chr * 4
|
119
|
+
if IsWow64Process(GetCurrentProcess(), buf)
|
120
|
+
if buf.unpack('I')[0] == 1
|
121
|
+
bool = true
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
bool
|
127
|
+
end
|
106
128
|
end
|
107
129
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'windows/api'
|
2
|
+
|
3
|
+
module Windows
|
4
|
+
module Window
|
5
|
+
module Classes
|
6
|
+
API.auto_namespace = 'Windows::Window::Classes'
|
7
|
+
API.auto_constant = true
|
8
|
+
API.auto_method = true
|
9
|
+
API.auto_unicode = true
|
10
|
+
|
11
|
+
# Class Field Offsets
|
12
|
+
|
13
|
+
GCL_MENUNAME = -8
|
14
|
+
GCL_HBRBACKGROUND = -10
|
15
|
+
GCL_HCURSOR = -12
|
16
|
+
GCL_HICON = -14
|
17
|
+
GCL_HMODULE = -16
|
18
|
+
GCL_CBWNDEXTRA = -18
|
19
|
+
GCL_CBCLSEXTRA = -20
|
20
|
+
GCL_WNDPROC = -24
|
21
|
+
GCL_STYLE = -26
|
22
|
+
GCW_ATOM = -32
|
23
|
+
|
24
|
+
# Window Field Offsets
|
25
|
+
|
26
|
+
GWL_WNDPROC = -4
|
27
|
+
GWL_HINSTANCE = -6
|
28
|
+
GWL_HWNDPARENT = -8
|
29
|
+
GWL_STYLE = -16
|
30
|
+
GWL_EXSTYLE = -20
|
31
|
+
GWL_USERDATA = -21
|
32
|
+
GWL_ID = -12
|
33
|
+
|
34
|
+
API.new('GetClassInfo', 'LPP', 'B', 'user32')
|
35
|
+
API.new('GetClassInfoEx', 'LPP', 'B', 'user32')
|
36
|
+
API.new('GetClassLong', 'LI', 'L', 'user32')
|
37
|
+
API.new('GetClassName', 'LPI', 'I', 'user32')
|
38
|
+
API.new('GetClassWord', 'LI', 'L', 'user32')
|
39
|
+
API.new('GetWindowLong', 'LI', 'L', 'user32')
|
40
|
+
API.new('RegisterClass', 'P', 'L', 'user32')
|
41
|
+
API.new('RegisterClassEx', 'P', 'L', 'user32')
|
42
|
+
API.new('SetClassLong', 'LIL', 'L', 'user32')
|
43
|
+
API.new('SetClassWord', 'LIL', 'L', 'user32')
|
44
|
+
API.new('SetWindowLong', 'LIL', 'L', 'user32')
|
45
|
+
API.new('UnregisterClass', 'PL', 'B', 'user32')
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require 'windows/api'
|
2
|
+
|
3
|
+
module Windows
|
4
|
+
module Window
|
5
|
+
module Menu
|
6
|
+
API.auto_namespace = 'Windows::Window::Menu'
|
7
|
+
API.auto_constant = true
|
8
|
+
API.auto_method = true
|
9
|
+
API.auto_unicode = true
|
10
|
+
|
11
|
+
# Menu Flags
|
12
|
+
|
13
|
+
MF_INSERT = 0x00000000
|
14
|
+
MF_CHANGE = 0x00000080
|
15
|
+
MF_APPEND = 0x00000100
|
16
|
+
MF_DELETE = 0x00000200
|
17
|
+
MF_REMOVE = 0x00001000
|
18
|
+
MF_BYCOMMAND = 0x00000000
|
19
|
+
MF_BYPOSITION = 0x00000400
|
20
|
+
MF_SEPARATOR = 0x00000800
|
21
|
+
MF_ENABLED = 0x00000000
|
22
|
+
MF_GRAYED = 0x00000001
|
23
|
+
MF_DISABLED = 0x00000002
|
24
|
+
MF_UNCHECKED = 0x00000000
|
25
|
+
MF_CHECKED = 0x00000008
|
26
|
+
MF_USECHECKBITMAPS = 0x00000200
|
27
|
+
MF_STRING = 0x00000000
|
28
|
+
MF_BITMAP = 0x00000004
|
29
|
+
MF_OWNERDRAW = 0x00000100
|
30
|
+
MF_POPUP = 0x00000010
|
31
|
+
MF_MENUBARBREAK = 0x00000020
|
32
|
+
MF_MENUBREAK = 0x00000040
|
33
|
+
MF_UNHILITE = 0x00000000
|
34
|
+
MF_HILITE = 0x00000080
|
35
|
+
MF_DEFAULT = 0x00001000
|
36
|
+
MF_SYSMENU = 0x00002000
|
37
|
+
MF_HELP = 0x00004000
|
38
|
+
MF_RIGHTJUSTIFY = 0x00004000
|
39
|
+
MF_MOUSESELECT = 0x00008000
|
40
|
+
MF_END = 0x00000080
|
41
|
+
|
42
|
+
# System Objects
|
43
|
+
|
44
|
+
OBJID_WINDOW = 0x00000000
|
45
|
+
OBJID_SYSMENU = 0xFFFFFFFF
|
46
|
+
OBJID_TITLEBAR = 0xFFFFFFFE
|
47
|
+
OBJID_MENU = 0xFFFFFFFD
|
48
|
+
OBJID_CLIENT = 0xFFFFFFFC
|
49
|
+
OBJID_VSCROLL = 0xFFFFFFFB
|
50
|
+
OBJID_HSCROLL = 0xFFFFFFFA
|
51
|
+
OBJID_SIZEGRIP = 0xFFFFFFF9
|
52
|
+
OBJID_CARET = 0xFFFFFFF8
|
53
|
+
OBJID_CURSOR = 0xFFFFFFF7
|
54
|
+
OBJID_ALERT = 0xFFFFFFF6
|
55
|
+
OBJID_SOUND = 0xFFFFFFF5
|
56
|
+
OBJID_QUERYCLASSNAMEIDX = 0xFFFFFFF4
|
57
|
+
OBJID_NATIVEOM = 0xFFFFFFF0
|
58
|
+
|
59
|
+
API.new('AppendMenu', 'LIPP', 'B', 'user32')
|
60
|
+
API.new('CheckMenuItem', 'LII', 'L', 'user32')
|
61
|
+
API.new('CheckMenuRadioItem', 'LIIII', 'B', 'user32')
|
62
|
+
API.new('CreateMenu', 'V', 'L', 'user32')
|
63
|
+
API.new('CreatePopupMenu', 'V', 'L', 'user32')
|
64
|
+
API.new('DeleteMenu', 'LII', 'B', 'user32')
|
65
|
+
API.new('DestroyMenu', 'L', 'B', 'user32')
|
66
|
+
API.new('DrawMenuBar', 'L', 'B', 'user32')
|
67
|
+
API.new('EnableMenuItem', 'LII', 'B', 'user32')
|
68
|
+
API.new('EndMenu', 'V', 'B', 'user32')
|
69
|
+
API.new('GetMenu', 'L', 'L', 'user32')
|
70
|
+
API.new('GetMenuBarInfo', 'LLLP', 'B', 'user32')
|
71
|
+
API.new('GetMenuCheckMarkDimensions', 'V', 'L', 'user32')
|
72
|
+
API.new('GetMenuDefaultItem', 'LII', 'I', 'user32')
|
73
|
+
API.new('GetMenuInfo', 'LP', 'B', 'user32')
|
74
|
+
API.new('GetMenuItemCount', 'L', 'I', 'user32')
|
75
|
+
API.new('GetMenuItemID', 'LI', 'I', 'user32')
|
76
|
+
API.new('GetMenuItemInfo', 'LIIP', 'B', 'user32')
|
77
|
+
API.new('GetMenuItemRect', 'LLIP', 'B', 'user32')
|
78
|
+
API.new('GetMenuState', 'LLI', 'I', 'user32')
|
79
|
+
API.new('GetMenuString', 'LIPII', 'I', 'user32')
|
80
|
+
API.new('GetSubMenu', 'LI', 'L', 'user32')
|
81
|
+
API.new('GetSystemMenu', 'LI', 'L', 'user32')
|
82
|
+
API.new('HiliteMenuItem', 'LLII', 'B', 'user32')
|
83
|
+
API.new('InsertMenu', 'LIIPP', 'B', 'user32')
|
84
|
+
API.new('InsertMenuItem', 'LIIP', 'B', 'user32')
|
85
|
+
API.new('IsMenu', 'L', 'B', 'user32')
|
86
|
+
API.new('LoadMenu', 'LP', 'L', 'user32')
|
87
|
+
API.new('LoadMenuIndirect', 'P', 'L', 'user32')
|
88
|
+
API.new('MenuItemFromPoint', 'LLP', 'I', 'user32')
|
89
|
+
API.new('ModifyMenu', 'LIIPP', 'B', 'user32')
|
90
|
+
API.new('RemoveMenu', 'LII', 'B', 'user32')
|
91
|
+
API.new('SetMenu', 'LL', 'B', 'user32')
|
92
|
+
API.new('SetMenuDefaultItem', 'LLL', 'B', 'user32')
|
93
|
+
API.new('SetMenuInfo', 'LP', 'B', 'user32')
|
94
|
+
API.new('SetMenuItemBitmaps', 'LIILL', 'B', 'user32')
|
95
|
+
API.new('SetMenuItemInfo', 'LIIP', 'B', 'user32')
|
96
|
+
API.new('TrackPopupMenu', 'LIIIILP', 'B', 'user32')
|
97
|
+
API.new('TrackPopupMenuEx', 'LIIILP', 'B', 'user32')
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -261,7 +261,6 @@ module Windows
|
|
261
261
|
end
|
262
262
|
|
263
263
|
API.new('BroadcastSystemMessage', 'LPILL', 'L', 'user32')
|
264
|
-
API.new('BroadcastSystemMessageEx', 'LPILLP', 'L', 'user32')
|
265
264
|
API.new('DispatchMessage', 'P', 'L', 'user32')
|
266
265
|
API.new('GetInputState', 'V', 'B', 'user32')
|
267
266
|
API.new('GetMessage', 'PLII', 'B', 'user32')
|
@@ -284,6 +283,12 @@ module Windows
|
|
284
283
|
API.new('SetMessageExtraInfo', 'L', 'L', 'user32')
|
285
284
|
API.new('TranslateMessage', 'P', 'B', 'user32')
|
286
285
|
API.new('WaitMessage', 'V', 'B', 'user32')
|
286
|
+
|
287
|
+
begin
|
288
|
+
API.new('BroadcastSystemMessageEx', 'LPILLP', 'L', 'user32')
|
289
|
+
rescue Win32::API::LoadLibraryError
|
290
|
+
# Windows XP or later
|
291
|
+
end
|
287
292
|
end
|
288
293
|
end
|
289
294
|
end
|
data/lib/windows/window/timer.rb
CHANGED
@@ -9,8 +9,8 @@ module Windows
|
|
9
9
|
API.auto_unicode = false
|
10
10
|
|
11
11
|
API.new('KillTimer', 'LP', 'B', 'user32')
|
12
|
-
API.new('QueryPerformanceCounter', 'P', 'B'
|
13
|
-
API.new('QueryPerformanceFrequency', 'P', 'B'
|
12
|
+
API.new('QueryPerformanceCounter', 'P', 'B')
|
13
|
+
API.new('QueryPerformanceFrequency', 'P', 'B')
|
14
14
|
API.new('SetTimer', 'LIIK', 'P', 'user32')
|
15
15
|
end
|
16
16
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_com_automation.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::COM::Automation module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/com/automation'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class TC_Windows_COM_Automation < Test::Unit::TestCase
|
10
|
+
include Windows::COM::Automation
|
11
|
+
|
12
|
+
def test_method_constants
|
13
|
+
assert_respond_to(self, :BstrFromVector)
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_network_winsock.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Winsock module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/network/winsock'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class WinsockFoo
|
10
|
+
include Windows::Network::Winsock
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Network_Winsock < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = WinsockFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(0, WinsockFoo::NS_DEFAULT)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_method_constants
|
23
|
+
assert_not_nil(WinsockFoo::GetTypeByName)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_method_mixins
|
27
|
+
assert_respond_to(@foo, :gethostbyname)
|
28
|
+
assert_respond_to(@foo, :GetTypeByName)
|
29
|
+
end
|
30
|
+
|
31
|
+
def teardown
|
32
|
+
@foo = nil
|
33
|
+
end
|
34
|
+
end
|
data/test/tc_process.rb
CHANGED
@@ -6,24 +6,19 @@
|
|
6
6
|
require 'windows/process'
|
7
7
|
require 'test/unit'
|
8
8
|
|
9
|
-
class ProcessFoo
|
10
|
-
include Windows::Process
|
11
|
-
end
|
12
|
-
|
13
9
|
class TC_Windows_Process < Test::Unit::TestCase
|
14
|
-
|
15
|
-
@foo = ProcessFoo.new
|
16
|
-
end
|
10
|
+
include Windows::Process
|
17
11
|
|
18
|
-
def
|
19
|
-
assert_equal(0x1F0FFF,
|
12
|
+
def test_constants
|
13
|
+
assert_equal(0x1F0FFF, PROCESS_ALL_ACCESS)
|
20
14
|
end
|
21
15
|
|
22
|
-
def
|
23
|
-
|
16
|
+
def test_methods
|
17
|
+
assert_respond_to(self, :CreateProcess)
|
24
18
|
end
|
25
19
|
|
26
|
-
def
|
27
|
-
|
20
|
+
def test_helper_methods
|
21
|
+
assert_respond_to(self, :windows_64?)
|
22
|
+
assert_equal(true, [true, false].include?(windows_64?))
|
28
23
|
end
|
29
24
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_window_classes.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Window::Classes module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/window/classes'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class WindowClassesFoo
|
10
|
+
include Windows::Window::Classes
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Window_Classes < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = WindowClassesFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(-8, WindowClassesFoo::GCL_MENUNAME)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_method_constants
|
23
|
+
assert_not_nil(WindowClassesFoo::GetClassInfo)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_method_mixin
|
27
|
+
assert_respond_to(@foo, :GetClassInfo)
|
28
|
+
end
|
29
|
+
|
30
|
+
def teardown
|
31
|
+
@foo = nil
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_window_dialog.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Window::Dialog module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/window/dialog'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class WindowDialogFoo
|
10
|
+
include Windows::Window::Dialog
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Window_Dialog < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = WindowDialogFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(0, WindowDialogFoo::MB_OK)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_method_constants
|
23
|
+
assert_not_nil(WindowDialogFoo::MessageBox)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_method_mixin
|
27
|
+
assert_respond_to(@foo, :MessageBox)
|
28
|
+
end
|
29
|
+
|
30
|
+
def teardown
|
31
|
+
@foo = nil
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_window_menu.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Window::Menu module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/window/menu'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class WindowMenuFoo
|
10
|
+
include Windows::Window::Menu
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Window_Menu < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = WindowMenuFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(0, WindowMenuFoo::MF_INSERT)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_method_constants
|
23
|
+
assert_not_nil(WindowMenuFoo::AppendMenu)
|
24
|
+
end
|
25
|
+
|
26
|
+
def teardown
|
27
|
+
@foo = nil
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_window_message.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Window::Message module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/window/message'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class WindowMessageFoo
|
10
|
+
include Windows::Window::Message
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Window_Message < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = WindowMessageFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_constants
|
19
|
+
assert_equal(5, WindowMessageFoo::WM_SIZE)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_method_constants
|
23
|
+
assert_not_nil(WindowMessageFoo::PostMessage)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_method_mixin
|
27
|
+
assert_respond_to(@foo, :PostMessage)
|
28
|
+
end
|
29
|
+
|
30
|
+
def teardown
|
31
|
+
@foo = nil
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_window_properties.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Window::Properties module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/window/properties'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class WindowPropertiesFoo
|
10
|
+
include Windows::Window::Properties
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Window_Properties < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = WindowPropertiesFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_method_constants
|
19
|
+
assert_not_nil(WindowPropertiesFoo::EnumProps)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_method_mixin
|
23
|
+
assert_respond_to(@foo, :EnumProps)
|
24
|
+
end
|
25
|
+
|
26
|
+
def teardown
|
27
|
+
@foo = nil
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#####################################################################
|
2
|
+
# tc_window_timer.rb
|
3
|
+
#
|
4
|
+
# Test case for the Windows::Window::Timer module.
|
5
|
+
#####################################################################
|
6
|
+
require 'windows/window/timer'
|
7
|
+
require 'test/unit'
|
8
|
+
|
9
|
+
class WindowTimerFoo
|
10
|
+
include Windows::Window::Timer
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_Windows_Window_Timer < Test::Unit::TestCase
|
14
|
+
def setup
|
15
|
+
@foo = WindowTimerFoo.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_method_constants
|
19
|
+
assert_not_nil(WindowTimerFoo::KillTimer)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_method_mixin
|
23
|
+
assert_respond_to(@foo, :KillTimer)
|
24
|
+
end
|
25
|
+
|
26
|
+
def teardown
|
27
|
+
@foo = nil
|
28
|
+
end
|
29
|
+
end
|
data/windows-pr.gemspec
CHANGED
@@ -2,7 +2,7 @@ require "rubygems"
|
|
2
2
|
|
3
3
|
spec = Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'windows-pr'
|
5
|
-
gem.version = '1.0.
|
5
|
+
gem.version = '1.0.1'
|
6
6
|
gem.authors = ['Daniel J. Berger', 'Park Heesob']
|
7
7
|
gem.email = 'djberg96@gmail.com'
|
8
8
|
gem.homepage = 'http://www.rubyforge.org/projects/win32utils'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: windows-pr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-02-
|
13
|
+
date: 2009-02-09 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -91,13 +91,16 @@ files:
|
|
91
91
|
- lib/windows/tool_helper.rb
|
92
92
|
- lib/windows/unicode.rb
|
93
93
|
- lib/windows/volume.rb
|
94
|
+
- lib/windows/window/classes.rb
|
94
95
|
- lib/windows/window/dialog.rb
|
96
|
+
- lib/windows/window/menu.rb
|
95
97
|
- lib/windows/window/message.rb
|
96
98
|
- lib/windows/window/properties.rb
|
97
99
|
- lib/windows/window/timer.rb
|
98
100
|
- lib/windows/window.rb
|
99
101
|
- test/tc_clipboard.rb
|
100
102
|
- test/tc_com.rb
|
103
|
+
- test/tc_com_automation.rb
|
101
104
|
- test/tc_console.rb
|
102
105
|
- test/tc_debug.rb
|
103
106
|
- test/tc_device_io.rb
|
@@ -120,6 +123,7 @@ files:
|
|
120
123
|
- test/tc_national.rb
|
121
124
|
- test/tc_network_management.rb
|
122
125
|
- test/tc_network_snmp.rb
|
126
|
+
- test/tc_network_winsock.rb
|
123
127
|
- test/tc_nio.rb
|
124
128
|
- test/tc_ntfs_winternl.rb
|
125
129
|
- test/tc_path.rb
|
@@ -138,6 +142,12 @@ files:
|
|
138
142
|
- test/tc_unicode.rb
|
139
143
|
- test/tc_volume.rb
|
140
144
|
- test/tc_window.rb
|
145
|
+
- test/tc_window_classes.rb
|
146
|
+
- test/tc_window_dialog.rb
|
147
|
+
- test/tc_window_menu.rb
|
148
|
+
- test/tc_window_message.rb
|
149
|
+
- test/tc_window_properties.rb
|
150
|
+
- test/tc_window_timer.rb
|
141
151
|
- CHANGES
|
142
152
|
- doc
|
143
153
|
- lib
|
@@ -175,6 +185,7 @@ summary: Windows functions and constants bundled via Win32::API
|
|
175
185
|
test_files:
|
176
186
|
- test/tc_clipboard.rb
|
177
187
|
- test/tc_com.rb
|
188
|
+
- test/tc_com_automation.rb
|
178
189
|
- test/tc_console.rb
|
179
190
|
- test/tc_debug.rb
|
180
191
|
- test/tc_device_io.rb
|
@@ -197,6 +208,7 @@ test_files:
|
|
197
208
|
- test/tc_national.rb
|
198
209
|
- test/tc_network_management.rb
|
199
210
|
- test/tc_network_snmp.rb
|
211
|
+
- test/tc_network_winsock.rb
|
200
212
|
- test/tc_nio.rb
|
201
213
|
- test/tc_ntfs_winternl.rb
|
202
214
|
- test/tc_path.rb
|
@@ -215,3 +227,9 @@ test_files:
|
|
215
227
|
- test/tc_unicode.rb
|
216
228
|
- test/tc_volume.rb
|
217
229
|
- test/tc_window.rb
|
230
|
+
- test/tc_window_classes.rb
|
231
|
+
- test/tc_window_dialog.rb
|
232
|
+
- test/tc_window_menu.rb
|
233
|
+
- test/tc_window_message.rb
|
234
|
+
- test/tc_window_properties.rb
|
235
|
+
- test/tc_window_timer.rb
|