windows-pr 0.6.6 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/MANIFEST +1 -0
- data/lib/windows/clipboard.rb +17 -52
- data/lib/windows/com.rb +54 -0
- data/lib/windows/console.rb +62 -281
- data/lib/windows/debug.rb +36 -0
- data/lib/windows/device_io.rb +9 -7
- data/lib/windows/directory.rb +20 -75
- data/lib/windows/error.rb +51 -36
- data/lib/windows/eventlog.rb +20 -101
- data/lib/windows/file.rb +59 -295
- data/lib/windows/file_mapping.rb +14 -32
- data/lib/windows/filesystem.rb +8 -10
- data/lib/windows/handle.rb +15 -11
- data/lib/windows/library.rb +21 -63
- data/lib/windows/memory.rb +28 -106
- data/lib/windows/msvcrt/buffer.rb +20 -15
- data/lib/windows/msvcrt/file.rb +38 -7
- data/lib/windows/msvcrt/io.rb +180 -80
- data/lib/windows/msvcrt/string.rb +20 -15
- data/lib/windows/national.rb +16 -39
- data/lib/windows/network_management.rb +93 -92
- data/lib/windows/nio.rb +26 -0
- data/lib/windows/path.rb +68 -349
- data/lib/windows/pipe.rb +18 -56
- data/lib/windows/process.rb +28 -110
- data/lib/windows/registry.rb +27 -142
- data/lib/windows/security.rb +34 -142
- data/lib/windows/service.rb +34 -80
- data/lib/windows/shell.rb +10 -16
- data/lib/windows/sound.rb +17 -31
- data/lib/windows/synchronize.rb +24 -90
- data/lib/windows/system_info.rb +16 -47
- data/lib/windows/unicode.rb +21 -41
- data/lib/windows/volume.rb +23 -83
- data/lib/windows/window.rb +11 -17
- data/windows-pr.gemspec +3 -2
- metadata +17 -5
data/CHANGES
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
= 0.7.0 - 9-Aug-2007
|
2
|
+
* All modules now use the windows-api library behind the scenes.
|
3
|
+
* Added the Windows::NIO module. This contains native Windows IO functions.
|
4
|
+
* Added several more functions to the Windows::GDI::PaintDrawing module.
|
5
|
+
* Fixed the prototype for the GetWindowsDirectory function in the
|
6
|
+
Windows::SystemInfo module.
|
7
|
+
|
1
8
|
= 0.6.6 - 3-May-2007
|
2
9
|
* Added the Windows::MSVCRT::IO module.
|
3
10
|
* Removed the SetConsoleCommandHistoryMode method from the Windows::Console
|
data/MANIFEST
CHANGED
data/lib/windows/clipboard.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
require '
|
1
|
+
require 'windows/api'
|
2
|
+
include Windows
|
2
3
|
|
3
4
|
module Windows
|
4
5
|
module Clipboard
|
6
|
+
API.auto_namespace = 'Windows::Clipboard'
|
7
|
+
API.auto_constant = true
|
8
|
+
API.auto_method = true
|
9
|
+
API.auto_unicode = true
|
10
|
+
|
5
11
|
CF_TEXT = 1
|
6
12
|
CF_BITMAP = 2
|
7
13
|
CF_METAFILEPICT = 3
|
@@ -17,56 +23,15 @@ module Windows
|
|
17
23
|
CF_UNICODETEXT = 13
|
18
24
|
CF_ENHMETAFILE = 14
|
19
25
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
RegisterClipboardFormat = Win32API.new('user32', 'RegisterClipboardFormat', 'P', 'I')
|
31
|
-
|
32
|
-
def OpenClipboard(handle)
|
33
|
-
OpenClipboard.call(handle) > 0
|
34
|
-
end
|
35
|
-
|
36
|
-
def CloseClipboard
|
37
|
-
CloseClipboard.call > 0
|
38
|
-
end
|
39
|
-
|
40
|
-
def GetClipboardData(format)
|
41
|
-
GetClipboardData.call(format)
|
42
|
-
end
|
43
|
-
|
44
|
-
def EmptyClipboard
|
45
|
-
EmptyClipboard.call > 0
|
46
|
-
end
|
47
|
-
|
48
|
-
def SetClipboardData(format, handle)
|
49
|
-
SetClipboardData.call(format, handle)
|
50
|
-
end
|
51
|
-
|
52
|
-
def CountClipboardFormats
|
53
|
-
CountClipboardFormats.call
|
54
|
-
end
|
55
|
-
|
56
|
-
def IsClipboardFormatAvailable(format)
|
57
|
-
IsClipboardFormatAvailable.call(format) > 0
|
58
|
-
end
|
59
|
-
|
60
|
-
def GetClipboardFormatName(format, format_name, max)
|
61
|
-
GetClipboardFormatName.call(format, format_name, max)
|
62
|
-
end
|
63
|
-
|
64
|
-
def EnumClipboardFormats(format)
|
65
|
-
EnumClipboardFormats.call(format)
|
66
|
-
end
|
67
|
-
|
68
|
-
def RegisterClipboardFormat(format)
|
69
|
-
RegisterClipboardFormat.call(format)
|
70
|
-
end
|
26
|
+
API.new('OpenClipboard', 'L', 'B', 'user32')
|
27
|
+
API.new('CloseClipboard', 'V', 'B', 'user32')
|
28
|
+
API.new('GetClipboardData', 'I', 'P', 'user32')
|
29
|
+
API.new('EmptyClipboard', 'V', 'B', 'user32')
|
30
|
+
API.new('SetClipboardData', 'IL', 'L', 'user32')
|
31
|
+
API.new('CountClipboardFormats', 'V', 'I', 'user32')
|
32
|
+
API.new('IsClipboardFormatAvailable', 'I', 'B', 'user32')
|
33
|
+
API.new('GetClipboardFormatName', 'IPI', 'I', 'user32')
|
34
|
+
API.new('EnumClipboardFormats', 'I', 'I', 'user32')
|
35
|
+
API.new('RegisterClipboardFormat', 'P', 'I', 'user32')
|
71
36
|
end
|
72
37
|
end
|
data/lib/windows/com.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'windows/api'
|
2
|
+
include Windows
|
3
|
+
|
4
|
+
module Windows
|
5
|
+
module COM
|
6
|
+
API.auto_namespace = 'Windows::COM'
|
7
|
+
API.auto_constant = true
|
8
|
+
API.auto_method = true
|
9
|
+
API.auto_unicode = true
|
10
|
+
|
11
|
+
API.new('BindMoniker', 'PLPP', 'L', 'ole32')
|
12
|
+
API.new('CLSIDFromProgID', 'PP', 'L', 'ole32')
|
13
|
+
API.new('CLSIDFromProgIDEx', 'PP', 'L', 'ole32')
|
14
|
+
API.new('CLSIDFromString', 'PP', 'L', 'ole32')
|
15
|
+
API.new('CoAddRefServerProcess', 'V', 'L', 'ole32')
|
16
|
+
API.new('CoAllowSetForegroundWindow', 'PP', 'L', 'ole32')
|
17
|
+
API.new('CoCancelCall', 'LL', 'L', 'ole32')
|
18
|
+
API.new('CoCopyProxy', 'PP', 'L', 'ole32')
|
19
|
+
API.new('CoCreateFreeThreadedMarshaler', 'PP', 'L', 'ole32')
|
20
|
+
API.new('CoCreateGuid', 'P', 'L', 'ole32')
|
21
|
+
API.new('CoCreateInstance', 'PPLPP', 'L', 'ole32')
|
22
|
+
API.new('CoCreateInstanceEx', 'PPLPLP', 'L', 'ole32')
|
23
|
+
API.new('CoDisableCallCancellation', 'L', 'L', 'ole32')
|
24
|
+
API.new('CoDisconnectObject', 'PL', 'L', 'ole32')
|
25
|
+
#API.new('CoDosDateTimeToFileTime', 'LLP', 'L')
|
26
|
+
API.new('CoEnableCallCancellation', 'L', 'L', 'ole32')
|
27
|
+
API.new('CoFileTimeNow', 'P', 'L', 'ole32')
|
28
|
+
API.new('CoFileTimeToDosDateTime', 'LLL', 'B', 'ole32')
|
29
|
+
API.new('CoFreeAllLibraries', 'V', 'V', 'ole32')
|
30
|
+
API.new('CoFreeLibrary', 'L', 'V', 'ole32')
|
31
|
+
API.new('CoFreeUnusedLibraries', 'V', 'V', 'ole32')
|
32
|
+
API.new('CoFreeUnusedLibrariesEx', 'V', 'V', 'ole32')
|
33
|
+
API.new('CoGetCallContext', 'PP', 'L', 'ole32')
|
34
|
+
API.new('CoGetCallerTID', 'P', 'L', 'ole32')
|
35
|
+
API.new('CoGetCancelObject', 'LPP', 'L', 'ole32')
|
36
|
+
API.new('CoGetClassObject', 'PLPPP', 'L', 'ole32')
|
37
|
+
API.new('CoGetContextToken', 'P', 'L', 'ole32')
|
38
|
+
API.new('CoGetCurrentLogicalThreadId', 'P', 'L', 'ole32')
|
39
|
+
API.new('CoGetCurrentProcess', 'V', 'L', 'ole32')
|
40
|
+
API.new('CoGetInstanceFromFile', 'PPPLLPLP', 'L', 'ole32')
|
41
|
+
API.new('CoGetInstanceFromIStorage', 'PPPLPLP', 'L', 'ole32')
|
42
|
+
API.new('CoInitialize', 'P', 'L', 'ole32')
|
43
|
+
API.new('CoTaskMemFree', 'P', 'V', 'ole32')
|
44
|
+
API.new('CoUninitialize', 'V', 'V', 'ole32')
|
45
|
+
API.new('StringFromGUID2', 'PPI', 'I', 'ole32')
|
46
|
+
|
47
|
+
# Windows Vista
|
48
|
+
begin
|
49
|
+
API.new('CoDisconnectContext', 'L', 'L', 'ole32')
|
50
|
+
rescue RuntimeError
|
51
|
+
# Ignore - you must check for these methods via 'defined?'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/windows/console.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
require '
|
1
|
+
require 'windows/api'
|
2
|
+
include Windows
|
2
3
|
|
3
4
|
module Windows
|
4
5
|
module Console
|
6
|
+
API.auto_namespace = 'Windows::Console'
|
7
|
+
API.auto_constant = true
|
8
|
+
API.auto_method = true
|
9
|
+
API.auto_unicode = true
|
10
|
+
|
5
11
|
CTRL_C_EVENT = 0
|
6
12
|
CTRL_BREAK_EVENT = 1
|
7
13
|
CTRL_LOGOFF_EVENT = 5
|
@@ -42,63 +48,63 @@ module Windows
|
|
42
48
|
CONSOLE_OVERSTRIKE = 1
|
43
49
|
CONSOLE_FULLSCREEN_HARDWARE = 2
|
44
50
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
51
|
+
API.new('AddConsoleAlias', 'PPP', 'B')
|
52
|
+
API.new('AllocConsole', 'V', 'B')
|
53
|
+
API.new('CreateConsoleScreenBuffer', 'LLPLP', 'L')
|
54
|
+
API.new('FillConsoleOutputAttribute', 'LILLP', 'B')
|
55
|
+
API.new('FillConsoleOutputCharacter', 'LILLP', 'B')
|
56
|
+
API.new('FlushConsoleInputBuffer', 'L', 'B')
|
57
|
+
API.new('FreeConsole', 'V', 'B')
|
58
|
+
API.new('GenerateConsoleCtrlEvent', 'LL', 'B')
|
59
|
+
API.new('GetConsoleAlias', 'PPLP', 'L')
|
60
|
+
API.new('GetConsoleAliases', 'PLP', 'L')
|
61
|
+
API.new('GetConsoleAliasesLength', 'P', 'L')
|
62
|
+
API.new('GetConsoleAliasExes', 'PL', 'L')
|
63
|
+
API.new('GetConsoleAliasExesLength', 'V', 'L')
|
64
|
+
API.new('GetConsoleCP', 'V', 'I')
|
65
|
+
API.new('GetConsoleCursorInfo', 'LP', 'B')
|
66
|
+
API.new('GetConsoleMode', 'LP', 'B')
|
67
|
+
API.new('GetConsoleOutputCP', 'V', 'I')
|
68
|
+
API.new('GetConsoleScreenBufferInfo', 'LP', 'B')
|
69
|
+
API.new('GetConsoleTitle', 'PL', 'L')
|
70
|
+
API.new('GetLargestConsoleWindowSize', 'L', 'L')
|
71
|
+
API.new('GetNumberOfConsoleInputEvents', 'LP', 'B')
|
72
|
+
API.new('GetNumberOfConsoleMouseButtons', 'L', 'B')
|
73
|
+
API.new('GetStdHandle', 'L', 'L')
|
74
|
+
API.new('PeekConsoleInput', 'LPLP', 'B')
|
75
|
+
API.new('ReadConsole', 'LPLPP', 'B')
|
76
|
+
API.new('ReadConsoleInput', 'LPLP', 'B')
|
77
|
+
API.new('ReadConsoleOutput', 'LPLLP', 'B')
|
78
|
+
API.new('ReadConsoleOutputAttribute', 'LPLLP', 'B')
|
79
|
+
API.new('ReadConsoleOutputCharacter', 'LPLLP', 'B')
|
80
|
+
API.new('ScrollConsoleScreenBuffer', 'LPPLP', 'B')
|
81
|
+
API.new('SetConsoleActiveScreenBuffer', 'L', 'B')
|
82
|
+
API.new('SetConsoleCP', 'L', 'B')
|
83
|
+
API.new('SetConsoleCtrlHandler', 'PI', 'B')
|
84
|
+
API.new('SetConsoleCursorInfo', 'LP', 'B')
|
85
|
+
API.new('SetConsoleCursorPosition', 'LP', 'B')
|
86
|
+
API.new('SetConsoleMode', 'LL', 'B')
|
87
|
+
API.new('SetConsoleOutputCP', 'I', 'B')
|
88
|
+
API.new('SetConsoleScreenBufferSize', 'LL', 'B')
|
89
|
+
API.new('SetConsoleTextAttribute', 'LL', 'B')
|
90
|
+
API.new('SetConsoleTitle', 'P', 'B')
|
91
|
+
API.new('SetConsoleWindowInfo', 'LIP', 'B')
|
92
|
+
API.new('SetStdHandle', 'LL', 'B')
|
93
|
+
API.new('WriteConsole', 'LPLPP', 'B')
|
94
|
+
API.new('WriteConsoleInput', 'LPLP', 'B')
|
95
|
+
API.new('WriteConsoleOutput', 'LPLLP', 'B')
|
96
|
+
API.new('WriteConsoleOutputAttribute', 'LPLLP', 'B')
|
97
|
+
API.new('WriteConsoleOutputCharacter', 'LPLLP', 'B')
|
92
98
|
|
93
99
|
# Windows XP or later
|
94
100
|
begin
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
101
|
+
API.new('AttachConsole', 'L', 'B')
|
102
|
+
API.new('GetConsoleDisplayMode', 'P', 'L')
|
103
|
+
API.new('GetConsoleFontSize', 'LL', 'L')
|
104
|
+
API.new('GetConsoleProcessList', 'PL', 'L')
|
105
|
+
API.new('GetConsoleSelectionInfo', 'P', 'B')
|
106
|
+
API.new('GetCurrentConsoleFont' , 'LIP', 'B')
|
107
|
+
API.new('SetConsoleDisplayMode', 'LLP', 'B')
|
102
108
|
rescue Exception
|
103
109
|
# Do nothing - not supported on current platform. It's up to you to
|
104
110
|
# check for the existence of the constant in your code.
|
@@ -106,235 +112,10 @@ module Windows
|
|
106
112
|
|
107
113
|
# Windows 2000 or later
|
108
114
|
begin
|
109
|
-
|
115
|
+
API.new('GetConsoleWindow', 'V', 'L')
|
110
116
|
rescue Exception
|
111
117
|
# Do nothing - not supported on current platform. It's up to you to
|
112
118
|
# check for the existence of the constant in your code.
|
113
119
|
end
|
114
|
-
|
115
|
-
def AddConsoleAlias(source, target, exe)
|
116
|
-
AddConsoleAlias.call(source, target, exe) != 0
|
117
|
-
end
|
118
|
-
|
119
|
-
def AllocConsole()
|
120
|
-
AllocConsole.call != 0
|
121
|
-
end
|
122
|
-
|
123
|
-
def CreateConsoleScreenBuffer(access, mode, sec, flags, data)
|
124
|
-
CreateConsoleScreenBuffer.call(access, mode, sec, flags, data)
|
125
|
-
end
|
126
|
-
|
127
|
-
def FillConsoleOutputAttribute(handle, attribute, length, coord, num)
|
128
|
-
FillConsoleOutputAttribute.call(handle, attribute, length, coord, num) != 0
|
129
|
-
end
|
130
|
-
|
131
|
-
def FlushConsoleInputBuffer(handle)
|
132
|
-
FlushConsoleInputBuffer.call(handle) != 0
|
133
|
-
end
|
134
|
-
|
135
|
-
def FreeConsole()
|
136
|
-
FreeConsole.call != 0
|
137
|
-
end
|
138
|
-
|
139
|
-
def GenerateConsoleCtrlEvent(ctrl_event, process_group_id)
|
140
|
-
GenerateConsoleCtrlEvent.call(ctrl_event, process_group_id) != 0
|
141
|
-
end
|
142
|
-
|
143
|
-
def GetConsoleAliases(buffer, buffer_length, exe_name)
|
144
|
-
GetConsoleAliases.call(buffer, buffer_length, exe_name)
|
145
|
-
end
|
146
|
-
|
147
|
-
def GetConsoleAliasesLength(exe_name)
|
148
|
-
GetConsoleAliasesLength.call(exe_name)
|
149
|
-
end
|
150
|
-
|
151
|
-
def GetConsoleAliasExes(buffer, buffer_length)
|
152
|
-
GetConsoleAliasExes.call(buffer, buffer_length)
|
153
|
-
end
|
154
|
-
|
155
|
-
def GetConsoleAliasExesLength()
|
156
|
-
GetConsoleAliasExesLength.call
|
157
|
-
end
|
158
|
-
|
159
|
-
def GetConsoleCP()
|
160
|
-
GetConsoleCP.call
|
161
|
-
end
|
162
|
-
|
163
|
-
def GetConsoleCursorInfo(handle, cursor_info_ptr)
|
164
|
-
GetConsoleCursorInfo.call(handle, cursor_info_ptr)
|
165
|
-
end
|
166
|
-
|
167
|
-
def GetConsoleMode(handle, mode)
|
168
|
-
GetConsoleMode.call(handle, mode) != 0
|
169
|
-
end
|
170
|
-
|
171
|
-
def GetConsoleOutputCP()
|
172
|
-
GetConsoleOutputCP.call
|
173
|
-
end
|
174
|
-
|
175
|
-
def GetConsoleScreenBufferInfo(handle, buf_info)
|
176
|
-
GetConsoleScreenBufferInfo.call(handle, buf_info) != 0
|
177
|
-
end
|
178
|
-
|
179
|
-
def GetConsoleTitle(title, size)
|
180
|
-
GetConsoleTitle.call(title, size)
|
181
|
-
end
|
182
|
-
|
183
|
-
def GetLargestConsoleWindowSize(handle)
|
184
|
-
GetLargestConsoleWindowSize.call(handle)
|
185
|
-
end
|
186
|
-
|
187
|
-
def GetNumberOfConsoleInputEvents(handle, num_events)
|
188
|
-
GetNumberOfConsoleInputEvents.call(handle, num_events)
|
189
|
-
end
|
190
|
-
|
191
|
-
def GetNumberOfConsoleMouseButtons(num_mouse_buttons)
|
192
|
-
GetNumberOfConsoleMouseButtons.call(num_mouse_buttons)
|
193
|
-
end
|
194
|
-
|
195
|
-
def GetStdHandle(std_handle)
|
196
|
-
GetStdHandle.call(std_handle)
|
197
|
-
end
|
198
|
-
|
199
|
-
def PeekConsoleInput(handle, buffer, length, num_events)
|
200
|
-
PeekConsoleInput.call(handle, buffer, length, num_events) != 0
|
201
|
-
end
|
202
|
-
|
203
|
-
def ReadConsole(handle, buffer, num_to_read, num_read, res = 0)
|
204
|
-
ReadConsole.call(handle, buffer, num_to_read, num_read, res) != 0
|
205
|
-
end
|
206
|
-
|
207
|
-
def ReadConsoleInput(handle, buffer, length, num_read)
|
208
|
-
ReadConsoleInput.call(handle, buffer, length, num_read) != 0
|
209
|
-
end
|
210
|
-
|
211
|
-
def ReadConsoleOutput(handle, buffer, buf_size, buf_coord, reg)
|
212
|
-
ReadConsoleOutput.call(handle, buffer, buf_size, buf_coord, reg) != 0
|
213
|
-
end
|
214
|
-
|
215
|
-
def ReadConsoleOutputAttribute(handle, attrib, len, coord, num_read)
|
216
|
-
ReadConsoleOutputAttribute.call(handle, attrib, len, coord, num_read) != 0
|
217
|
-
end
|
218
|
-
|
219
|
-
def ReadConsoleOutputCharacter(handle, char, length, coord, num_read)
|
220
|
-
ReadConsoleOutputCharacter.call(handle, char, length, coord, num_read) != 0
|
221
|
-
end
|
222
|
-
|
223
|
-
def ScrollConsoleScreenBuffer(handle, scroll, clip, coord, fill)
|
224
|
-
ScrollConsoleScreenBuffer.call(handle, scroll, clip, coord, fill) != 0
|
225
|
-
end
|
226
|
-
|
227
|
-
def SetConsoleActiveScreenBuffer(handle)
|
228
|
-
SetConsoleActiveScreenBuffer.call(handle) != 0
|
229
|
-
end
|
230
|
-
|
231
|
-
def SetConsoleCP(code_page_id)
|
232
|
-
SetConsoleCP.call(code_page_id) != 0
|
233
|
-
end
|
234
|
-
|
235
|
-
def SetConsoleCtrlHandler(handler, add)
|
236
|
-
SetConsoleCtrlHandler.call(handler, add) != 0
|
237
|
-
end
|
238
|
-
|
239
|
-
def SetConsoleCursorInfo(handle, cursor)
|
240
|
-
SetConsoleCursorInfo.call(handle, cursor) != 0
|
241
|
-
end
|
242
|
-
|
243
|
-
def SetConsoleCursorPosition(handle, coord)
|
244
|
-
SetConsoleCursorPosition.call(handle, coord) != 0
|
245
|
-
end
|
246
|
-
|
247
|
-
def SetConsoleHistoryInfo(info)
|
248
|
-
SetConsoleHistoryInfo.call(info) != 0
|
249
|
-
end
|
250
|
-
|
251
|
-
def SetConsoleMode(handle, mode)
|
252
|
-
SetConsoleMode.call(handle, mode) != 0
|
253
|
-
end
|
254
|
-
|
255
|
-
def SetConsoleOutputCP(code_page_id)
|
256
|
-
SetConsoleOutputCP.call(code_page_id) != 0
|
257
|
-
end
|
258
|
-
|
259
|
-
def SetConsoleScreenBufferSize(handle, size)
|
260
|
-
SetConsoleScreenBufferSize.call(handle, size) != 0
|
261
|
-
end
|
262
|
-
|
263
|
-
def SetConsoleTextAttribute(handle, attribute)
|
264
|
-
SetConsoleTextAttribute.call(handle, attribute) != 0
|
265
|
-
end
|
266
|
-
|
267
|
-
def SetConsoleTitle(title)
|
268
|
-
SetConsoleTitle.call(title) != 0
|
269
|
-
end
|
270
|
-
|
271
|
-
def SetConsoleWindowInfo(handle, absolute, window)
|
272
|
-
SetConsoleWindowInfo.call(handle, absolute, window) != 0
|
273
|
-
end
|
274
|
-
|
275
|
-
def SetStdHandle(std_handle, handle)
|
276
|
-
SetStdHandle.call(std_handle, handle) != 0
|
277
|
-
end
|
278
|
-
|
279
|
-
def WriteConsole(handle, buffer, num_to_write, num_written, res = 0)
|
280
|
-
WriteConsole.call(handle, buffer, num_to_write, num_written, res) != 0
|
281
|
-
end
|
282
|
-
|
283
|
-
def WriteConsoleInput(handle, buffer, length, num_events)
|
284
|
-
WriteConsoleInput.call(handle, buffer, length, num_events) != 0
|
285
|
-
end
|
286
|
-
|
287
|
-
def WriteConsoleOutput(handle, buffer, buf_size, coord, region)
|
288
|
-
WriteConsoleOutput.call(handle, buffer, buf_size, coord, region) != 0
|
289
|
-
end
|
290
|
-
|
291
|
-
def WriteConsoleOutputAttribute(handle, attrib, length, coord, num)
|
292
|
-
WriteConsoleOutputAttribute.call(handle, attrib, length, coord, num) != 0
|
293
|
-
end
|
294
|
-
|
295
|
-
def WriteConsoleOutputCharacter(handle, char, length, coord, num)
|
296
|
-
WriteConsoleOutputCharacter.call(handle, char, length, coord, num) != 0
|
297
|
-
end
|
298
|
-
|
299
|
-
begin
|
300
|
-
def AttachConsole(pid)
|
301
|
-
AttachConsole.call(pid)
|
302
|
-
end
|
303
|
-
|
304
|
-
# The docs say this returns a BOOL, but really it's a DWORD
|
305
|
-
def GetConsoleDisplayMode(flags)
|
306
|
-
GetConsoleDisplayMode.call(flags)
|
307
|
-
end
|
308
|
-
|
309
|
-
def GetConsoleFontSize(handle, font)
|
310
|
-
GetConsoleFontSize.call(handle, font)
|
311
|
-
end
|
312
|
-
|
313
|
-
def GetConsoleProcessList(proc_list, proc_count)
|
314
|
-
GetConsoleProcessList.call(proc_list, proc_count)
|
315
|
-
end
|
316
|
-
|
317
|
-
def GetConsoleSelectionInfo(info_struct)
|
318
|
-
GetConsoleSelectionInfo.call(info_struct) != 0
|
319
|
-
end
|
320
|
-
|
321
|
-
def GetCurrentConsoleFont(handle, max_window, current_font_struct)
|
322
|
-
GetCurrentConsoleFont.call(handle, max_window, current_font_struct)
|
323
|
-
end
|
324
|
-
|
325
|
-
def SetConsoleDisplayMode(handle, flags, coord)
|
326
|
-
SetConsoleDisplayMode.call(handle, flags, coord) != 0
|
327
|
-
end
|
328
|
-
rescue Exception
|
329
|
-
# Windows XP or later
|
330
|
-
end
|
331
|
-
|
332
|
-
begin
|
333
|
-
def GetConsoleWindow()
|
334
|
-
GetConsoleWindow.call
|
335
|
-
end
|
336
|
-
rescue Exception
|
337
|
-
# Windows 2000 or later
|
338
|
-
end
|
339
120
|
end
|
340
121
|
end
|