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 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
@@ -20,6 +20,7 @@ lib/windows/library.rb
20
20
  lib/windows/limits.rb
21
21
  lib/windows/memory.rb
22
22
  lib/windows/national.rb
23
+ lib/windows/nio.rb
23
24
  lib/windows/network_management.rb
24
25
  lib/windows/path.rb
25
26
  lib/windows/pipe.rb
@@ -1,7 +1,13 @@
1
- require 'Win32API'
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
- OpenClipboard = Win32API.new('user32', 'OpenClipboard', 'L', 'I')
21
- CloseClipboard = Win32API.new('user32', 'CloseClipboard', 'V', 'I')
22
- GetClipboardData = Win32API.new('user32', 'GetClipboardData', 'I', 'P')
23
- EmptyClipboard = Win32API.new('user32', 'EmptyClipboard', 'V', 'I')
24
- SetClipboardData = Win32API.new('user32', 'SetClipboardData', 'II', 'I')
25
-
26
- CountClipboardFormats = Win32API.new('user32', 'CountClipboardFormats', 'V', 'I')
27
- IsClipboardFormatAvailable = Win32API.new('user32', 'IsClipboardFormatAvailable', 'I', 'I')
28
- GetClipboardFormatName = Win32API.new('user32', 'GetClipboardFormatName', 'IPI', 'I')
29
- EnumClipboardFormats = Win32API.new('user32', 'EnumClipboardFormats', 'I', 'I')
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
@@ -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
@@ -1,7 +1,13 @@
1
- require 'Win32API'
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
- AddConsoleAlias = Win32API.new('kernel32', 'AddConsoleAlias', 'PPP', 'I')
46
- AllocConsole = Win32API.new('kernel32', 'AllocConsole', 'V', 'I')
47
- CreateConsoleScreenBuffer = Win32API.new('kernel32', 'CreateConsoleScreenBuffer', 'LLPLP', 'L')
48
- FillConsoleOutputAttribute = Win32API.new('kernel32', 'FillConsoleOutputAttribute', 'LILLP', 'I')
49
- FillConsoleOutputCharacter = Win32API.new('kernel32', 'FillConsoleOutputCharacter', 'LILLP', 'I')
50
- FlushConsoleInputBuffer = Win32API.new('kernel32', 'FlushConsoleInputBuffer', 'L', 'I')
51
- FreeConsole = Win32API.new('kernel32', 'FreeConsole', 'V', 'I')
52
- GenerateConsoleCtrlEvent = Win32API.new('kernel32', 'GenerateConsoleCtrlEvent', 'LL', 'I')
53
- GetConsoleAlias = Win32API.new('kernel32', 'GetConsoleAlias', 'PPLP', 'L')
54
- GetConsoleAliases = Win32API.new('kernel32', 'GetConsoleAliases', 'PLP', 'L')
55
- GetConsoleAliasesLength = Win32API.new('kernel32', 'GetConsoleAliasesLength', 'P', 'L')
56
- GetConsoleAliasExes = Win32API.new('kernel32', 'GetConsoleAliasExes', 'PL', 'L')
57
- GetConsoleAliasExesLength = Win32API.new('kernel32', 'GetConsoleAliasExesLength', 'V', 'L')
58
- GetConsoleCP = Win32API.new('kernel32', 'GetConsoleCP', 'V', 'I')
59
- GetConsoleCursorInfo = Win32API.new('kernel32', 'GetConsoleCursorInfo', 'LP', 'I')
60
- GetConsoleMode = Win32API.new('kernel32', 'GetConsoleMode', 'LP', 'I')
61
- GetConsoleOutputCP = Win32API.new('kernel32', 'GetConsoleOutputCP', 'V', 'I')
62
- GetConsoleScreenBufferInfo = Win32API.new('kernel32', 'GetConsoleScreenBufferInfo', 'LP', 'I')
63
- GetConsoleTitle = Win32API.new('kernel32', 'GetConsoleTitle', 'PL', 'L')
64
- GetLargestConsoleWindowSize = Win32API.new('kernel32', 'GetLargestConsoleWindowSize', 'L', 'L')
65
- GetNumberOfConsoleInputEvents = Win32API.new('kernel32', 'GetNumberOfConsoleInputEvents', 'LP', 'I')
66
- GetNumberOfConsoleMouseButtons = Win32API.new('kernel32', 'GetNumberOfConsoleMouseButtons', 'L', 'I')
67
- GetStdHandle = Win32API.new('kernel32', 'GetStdHandle', 'L', 'L')
68
- PeekConsoleInput = Win32API.new('kernel32', 'PeekConsoleInput', 'LPLP', 'I')
69
- ReadConsole = Win32API.new('kernel32', 'ReadConsole', 'LPLPP', 'I')
70
- ReadConsoleInput = Win32API.new('kernel32', 'ReadConsoleInput', 'LPLP', 'I')
71
- ReadConsoleOutput = Win32API.new('kernel32', 'ReadConsoleOutput', 'LPLLP', 'I')
72
- ReadConsoleOutputAttribute = Win32API.new('kernel32', 'ReadConsoleOutputAttribute', 'LPLLP', 'I')
73
- ReadConsoleOutputCharacter = Win32API.new('kernel32', 'ReadConsoleOutputCharacter', 'LPLLP', 'I')
74
- ScrollConsoleScreenBuffer = Win32API.new('kernel32', 'ScrollConsoleScreenBuffer', 'LPPLP', 'I')
75
- SetConsoleActiveScreenBuffer = Win32API.new('kernel32', 'SetConsoleActiveScreenBuffer', 'L', 'I')
76
- SetConsoleCP = Win32API.new('kernel32', 'SetConsoleCP', 'L', 'I')
77
- SetConsoleCtrlHandler = Win32API.new('kernel32', 'SetConsoleCtrlHandler', 'PI', 'I')
78
- SetConsoleCursorInfo = Win32API.new('kernel32', 'SetConsoleCursorInfo', 'LP', 'I')
79
- SetConsoleCursorPosition = Win32API.new('kernel32', 'SetConsoleCursorPosition', 'LP', 'I')
80
- SetConsoleMode = Win32API.new('kernel32', 'SetConsoleMode', 'LL', 'I')
81
- SetConsoleOutputCP = Win32API.new('kernel32', 'SetConsoleOutputCP', 'I', 'I')
82
- SetConsoleScreenBufferSize = Win32API.new('kernel32', 'SetConsoleScreenBufferSize', 'LL', 'I')
83
- SetConsoleTextAttribute = Win32API.new('kernel32', 'SetConsoleTextAttribute', 'LL', 'I')
84
- SetConsoleTitle = Win32API.new('kernel32', 'SetConsoleTitle', 'P', 'I')
85
- SetConsoleWindowInfo = Win32API.new('kernel32', 'SetConsoleWindowInfo', 'LIP', 'I')
86
- SetStdHandle = Win32API.new('kernel32', 'SetStdHandle', 'LL', 'I')
87
- WriteConsole = Win32API.new('kernel32', 'WriteConsole', 'LPLPP', 'I')
88
- WriteConsoleInput = Win32API.new('kernel32', 'WriteConsoleInput', 'LPLP', 'I')
89
- WriteConsoleOutput = Win32API.new('kernel32', 'WriteConsoleOutput', 'LPLLP', 'I')
90
- WriteConsoleOutputAttribute = Win32API.new('kernel32', 'WriteConsoleOutputAttribute', 'LPLLP', 'I')
91
- WriteConsoleOutputCharacter = Win32API.new('kernel32', 'WriteConsoleOutputCharacter', 'LPLLP', 'I')
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
- AttachConsole = Win32API.new('kernel32', 'AttachConsole', 'L', 'I')
96
- GetConsoleDisplayMode = Win32API.new('kernel32', 'GetConsoleDisplayMode', 'P', 'L')
97
- GetConsoleFontSize = Win32API.new('kernel32', 'GetConsoleFontSize', 'LL', 'L')
98
- GetConsoleProcessList = Win32API.new('kernel32', 'GetConsoleProcessList', 'PL', 'L')
99
- GetConsoleSelectionInfo = Win32API.new('kernel32', 'GetConsoleSelectionInfo', 'P', 'I')
100
- GetCurrentConsoleFont = Win32API.new('kernel32', 'GetCurrentConsoleFont' , 'LIP', 'I')
101
- SetConsoleDisplayMode = Win32API.new('kernel32', 'SetConsoleDisplayMode', 'LLP', 'I')
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
- GetConsoleWindow = Win32API.new('kernel32', 'GetConsoleWindow', 'V', 'L')
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