fzeet 0.4.2 → 0.5.0

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.
Files changed (63) hide show
  1. data/examples/Dialog/FileDialog.rbw +34 -0
  2. data/examples/Raw/UIRibbon/Command.dll +0 -0
  3. data/examples/Raw/UIRibbon/Command.rb +22 -0
  4. data/examples/Raw/UIRibbon/Command.rbw +51 -0
  5. data/examples/Raw/UIRibbon/Command.xml +65 -0
  6. data/examples/Raw/UIRibbon/Minimal.dll +0 -0
  7. data/examples/Raw/UIRibbon/Minimal.rb +16 -0
  8. data/examples/Raw/UIRibbon/Minimal.rbw +39 -0
  9. data/examples/Raw/UIRibbon/Minimal.xml +55 -0
  10. data/examples/UIRibbon/Command.dll +0 -0
  11. data/examples/UIRibbon/Command.rb +22 -0
  12. data/examples/UIRibbon/Command.rbw +20 -0
  13. data/examples/UIRibbon/Command.xml +65 -0
  14. data/examples/UIRibbon/Minimal.dll +0 -0
  15. data/examples/UIRibbon/Minimal.rb +16 -0
  16. data/examples/UIRibbon/Minimal.rbw +8 -0
  17. data/examples/UIRibbon/Minimal.xml +55 -0
  18. data/examples/UIRibbon/Viewer.rbw +9 -0
  19. data/examples/res/go-next-small.bmp +0 -0
  20. data/examples/res/go-next.bmp +0 -0
  21. data/examples/res/go-previous-small.bmp +0 -0
  22. data/examples/res/go-previous.bmp +0 -0
  23. data/lib/fzeet/Control.rb +1 -89
  24. data/lib/fzeet/ControlButton.rb +28 -0
  25. data/lib/fzeet/ControlCommon.rb +64 -0
  26. data/lib/fzeet/Dialog.rb +1 -0
  27. data/lib/fzeet/DialogCommon.rb +5 -0
  28. data/lib/fzeet/DialogFileDialog.rb +116 -0
  29. data/lib/fzeet/UIRibbon.rb +99 -0
  30. data/lib/fzeet/Window.rb +2 -336
  31. data/lib/fzeet/WindowCommon.rb +256 -0
  32. data/lib/fzeet/WindowDialog.rb +73 -0
  33. data/lib/fzeet/WindowWindow.rb +13 -0
  34. data/lib/fzeet/common.rb +2 -0
  35. data/lib/fzeet/windows/com.rb +186 -0
  36. data/lib/fzeet/windows/comctl.rb +1 -59
  37. data/lib/fzeet/windows/comctlbutton.rb +30 -0
  38. data/lib/fzeet/windows/comctlcommon.rb +34 -0
  39. data/lib/fzeet/windows/comdlg.rb +1 -0
  40. data/lib/fzeet/windows/comdlgcommon.rb +9 -0
  41. data/lib/fzeet/windows/comdlgofn.rb +70 -0
  42. data/lib/fzeet/windows/common.rb +18 -0
  43. data/lib/fzeet/windows/kernel.rb +3 -0
  44. data/lib/fzeet/windows/libc.rb +1 -0
  45. data/lib/fzeet/windows/ole.rb +213 -0
  46. data/lib/fzeet/windows/shell.rb +43 -0
  47. data/lib/fzeet/windows/uiribbon.rb +111 -0
  48. data/lib/fzeet/windows/user.rb +7 -438
  49. data/lib/fzeet/windows/usercommon.rb +8 -0
  50. data/lib/fzeet/windows/userctl.rb +1 -68
  51. data/lib/fzeet/windows/userctlbutton.rb +56 -0
  52. data/lib/fzeet/windows/userctlcommon.rb +12 -0
  53. data/lib/fzeet/windows/userkbd.rb +20 -0
  54. data/lib/fzeet/windows/usermbox.rb +62 -0
  55. data/lib/fzeet/windows/usermenu.rb +50 -0
  56. data/lib/fzeet/windows/usermsg.rb +1 -6
  57. data/lib/fzeet/windows/userspi.rb +29 -0
  58. data/lib/fzeet/windows/userwnd.rb +276 -0
  59. data/lib/fzeet/windows.rb +24 -4
  60. data/lib/fzeet.rb +2 -0
  61. metadata +54 -6
  62. /data/examples/{Dialog.rbw → Dialog/Dialog.rbw} +0 -0
  63. /data/examples/{DialogApplication.rbw → Dialog/DialogApplication.rbw} +0 -0
@@ -1,438 +1,7 @@
1
- require_relative 'common'
2
-
3
- module Fzeet
4
- module Windows
5
- ffi_lib 'user32'
6
- ffi_convention :stdcall
7
-
8
- #{ MB_xxx
9
- MB_OK = 0x00000000
10
- MB_OKCANCEL = 0x00000001
11
- MB_ABORTRETRYIGNORE = 0x00000002
12
- MB_YESNOCANCEL = 0x00000003
13
- MB_YESNO = 0x00000004
14
- MB_RETRYCANCEL = 0x00000005
15
- MB_CANCELTRYCONTINUE = 0x00000006
16
- MB_ICONHAND = 0x00000010
17
- MB_ICONQUESTION = 0x00000020
18
- MB_ICONEXCLAMATION = 0x00000030
19
- MB_ICONASTERISK = 0x00000040
20
- MB_USERICON = 0x00000080
21
- MB_ICONWARNING = MB_ICONEXCLAMATION
22
- MB_ICONERROR = MB_ICONHAND
23
- MB_ICONINFORMATION = MB_ICONASTERISK
24
- MB_ICONSTOP = MB_ICONHAND
25
- MB_DEFBUTTON1 = 0x00000000
26
- MB_DEFBUTTON2 = 0x00000100
27
- MB_DEFBUTTON3 = 0x00000200
28
- MB_DEFBUTTON4 = 0x00000300
29
- MB_APPLMODAL = 0x00000000
30
- MB_SYSTEMMODAL = 0x00001000
31
- MB_TASKMODAL = 0x00002000
32
- MB_HELP = 0x00004000
33
- MB_NOFOCUS = 0x00008000
34
- MB_SETFOREGROUND = 0x00010000
35
- MB_DEFAULT_DESKTOP_ONLY = 0x00020000
36
- MB_TOPMOST = 0x00040000
37
- MB_RIGHT = 0x00080000
38
- MB_RTLREADING = 0x00100000
39
- MB_SERVICE_NOTIFICATION = 0x00200000
40
- MB_SERVICE_NOTIFICATION_NT3X = 0x00040000
41
- MB_TYPEMASK = 0x0000000F
42
- MB_ICONMASK = 0x000000F0
43
- MB_DEFMASK = 0x00000F00
44
- MB_MODEMASK = 0x00003000
45
- MB_MISCMASK = 0x0000C000
46
- #}
47
-
48
- #{ IDxxx
49
- IDOK = 1
50
- IDCANCEL = 2
51
- IDABORT = 3
52
- IDRETRY = 4
53
- IDIGNORE = 5
54
- IDYES = 6
55
- IDNO = 7
56
- IDCLOSE = 8
57
- IDHELP = 9
58
- IDTRYAGAIN = 10
59
- IDCONTINUE = 11
60
- IDTIMEOUT = 32000
61
- #}
62
-
63
- attach_function :MessageBox, :MessageBoxA, [:pointer, :string, :string, :uint], :int
64
-
65
- callback :WNDPROC, [:pointer, :uint, :uint, :long], :long
66
-
67
- attach_function :DefWindowProc, :DefWindowProcA, [:pointer, :uint, :uint, :long], :long
68
-
69
- callback :DLGPROC, [:pointer, :uint, :uint, :long], :int
70
-
71
- attach_function :DefDlgProc, :DefDlgProcA, [:pointer, :uint, :uint, :long], :long
72
-
73
- #{ IDI_xxx
74
- IDI_APPLICATION = FFI::Pointer.new(32512)
75
- IDI_HAND = FFI::Pointer.new(32513)
76
- IDI_QUESTION = FFI::Pointer.new(32514)
77
- IDI_EXCLAMATION = FFI::Pointer.new(32515)
78
- IDI_ASTERISK = FFI::Pointer.new(32516)
79
- IDI_WINLOGO = FFI::Pointer.new(32517)
80
- IDI_SHIELD = FFI::Pointer.new(32518)
81
- IDI_WARNING = IDI_EXCLAMATION
82
- IDI_ERROR = IDI_HAND
83
- IDI_INFORMATION = IDI_ASTERISK
84
- #}
85
-
86
- attach_function :LoadIcon, :LoadIconA, [:pointer, :pointer], :pointer
87
-
88
- #{ IDC_xxx
89
- IDC_ARROW = FFI::Pointer.new(32512)
90
- IDC_IBEAM = FFI::Pointer.new(32513)
91
- IDC_WAIT = FFI::Pointer.new(32514)
92
- IDC_CROSS = FFI::Pointer.new(32515)
93
- IDC_UPARROW = FFI::Pointer.new(32516)
94
- IDC_SIZE = FFI::Pointer.new(32640)
95
- IDC_ICON = FFI::Pointer.new(32641)
96
- IDC_SIZENWSE = FFI::Pointer.new(32642)
97
- IDC_SIZENESW = FFI::Pointer.new(32643)
98
- IDC_SIZEWE = FFI::Pointer.new(32644)
99
- IDC_SIZENS = FFI::Pointer.new(32645)
100
- IDC_SIZEALL = FFI::Pointer.new(32646)
101
- IDC_NO = FFI::Pointer.new(32648)
102
- IDC_HAND = FFI::Pointer.new(32649)
103
- IDC_APPSTARTING = FFI::Pointer.new(32650)
104
- IDC_HELP = FFI::Pointer.new(32651)
105
- #}
106
-
107
- attach_function :LoadCursor, :LoadCursorA, [:pointer, :pointer], :pointer
108
-
109
- IMAGE_BITMAP = 0
110
-
111
- LR_LOADFROMFILE = 0x00000010
112
- LR_CREATEDIBSECTION = 0x00002000
113
-
114
- attach_function :LoadImage, :LoadImageA, [:pointer, :string, :uint, :int, :int, :uint], :pointer
115
-
116
- #{ COLOR_xxx
117
- COLOR_SCROLLBAR = 0
118
- COLOR_BACKGROUND = 1
119
- COLOR_ACTIVECAPTION = 2
120
- COLOR_INACTIVECAPTION = 3
121
- COLOR_MENU = 4
122
- COLOR_WINDOW = 5
123
- COLOR_WINDOWFRAME = 6
124
- COLOR_MENUTEXT = 7
125
- COLOR_WINDOWTEXT = 8
126
- COLOR_CAPTIONTEXT = 9
127
- COLOR_ACTIVEBORDER = 10
128
- COLOR_INACTIVEBORDER = 11
129
- COLOR_APPWORKSPACE = 12
130
- COLOR_HIGHLIGHT = 13
131
- COLOR_HIGHLIGHTTEXT = 14
132
- COLOR_BTNFACE = 15
133
- COLOR_BTNSHADOW = 16
134
- COLOR_GRAYTEXT = 17
135
- COLOR_BTNTEXT = 18
136
- COLOR_INACTIVECAPTIONTEXT = 19
137
- COLOR_BTNHIGHLIGHT = 20
138
- COLOR_3DDKSHADOW = 21
139
- COLOR_3DLIGHT = 22
140
- COLOR_INFOTEXT = 23
141
- COLOR_INFOBK = 24
142
- COLOR_HOTLIGHT = 26
143
- COLOR_GRADIENTACTIVECAPTION = 27
144
- COLOR_GRADIENTINACTIVECAPTION = 28
145
- COLOR_MENUHILIGHT = 29
146
- COLOR_MENUBAR = 30
147
- COLOR_DESKTOP = COLOR_BACKGROUND
148
- COLOR_3DFACE = COLOR_BTNFACE
149
- COLOR_3DSHADOW = COLOR_BTNSHADOW
150
- COLOR_3DHIGHLIGHT = COLOR_BTNHIGHLIGHT
151
- COLOR_3DHILIGHT = COLOR_BTNHIGHLIGHT
152
- COLOR_BTNHILIGHT = COLOR_BTNHIGHLIGHT
153
- #}
154
-
155
- #{ CTLCOLOR_xxx
156
- CTLCOLOR_MSGBOX = 0
157
- CTLCOLOR_EDIT = 1
158
- CTLCOLOR_LISTBOX = 2
159
- CTLCOLOR_BTN = 3
160
- CTLCOLOR_DLG = 4
161
- CTLCOLOR_SCROLLBAR = 5
162
- CTLCOLOR_STATIC = 6
163
- CTLCOLOR_MAX = 7
164
- #}
165
-
166
- class WNDCLASSEX < FFI::Struct
167
- layout \
168
- :cbSize, :uint,
169
- :style, :uint,
170
- :lpfnWndProc, :WNDPROC,
171
- :cbClsExtra, :int,
172
- :cbWndExtra, :int,
173
- :hInstance, :pointer,
174
- :hIcon, :pointer,
175
- :hCursor, :pointer,
176
- :hbrBackground, :pointer,
177
- :lpszMenuName, :pointer,
178
- :lpszClassName, :pointer,
179
- :hIconSm, :pointer
180
- end
181
-
182
- attach_function :RegisterClassEx, :RegisterClassExA, [:pointer], :ushort
183
-
184
- #{ WS_xxx
185
- WS_OVERLAPPED = 0x00000000
186
- WS_POPUP = 0x80000000
187
- WS_CHILD = 0x40000000
188
- WS_MINIMIZE = 0x20000000
189
- WS_VISIBLE = 0x10000000
190
- WS_DISABLED = 0x08000000
191
- WS_CLIPSIBLINGS = 0x04000000
192
- WS_CLIPCHILDREN = 0x02000000
193
- WS_MAXIMIZE = 0x01000000
194
- WS_CAPTION = 0x00C00000
195
- WS_BORDER = 0x00800000
196
- WS_DLGFRAME = 0x00400000
197
- WS_VSCROLL = 0x00200000
198
- WS_HSCROLL = 0x00100000
199
- WS_SYSMENU = 0x00080000
200
- WS_THICKFRAME = 0x00040000
201
- WS_GROUP = 0x00020000
202
- WS_TABSTOP = 0x00010000
203
- WS_MINIMIZEBOX = 0x00020000
204
- WS_MAXIMIZEBOX = 0x00010000
205
- WS_TILED = WS_OVERLAPPED
206
- WS_ICONIC = WS_MINIMIZE
207
- WS_SIZEBOX = WS_THICKFRAME
208
- WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
209
- WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW
210
- WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU
211
- WS_CHILDWINDOW = WS_CHILD
212
- WS_ACTIVECAPTION = 0x0001
213
- #}
214
-
215
- #{ WS_EX_xxx
216
- WS_EX_DLGMODALFRAME = 0x00000001
217
- WS_EX_NOPARENTNOTIFY = 0x00000004
218
- WS_EX_TOPMOST = 0x00000008
219
- WS_EX_ACCEPTFILES = 0x00000010
220
- WS_EX_TRANSPARENT = 0x00000020
221
- WS_EX_MDICHILD = 0x00000040
222
- WS_EX_TOOLWINDOW = 0x00000080
223
- WS_EX_WINDOWEDGE = 0x00000100
224
- WS_EX_CLIENTEDGE = 0x00000200
225
- WS_EX_CONTEXTHELP = 0x00000400
226
- WS_EX_RIGHT = 0x00001000
227
- WS_EX_LEFT = 0x00000000
228
- WS_EX_RTLREADING = 0x00002000
229
- WS_EX_LTRREADING = 0x00000000
230
- WS_EX_LEFTSCROLLBAR = 0x00004000
231
- WS_EX_RIGHTSCROLLBAR = 0x00000000
232
- WS_EX_CONTROLPARENT = 0x00010000
233
- WS_EX_STATICEDGE = 0x00020000
234
- WS_EX_APPWINDOW = 0x00040000
235
- WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE
236
- WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST
237
- WS_EX_LAYERED = 0x00080000
238
- WS_EX_NOINHERITLAYOUT = 0x00100000
239
- WS_EX_LAYOUTRTL = 0x00400000
240
- WS_EX_COMPOSITED = 0x02000000
241
- WS_EX_NOACTIVATE = 0x08000000
242
- #}
243
-
244
- CW_USEDEFAULT = -0x80000000
245
-
246
- class CREATESTRUCT < FFI::Struct
247
- layout \
248
- :lpCreateParams, :pointer,
249
- :hInstance, :pointer,
250
- :hMenu, :pointer,
251
- :hwndParent, :pointer,
252
- :cy, :int,
253
- :cx, :int,
254
- :y, :int,
255
- :x, :int,
256
- :style, :long,
257
- :lpszName, :pointer,
258
- :lpszClass, :pointer,
259
- :dwExStyle, :ulong
260
- end
261
-
262
- attach_function :CreateWindowEx, :CreateWindowExA, [:ulong, :string, :string, :ulong, :int, :int, :int, :int, :pointer, :pointer, :pointer, :pointer], :pointer
263
- attach_function :CreateDialogIndirectParam, :CreateDialogIndirectParamA, [:pointer, :pointer, :pointer, :DLGPROC, :long], :pointer
264
- attach_function :DestroyWindow, [:pointer], :int
265
-
266
- #{ DS_xxx
267
- DS_ABSALIGN = 0x01
268
- DS_SYSMODAL = 0x02
269
- DS_LOCALEDIT = 0x20
270
- DS_SETFONT = 0x40
271
- DS_MODALFRAME = 0x80
272
- DS_NOIDLEMSG = 0x100
273
- DS_SETFOREGROUND = 0x200
274
- DS_3DLOOK = 0x0004
275
- DS_FIXEDSYS = 0x0008
276
- DS_NOFAILCREATE = 0x0010
277
- DS_CONTROL = 0x0400
278
- DS_CENTER = 0x0800
279
- DS_CENTERMOUSE = 0x1000
280
- DS_CONTEXTHELP = 0x2000
281
- DS_SHELLFONT = DS_SETFONT | DS_FIXEDSYS
282
- DS_USEPIXELS = 0x8000
283
- #}
284
-
285
- class DLGTEMPLATE < FFI::Struct
286
- layout \
287
- :style, :ulong,
288
- :dwExtendedStyle, :ulong,
289
- :cdit, :ushort,
290
- :x, :short,
291
- :y, :short,
292
- :cx, :short,
293
- :cy, :short,
294
- :menu, :ushort,
295
- :windowClass, :ushort,
296
- :title, :ushort
297
- end
298
-
299
- attach_function :DialogBoxIndirectParam, :DialogBoxIndirectParamA, [:pointer, :pointer, :pointer, :DLGPROC, :long], :int
300
- attach_function :EndDialog, [:pointer, :int], :int
301
-
302
- SW_SHOWNORMAL = 1
303
-
304
- attach_function :ShowWindow, [:pointer, :int], :int
305
-
306
- attach_function :UpdateWindow, [:pointer], :int
307
-
308
- attach_function :GetWindowTextLength, :GetWindowTextLengthA, [:pointer], :int
309
- attach_function :GetWindowText, :GetWindowTextA, [:pointer, :pointer, :int], :int
310
- attach_function :SetWindowText, :SetWindowTextA, [:pointer, :string], :int
311
-
312
- attach_function :IsWindowEnabled, [:pointer], :int
313
- attach_function :EnableWindow, [:pointer, :int], :int
314
-
315
- attach_function :GetCursorPos, [:pointer], :int
316
-
317
- attach_function :ScreenToClient, [:pointer, :pointer], :int
318
- attach_function :ClientToScreen, [:pointer, :pointer], :int
319
-
320
- attach_function :GetCapture, [], :pointer
321
- attach_function :SetCapture, [:pointer], :pointer
322
- attach_function :ReleaseCapture, [], :int
323
-
324
- attach_function :GetDC, [:pointer], :pointer
325
- attach_function :ReleaseDC, [:pointer, :pointer], :int
326
-
327
- attach_function :GetDlgItem, [:pointer, :int], :pointer
328
-
329
- callback :WNDENUMPROC, [:pointer, :long], :int
330
-
331
- attach_function :EnumChildWindows, [:pointer, :WNDENUMPROC, :long], :int
332
-
333
- attach_function :GetMenu, [:pointer], :pointer
334
- attach_function :SetMenu, [:pointer, :pointer], :int
335
-
336
- attach_function :CreateMenu, [], :pointer
337
- attach_function :CreatePopupMenu, [], :pointer
338
- attach_function :DestroyMenu, [:pointer], :int
339
-
340
- MF_SEPARATOR = 0x00000800
341
- MF_ENABLED = 0x00000000
342
- MF_GRAYED = 0x00000001
343
- MF_UNCHECKED = 0x00000000
344
- MF_CHECKED = 0x00000008
345
- MF_USECHECKBITMAPS = 0x00000200
346
- MF_STRING = 0x00000000
347
- MF_POPUP = 0x00000010
348
- MF_RIGHTJUSTIFY = 0x00004000
349
-
350
- MFT_RADIOCHECK = 0x00000200
351
-
352
- attach_function :AppendMenu, :AppendMenuA, [:pointer, :uint, :uint, :string], :int
353
- attach_function :GetMenuState, [:pointer, :uint, :uint], :uint
354
- attach_function :EnableMenuItem, [:pointer, :uint, :uint], :int
355
- attach_function :CheckMenuItem, [:pointer, :uint, :uint], :ulong
356
- attach_function :CheckMenuRadioItem, [:pointer, :uint, :uint, :uint, :uint], :int
357
-
358
- MIIM_BITMAP = 0x00000080
359
-
360
- class MENUITEMINFO < FFI::Struct
361
- layout \
362
- :cbSize, :uint,
363
- :fMask, :uint,
364
- :fType, :uint,
365
- :fState, :uint,
366
- :wID, :uint,
367
- :hSubMenu, :pointer,
368
- :hbmpChecked, :pointer,
369
- :hbmpUnchecked, :pointer,
370
- :dwItemData, :ulong,
371
- :dwTypeData, :pointer,
372
- :cch, :uint,
373
- :hbmpItem, :pointer
374
- end
375
-
376
- attach_function :GetMenuItemInfo, :GetMenuItemInfoA, [:pointer, :uint, :int, :pointer], :int
377
- attach_function :SetMenuItemInfo, :SetMenuItemInfoA, [:pointer, :uint, :int, :pointer], :int
378
-
379
- attach_function :TrackPopupMenu, [:pointer, :uint, :int, :int, :int, :pointer, :pointer], :int
380
-
381
- FVIRTKEY = 1
382
- FSHIFT = 0x04
383
- FCONTROL = 0x08
384
- FALT = 0x10
385
-
386
- class ACCEL < FFI::Struct
387
- layout \
388
- :fVirt, :uchar,
389
- :key, :ushort,
390
- :cmd, :ushort
391
- end
392
-
393
- attach_function :CreateAcceleratorTable, :CreateAcceleratorTableA, [:pointer, :int], :pointer
394
- attach_function :DestroyAcceleratorTable, [:pointer], :int
395
-
396
- SPI_GETNONCLIENTMETRICS = 0x0029
397
-
398
- class LOGFONT < FFI::Struct
399
- layout \
400
- :lfHeight, :long,
401
- :lfWidth, :long,
402
- :lfEscapement, :long,
403
- :lfOrientation, :long,
404
- :lfWeight, :long,
405
- :lfItalic, :uchar,
406
- :lfUnderline, :uchar,
407
- :lfStrikeOut, :uchar,
408
- :lfCharSet, :uchar,
409
- :lfOutPrecision, :uchar,
410
- :lfClipPrecision, :uchar,
411
- :lfQuality, :uchar,
412
- :lfPitchAndFamily, :uchar,
413
- :lfFaceName, [:char, 32]
414
- end
415
-
416
- class NONCLIENTMETRICS < FFI::Struct
417
- layout \
418
- :cbSize, :uint,
419
- :iBorderWidth, :int,
420
- :iScrollWidth, :int,
421
- :iScrollHeight, :int,
422
- :iCaptionWidth, :int,
423
- :iCaptionHeight, :int,
424
- :lfCaptionFont, LOGFONT,
425
- :iSmCaptionWidth, :int,
426
- :iSmCaptionHeight, :int,
427
- :lfSmCaptionFont, LOGFONT,
428
- :iMenuWidth, :int,
429
- :iMenuHeight, :int,
430
- :lfMenuFont, LOGFONT,
431
- :lfStatusFont, LOGFONT,
432
- :lfMessageFont, LOGFONT,
433
- :iPaddedBorderWidth, :int
434
- end
435
-
436
- attach_function :SystemParametersInfo, :SystemParametersInfoA, [:uint, :uint, :pointer, :uint], :int
437
- end
438
- end
1
+ require_relative 'usermbox'
2
+ require_relative 'userwnd'
3
+ require_relative 'usermsg'
4
+ require_relative 'usermenu'
5
+ require_relative 'userkbd'
6
+ require_relative 'userctl'
7
+ require_relative 'userspi'
@@ -0,0 +1,8 @@
1
+ require_relative 'common'
2
+
3
+ module Fzeet
4
+ module Windows
5
+ ffi_lib 'user32'
6
+ ffi_convention :stdcall
7
+ end
8
+ end
@@ -1,68 +1 @@
1
- require_relative 'common'
2
-
3
- module Fzeet
4
- module Windows
5
- if __FILE__ == $0
6
- ffi_lib 'user32'
7
- ffi_convention :stdcall
8
- end
9
-
10
- class NMHDR < FFI::Struct
11
- layout \
12
- :hwndFrom, :pointer,
13
- :idFrom, :uint,
14
- :code, :uint
15
- end
16
-
17
- BS_PUSHBUTTON = 0x00000000
18
- BS_DEFPUSHBUTTON = 0x00000001
19
- BS_CHECKBOX = 0x00000002
20
- BS_AUTOCHECKBOX = 0x00000003
21
- BS_RADIOBUTTON = 0x00000004
22
- BS_3STATE = 0x00000005
23
- BS_AUTO3STATE = 0x00000006
24
- BS_GROUPBOX = 0x00000007
25
- BS_USERBUTTON = 0x00000008
26
- BS_AUTORADIOBUTTON = 0x00000009
27
- BS_PUSHBOX = 0x0000000A
28
- BS_OWNERDRAW = 0x0000000B
29
- BS_TYPEMASK = 0x0000000F
30
- BS_LEFTTEXT = 0x00000020
31
- BS_TEXT = 0x00000000
32
- BS_ICON = 0x00000040
33
- BS_BITMAP = 0x00000080
34
- BS_LEFT = 0x00000100
35
- BS_RIGHT = 0x00000200
36
- BS_CENTER = 0x00000300
37
- BS_TOP = 0x00000400
38
- BS_BOTTOM = 0x00000800
39
- BS_VCENTER = 0x00000C00
40
- BS_PUSHLIKE = 0x00001000
41
- BS_MULTILINE = 0x00002000
42
- BS_NOTIFY = 0x00004000
43
- BS_FLAT = 0x00008000
44
- BS_RIGHTBUTTON = BS_LEFTTEXT
45
-
46
- BM_GETCHECK = 0x00F0
47
- BM_SETCHECK = 0x00F1
48
- BM_GETSTATE = 0x00F2
49
- BM_SETSTATE = 0x00F3
50
- BM_SETSTYLE = 0x00F4
51
- BM_CLICK = 0x00F5
52
- BM_GETIMAGE = 0x00F6
53
- BM_SETIMAGE = 0x00F7
54
- BM_SETDONTCLICK = 0x00F8
55
-
56
- BN_CLICKED = 0
57
- BN_PAINT = 1
58
- BN_HILITE = 2
59
- BN_UNHILITE = 3
60
- BN_DISABLE = 4
61
- BN_DOUBLECLICKED = 5
62
- BN_PUSHED = BN_HILITE
63
- BN_UNPUSHED = BN_UNHILITE
64
- BN_DBLCLK = BN_DOUBLECLICKED
65
- BN_SETFOCUS = 6
66
- BN_KILLFOCUS = 7
67
- end
68
- end
1
+ require_relative 'userctlbutton'
@@ -0,0 +1,56 @@
1
+ require_relative 'userctlcommon'
2
+
3
+ module Fzeet
4
+ module Windows
5
+ BS_PUSHBUTTON = 0x00000000
6
+ BS_DEFPUSHBUTTON = 0x00000001
7
+ BS_CHECKBOX = 0x00000002
8
+ BS_AUTOCHECKBOX = 0x00000003
9
+ BS_RADIOBUTTON = 0x00000004
10
+ BS_3STATE = 0x00000005
11
+ BS_AUTO3STATE = 0x00000006
12
+ BS_GROUPBOX = 0x00000007
13
+ BS_USERBUTTON = 0x00000008
14
+ BS_AUTORADIOBUTTON = 0x00000009
15
+ BS_PUSHBOX = 0x0000000A
16
+ BS_OWNERDRAW = 0x0000000B
17
+ BS_TYPEMASK = 0x0000000F
18
+ BS_LEFTTEXT = 0x00000020
19
+ BS_TEXT = 0x00000000
20
+ BS_ICON = 0x00000040
21
+ BS_BITMAP = 0x00000080
22
+ BS_LEFT = 0x00000100
23
+ BS_RIGHT = 0x00000200
24
+ BS_CENTER = 0x00000300
25
+ BS_TOP = 0x00000400
26
+ BS_BOTTOM = 0x00000800
27
+ BS_VCENTER = 0x00000C00
28
+ BS_PUSHLIKE = 0x00001000
29
+ BS_MULTILINE = 0x00002000
30
+ BS_NOTIFY = 0x00004000
31
+ BS_FLAT = 0x00008000
32
+ BS_RIGHTBUTTON = BS_LEFTTEXT
33
+
34
+ BM_GETCHECK = 0x00F0
35
+ BM_SETCHECK = 0x00F1
36
+ BM_GETSTATE = 0x00F2
37
+ BM_SETSTATE = 0x00F3
38
+ BM_SETSTYLE = 0x00F4
39
+ BM_CLICK = 0x00F5
40
+ BM_GETIMAGE = 0x00F6
41
+ BM_SETIMAGE = 0x00F7
42
+ BM_SETDONTCLICK = 0x00F8
43
+
44
+ BN_CLICKED = 0
45
+ BN_PAINT = 1
46
+ BN_HILITE = 2
47
+ BN_UNHILITE = 3
48
+ BN_DISABLE = 4
49
+ BN_DOUBLECLICKED = 5
50
+ BN_PUSHED = BN_HILITE
51
+ BN_UNPUSHED = BN_UNHILITE
52
+ BN_DBLCLK = BN_DOUBLECLICKED
53
+ BN_SETFOCUS = 6
54
+ BN_KILLFOCUS = 7
55
+ end
56
+ end
@@ -0,0 +1,12 @@
1
+ require_relative 'usercommon'
2
+
3
+ module Fzeet
4
+ module Windows
5
+ class NMHDR < FFI::Struct
6
+ layout \
7
+ :hwndFrom, :pointer,
8
+ :idFrom, :uint,
9
+ :code, :uint
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,20 @@
1
+ require_relative 'usercommon'
2
+
3
+ module Fzeet
4
+ module Windows
5
+ FVIRTKEY = 1
6
+ FSHIFT = 0x04
7
+ FCONTROL = 0x08
8
+ FALT = 0x10
9
+
10
+ class ACCEL < FFI::Struct
11
+ layout \
12
+ :fVirt, :uchar,
13
+ :key, :ushort,
14
+ :cmd, :ushort
15
+ end
16
+
17
+ attach_function :CreateAcceleratorTable, :CreateAcceleratorTableA, [:pointer, :int], :pointer
18
+ attach_function :DestroyAcceleratorTable, [:pointer], :int
19
+ end
20
+ end
@@ -0,0 +1,62 @@
1
+ require_relative 'usercommon'
2
+
3
+ module Fzeet
4
+ module Windows
5
+ #{ MB_xxx
6
+ MB_OK = 0x00000000
7
+ MB_OKCANCEL = 0x00000001
8
+ MB_ABORTRETRYIGNORE = 0x00000002
9
+ MB_YESNOCANCEL = 0x00000003
10
+ MB_YESNO = 0x00000004
11
+ MB_RETRYCANCEL = 0x00000005
12
+ MB_CANCELTRYCONTINUE = 0x00000006
13
+ MB_ICONHAND = 0x00000010
14
+ MB_ICONQUESTION = 0x00000020
15
+ MB_ICONEXCLAMATION = 0x00000030
16
+ MB_ICONASTERISK = 0x00000040
17
+ MB_USERICON = 0x00000080
18
+ MB_ICONWARNING = MB_ICONEXCLAMATION
19
+ MB_ICONERROR = MB_ICONHAND
20
+ MB_ICONINFORMATION = MB_ICONASTERISK
21
+ MB_ICONSTOP = MB_ICONHAND
22
+ MB_DEFBUTTON1 = 0x00000000
23
+ MB_DEFBUTTON2 = 0x00000100
24
+ MB_DEFBUTTON3 = 0x00000200
25
+ MB_DEFBUTTON4 = 0x00000300
26
+ MB_APPLMODAL = 0x00000000
27
+ MB_SYSTEMMODAL = 0x00001000
28
+ MB_TASKMODAL = 0x00002000
29
+ MB_HELP = 0x00004000
30
+ MB_NOFOCUS = 0x00008000
31
+ MB_SETFOREGROUND = 0x00010000
32
+ MB_DEFAULT_DESKTOP_ONLY = 0x00020000
33
+ MB_TOPMOST = 0x00040000
34
+ MB_RIGHT = 0x00080000
35
+ MB_RTLREADING = 0x00100000
36
+ MB_SERVICE_NOTIFICATION = 0x00200000
37
+ MB_SERVICE_NOTIFICATION_NT3X = 0x00040000
38
+ MB_TYPEMASK = 0x0000000F
39
+ MB_ICONMASK = 0x000000F0
40
+ MB_DEFMASK = 0x00000F00
41
+ MB_MODEMASK = 0x00003000
42
+ MB_MISCMASK = 0x0000C000
43
+ #}
44
+
45
+ #{ IDxxx
46
+ IDOK = 1
47
+ IDCANCEL = 2
48
+ IDABORT = 3
49
+ IDRETRY = 4
50
+ IDIGNORE = 5
51
+ IDYES = 6
52
+ IDNO = 7
53
+ IDCLOSE = 8
54
+ IDHELP = 9
55
+ IDTRYAGAIN = 10
56
+ IDCONTINUE = 11
57
+ IDTIMEOUT = 32000
58
+ #}
59
+
60
+ attach_function :MessageBox, :MessageBoxA, [:pointer, :string, :string, :uint], :int
61
+ end
62
+ end