fzeet 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. data/LICENSE_CEF +29 -0
  2. data/checks/Bstr.rb +14 -0
  3. data/checks/Decimal.rb +27 -0
  4. data/checks/OSVERSIONINFOEX.rb +14 -0
  5. data/checks/Point.rb +65 -0
  6. data/checks/Rect.rb +104 -0
  7. data/checks/RunAll.rb +2 -0
  8. data/checks/SafeArray.rb +27 -0
  9. data/checks/Size.rb +45 -0
  10. data/checks/SystemTime.rb +43 -0
  11. data/checks/Variant.rb +160 -0
  12. data/examples/Control/DateTimePicker.rbw +1 -1
  13. data/examples/Control/MonthCalendar.rbw +1 -1
  14. data/examples/Control/{WebBrowser.rbw → WebBrowser/WebBrowser.rbw} +2 -2
  15. data/examples/Control/{WebBrowser1.rbw → WebBrowser/WebBrowser1.rbw} +0 -0
  16. data/examples/Control/WebBrowser/WebBrowser2.rbw +24 -0
  17. data/examples/Control/{WebBrowser3.rbw → WebBrowser/WebBrowser3.rbw} +0 -0
  18. data/examples/Control/{WebBrowser4.rbw → WebBrowser/WebBrowser4.rbw} +8 -3
  19. data/examples/Control/{WebBrowser4Sinatra.rb → WebBrowser/WebBrowser4Sinatra.rb} +0 -0
  20. data/examples/Control/{WebBrowser5.rbw → WebBrowser/WebBrowser5.rbw} +4 -2
  21. data/examples/Control/WebBrowser/jQueryUI.html +53 -0
  22. data/examples/Control/WebBrowser/jQueryUI.rbw +26 -0
  23. data/examples/MDI.rbw +2 -2
  24. data/examples/Raw/UIRibbon/Command.rbw +3 -3
  25. data/examples/Raw/UIRibbon/Minimal.rbw +3 -3
  26. data/examples/Version.rbw +1 -1
  27. data/lib/fzeet.rb +22 -7
  28. data/lib/fzeet/windows.rb +82 -5
  29. data/lib/fzeet/windows/com.rb +1 -318
  30. data/lib/fzeet/windows/com/Common.rb +318 -0
  31. data/lib/fzeet/windows/comctl.rb +1 -1
  32. data/lib/fzeet/windows/comctl/ComboBoxEx.rb +32 -0
  33. data/lib/fzeet/windows/comctl/DateTimePicker.rb +35 -0
  34. data/lib/fzeet/windows/comctl/Header.rb +61 -1
  35. data/lib/fzeet/windows/comctl/ListView.rb +133 -3
  36. data/lib/fzeet/windows/comctl/MonthCalendar.rb +35 -0
  37. data/lib/fzeet/windows/comctl/ProgressBar.rb +37 -0
  38. data/lib/fzeet/windows/comctl/PropertySheet.rb +50 -2
  39. data/lib/fzeet/windows/comctl/SysLink.rb +37 -0
  40. data/lib/fzeet/windows/comctl/Tab.rb +56 -0
  41. data/lib/fzeet/windows/comctl/TreeView.rb +81 -2
  42. data/lib/fzeet/windows/comctl/UpDown.rb +33 -0
  43. data/lib/fzeet/windows/comdlg.rb +1 -0
  44. data/lib/fzeet/windows/comdlg/ColorDialog.rb +41 -0
  45. data/lib/fzeet/windows/comdlg/Common.rb +87 -0
  46. data/lib/fzeet/windows/comdlg/FileDialog.rb +133 -0
  47. data/lib/fzeet/windows/comdlg/FindReplaceDialog.rb +102 -0
  48. data/lib/fzeet/windows/comdlg/FontDialog.rb +36 -0
  49. data/lib/fzeet/windows/comdlg/PrintDialog.rb +72 -0
  50. data/lib/fzeet/{Dialog → windows/comdlg}/ShellFileDialog.rb +0 -0
  51. data/lib/fzeet/windows/core.rb +5 -0
  52. data/lib/fzeet/windows/core/Common.rb +324 -0
  53. data/lib/fzeet/windows/core/Point.rb +42 -0
  54. data/lib/fzeet/windows/core/Rect.rb +114 -0
  55. data/lib/fzeet/windows/core/Size.rb +34 -0
  56. data/lib/fzeet/windows/core/SystemTime.rb +46 -0
  57. data/lib/fzeet/windows/core/Version.rb +57 -0
  58. data/lib/fzeet/windows/gdi.rb +1 -62
  59. data/lib/fzeet/windows/gdi/Common.rb +40 -0
  60. data/lib/fzeet/windows/gdi/Font.rb +64 -0
  61. data/lib/fzeet/windows/kernel.rb +1 -92
  62. data/lib/fzeet/windows/kernel/Common.rb +92 -0
  63. data/lib/fzeet/windows/libc.rb +1 -1
  64. data/lib/fzeet/windows/libcef.rb +1 -0
  65. data/lib/fzeet/windows/mshtml.rb +1 -1135
  66. data/lib/fzeet/windows/mshtml/Common.rb +1135 -0
  67. data/lib/fzeet/windows/ole.rb +1 -561
  68. data/lib/fzeet/windows/ole/Common.rb +112 -0
  69. data/lib/fzeet/windows/ole/PropVariant.rb +141 -0
  70. data/lib/fzeet/windows/oleaut.rb +3 -0
  71. data/lib/fzeet/windows/oleaut/Bstr.rb +39 -0
  72. data/lib/fzeet/windows/oleaut/Common.rb +187 -0
  73. data/lib/fzeet/windows/oleaut/SafeArray.rb +104 -0
  74. data/lib/fzeet/windows/oleaut/Variant.rb +269 -0
  75. data/lib/fzeet/windows/scintilla.rb +115 -1
  76. data/lib/fzeet/windows/{SciLexer.dll → scintilla/SciLexer.dll} +0 -0
  77. data/lib/fzeet/windows/shdocvw.rb +150 -0
  78. data/lib/fzeet/windows/shell.rb +1 -1
  79. data/lib/fzeet/windows/shell/Common.rb +94 -2
  80. data/lib/fzeet/windows/shlwapi.rb +1 -1
  81. data/lib/fzeet/windows/uiribbon.rb +416 -0
  82. data/lib/fzeet/windows/urlmon.rb +2 -2
  83. data/lib/fzeet/windows/user.rb +20 -0
  84. data/lib/fzeet/windows/user/Accelerator.rb +45 -0
  85. data/lib/fzeet/windows/user/Common.rb +3 -2
  86. data/lib/fzeet/windows/user/Control/Button.rb +54 -0
  87. data/lib/fzeet/windows/user/Control/ComboBox.rb +44 -1
  88. data/lib/fzeet/windows/user/Control/Common.rb +88 -1
  89. data/lib/fzeet/windows/user/Control/Edit.rb +50 -0
  90. data/lib/fzeet/windows/user/Control/ListBox.rb +69 -0
  91. data/lib/fzeet/windows/user/Control/Static.rb +31 -0
  92. data/lib/fzeet/windows/user/Menu.rb +130 -0
  93. data/lib/fzeet/windows/user/Message.rb +9 -0
  94. data/lib/fzeet/windows/user/MessageBox.rb +47 -0
  95. data/lib/fzeet/windows/user/SystemParametersInfo.rb +1 -1
  96. data/lib/fzeet/windows/user/Window.rb +5 -463
  97. data/lib/fzeet/{Window → windows/user/Window}/Common.rb +460 -0
  98. data/lib/fzeet/{Window → windows/user/Window}/Container.rb +0 -0
  99. data/lib/fzeet/{Window → windows/user/Window}/Dialog.rb +0 -0
  100. data/lib/fzeet/{Window → windows/user/Window}/MDI.rb +0 -0
  101. data/lib/fzeet/{Window → windows/user/Window}/View.rb +0 -0
  102. data/lib/fzeet/{Window → windows/user/Window}/Window.rb +0 -0
  103. data/lib/fzeet/{Window → windows/user/Window}/WindowMethods.rb +1 -1
  104. metadata +55 -61
  105. data/examples/Control/WebBrowser2.rbw +0 -39
  106. data/lib/fzeet/Accelerator.rb +0 -48
  107. data/lib/fzeet/Application.rb +0 -71
  108. data/lib/fzeet/Common.rb +0 -350
  109. data/lib/fzeet/Control.rb +0 -19
  110. data/lib/fzeet/Control/Button.rb +0 -57
  111. data/lib/fzeet/Control/ComboBox.rb +0 -46
  112. data/lib/fzeet/Control/ComboBoxEx.rb +0 -35
  113. data/lib/fzeet/Control/Common.rb +0 -89
  114. data/lib/fzeet/Control/DateTimePicker.rb +0 -38
  115. data/lib/fzeet/Control/Edit.rb +0 -53
  116. data/lib/fzeet/Control/ExplorerBrowser.rb +0 -66
  117. data/lib/fzeet/Control/Header.rb +0 -63
  118. data/lib/fzeet/Control/ListBox.rb +0 -72
  119. data/lib/fzeet/Control/ListView.rb +0 -133
  120. data/lib/fzeet/Control/MonthCalendar.rb +0 -38
  121. data/lib/fzeet/Control/ProgressBar.rb +0 -40
  122. data/lib/fzeet/Control/PropertySheet.rb +0 -51
  123. data/lib/fzeet/Control/Scintilla.rb +0 -117
  124. data/lib/fzeet/Control/Static.rb +0 -34
  125. data/lib/fzeet/Control/SysLink.rb +0 -40
  126. data/lib/fzeet/Control/Tab.rb +0 -59
  127. data/lib/fzeet/Control/TreeView.rb +0 -82
  128. data/lib/fzeet/Control/UpDown.rb +0 -36
  129. data/lib/fzeet/Control/WebBrowser.rb +0 -153
  130. data/lib/fzeet/Dialog.rb +0 -6
  131. data/lib/fzeet/Dialog/ColorDialog.rb +0 -44
  132. data/lib/fzeet/Dialog/Common.rb +0 -89
  133. data/lib/fzeet/Dialog/FileDialog.rb +0 -136
  134. data/lib/fzeet/Dialog/FindReplaceDialog.rb +0 -105
  135. data/lib/fzeet/Dialog/FontDialog.rb +0 -39
  136. data/lib/fzeet/Dialog/PrintDialog.rb +0 -75
  137. data/lib/fzeet/Menu.rb +0 -133
  138. data/lib/fzeet/UIRibbon.rb +0 -417
  139. data/lib/fzeet/Window.rb +0 -5
  140. data/lib/fzeet/windows/common.rb +0 -244
@@ -1,34 +0,0 @@
1
- require_relative 'Common'
2
-
3
- module Fzeet
4
- module StaticMethods
5
- def clear; self.text = ''; self end
6
-
7
- def image=(image) sendmsg(:setimage, Windows::IMAGE_BITMAP, image.handle) end
8
- end
9
-
10
- class Static < Control
11
- include StaticMethods
12
-
13
- Prefix = {
14
- xstyle: [:ws_ex_],
15
- style: [:ss_, :ws_],
16
- message: [:stm_, :wm_],
17
- notification: [:stn_]
18
- }
19
-
20
- def initialize(parent, id, opts = {}, &block)
21
- super('Static', parent, id, opts)
22
-
23
- style >> :tabstop
24
-
25
- @parent.on(:command, @id, &block) if block
26
- end
27
-
28
- def on(notification, &block)
29
- @parent.on(:command, @id, Fzeet.constant(notification, *self.class::Prefix[:notification]), &block)
30
-
31
- self
32
- end
33
- end
34
- end
@@ -1,40 +0,0 @@
1
- require_relative 'Common'
2
-
3
- module Fzeet
4
- module SysLinkMethods
5
-
6
- end
7
-
8
- class SysLink < Control
9
- include SysLinkMethods
10
-
11
- Prefix = {
12
- xstyle: [:ws_ex_],
13
- style: [:lws_, :ws_],
14
- message: [:lm_, :ccm_, :wm_],
15
- notification: [:nm_]
16
- }
17
-
18
- def self.crackNotification(args)
19
- case args[:notification]
20
- when Windows::NM_CLICK
21
- args[:link] = Windows::NMLINK.new(FFI::Pointer.new(args[:lParam]))
22
-
23
- args[:id] = Windows.WCSTOMBS(args[:link][:item][:szID])
24
- args[:url] = Windows.WCSTOMBS(args[:link][:item][:szUrl])
25
- end
26
- end
27
-
28
- def initialize(parent, id, opts = {}, &block)
29
- super('SysLink', parent, id, opts)
30
-
31
- @parent.on(:notify, @id, &block) if block
32
- end
33
-
34
- def on(notification, &block)
35
- @parent.on(:notify, @id, Fzeet.constant(notification, *self.class::Prefix[:notification]), &block)
36
-
37
- self
38
- end
39
- end
40
- end
@@ -1,59 +0,0 @@
1
- require_relative 'Common'
2
-
3
- module Fzeet
4
- module TabMethods
5
- class Item
6
- def initialize(tab, i) @tab, @index = tab, i end
7
-
8
- attr_reader :tab, :index
9
- end
10
-
11
- def [](i) Item.new(self, i) end
12
-
13
- def count; sendmsg(:getitemcount) end
14
- alias :size :count
15
- alias :length :count
16
-
17
- def insert(text, i = count)
18
- tci = Windows::TCITEM.new
19
-
20
- tci[:mask] = Fzeet.flags(:text, :tcif_)
21
- tci[:pszText] = ptext = FFI::MemoryPointer.from_string(text)
22
-
23
- sendmsg(:insertitem, i, tci.pointer)
24
-
25
- self
26
- ensure
27
- ptext.free
28
- end
29
-
30
- def current; self[sendmsg(:getcursel)] end
31
- end
32
-
33
- class Tab < Control
34
- include TabMethods
35
-
36
- Prefix = {
37
- xstyle: [:tcs_ex_, :ws_ex_],
38
- style: [:tcs_, :ws_],
39
- message: [:tcm_, :ccm_, :wm_],
40
- notification: [:tcn_, :nm_]
41
- }
42
-
43
- def self.crackNotification(args) end
44
-
45
- def initialize(parent, id, opts = {}, &block)
46
- super('SysTabControl32', parent, id, opts)
47
-
48
- style << :clipsiblings
49
-
50
- @parent.on(:notify, @id, &block) if block
51
- end
52
-
53
- def on(notification, &block)
54
- @parent.on(:notify, @id, Fzeet.constant(notification, *self.class::Prefix[:notification]), &block)
55
-
56
- self
57
- end
58
- end
59
- end
@@ -1,82 +0,0 @@
1
- require_relative 'Common'
2
-
3
- module Fzeet
4
- module TreeViewMethods
5
- class Item
6
- def initialize(text) @text = text end
7
-
8
- attr_reader :text, :root, :parent, :handle
9
-
10
- def root=(root) raise 'Can\'t change established @root.' if @root; @root = root end
11
- def parent=(parent) raise 'Can\'t change established @parent.' if @parent; @parent = parent end
12
- def handle=(handle) raise 'Can\'t change established @handle.' if @handle; @handle = handle end
13
-
14
- def append(text)
15
- item = Item.new(text)
16
-
17
- tvis = Windows::TVINSERTSTRUCT.new
18
-
19
- tvis[:hInsertAfter] = Windows::TVI_LAST
20
- tvis[:hParent] = @handle
21
-
22
- tvi = tvis[:item]
23
-
24
- tvi[:mask] = Windows::TVIF_TEXT
25
- tvi[:pszText] = ptext = FFI::MemoryPointer.from_string(item.text)
26
-
27
- item.root, item.parent = @root, self
28
- item.handle = @root.sendmsg(:insertitem, 0, tvis.pointer)
29
-
30
- item
31
- ensure
32
- ptext.free
33
- end
34
- end
35
-
36
- def append(text)
37
- item = Item.new(text)
38
-
39
- tvis = Windows::TVINSERTSTRUCT.new
40
-
41
- tvis[:hInsertAfter] = Windows::TVI_LAST
42
- tvis[:hParent] = Windows::TVI_ROOT
43
-
44
- tvi = tvis[:item]
45
-
46
- tvi[:mask] = Windows::TVIF_TEXT
47
- tvi[:pszText] = ptext = FFI::MemoryPointer.from_string(item.text)
48
-
49
- item.root, item.parent = self, self
50
- item.handle = sendmsg(:insertitem, 0, tvis.pointer)
51
-
52
- item
53
- ensure
54
- ptext.free
55
- end
56
- end
57
-
58
- class TreeView < Control
59
- include TreeViewMethods
60
-
61
- Prefix = {
62
- xstyle: [:tvs_ex, :ws_ex_],
63
- style: [:tvs_, :ws_],
64
- message: [:tvm_, :ccm_, :wm_],
65
- notification: [:tvn_, :nm_]
66
- }
67
-
68
- def self.crackNotification(args) end
69
-
70
- def initialize(parent, id, opts = {}, &block)
71
- super('SysTreeView32', parent, id, opts)
72
-
73
- @parent.on(:notify, @id, &block) if block
74
- end
75
-
76
- def on(notification, &block)
77
- @parent.on(:notify, @id, Fzeet.constant(notification, *self.class::Prefix[:notification]), &block)
78
-
79
- self
80
- end
81
- end
82
- end
@@ -1,36 +0,0 @@
1
- require_relative 'Common'
2
-
3
- module Fzeet
4
- module UpDownMethods
5
- def buddy=(buddy) sendmsg(:setbuddy, buddy.handle) end
6
-
7
- def range=(range) sendmsg(:setrange, 0, Windows.MAKELONG(*range.reverse)) end
8
-
9
- def position=(position) sendmsg(:setpos32, 0, position) end
10
- end
11
-
12
- class UpDown < Control
13
- include UpDownMethods
14
-
15
- Prefix = {
16
- xstyle: [:ws_ex_],
17
- style: [:uds_, :ws_],
18
- message: [:udm_, :ccm_, :wm_],
19
- notification: [:udn_, :nm_]
20
- }
21
-
22
- def self.crackNotification(args) end
23
-
24
- def initialize(parent, id, opts = {}, &block)
25
- super('msctls_updown32', parent, id, opts)
26
-
27
- @parent.on(:notify, @id, &block) if block
28
- end
29
-
30
- def on(notification, &block)
31
- @parent.on(:notify, @id, Fzeet.constant(notification, *self.class::Prefix[:notification]), &block)
32
-
33
- self
34
- end
35
- end
36
- end
@@ -1,153 +0,0 @@
1
- require_relative 'Common'
2
-
3
- module Fzeet
4
- class WebBrowser < Windows::WebBrowser
5
- def initialize(parent)
6
- @parent = parent
7
-
8
- @oips = Windows::OleInPlaceSite.new
9
-
10
- @oips.instance_variable_set(:@browser, self)
11
-
12
- class << @oips
13
- attr_reader :browser
14
-
15
- def CanInPlaceActivate
16
- Windows::S_OK
17
- end
18
-
19
- def GetWindow(phwnd)
20
- phwnd.write_pointer(browser.parent.handle)
21
-
22
- Windows::S_OK
23
- end
24
-
25
- def GetWindowContext(pframe, pdoc, prPos, prClip, pinfo)
26
- pframe.write_pointer(0)
27
- pdoc.write_pointer(0)
28
- Windows.GetClientRect(browser.parent.handle, prPos)
29
- Windows.GetClientRect(browser.parent.handle, prClip)
30
-
31
- Windows::S_OK
32
- end
33
-
34
- def OnPosRectChange(prPos)
35
- browser.QueryInstance(Windows::OleInPlaceObject) { |oipo|
36
- oipo.SetObjectRects(prPos, prPos)
37
- }
38
-
39
- Windows::S_OK
40
- end
41
- end
42
-
43
- @ocs = Windows::OleClientSite.new
44
-
45
- @ocs.instance_variable_set(:@browser, self)
46
-
47
- class << @ocs
48
- attr_reader :browser
49
-
50
- def QueryInterface(piid, ppv)
51
- if Windows::GUID.new(piid) == Windows::IOleInPlaceSite::IID
52
- ppv.write_pointer(browser.oips); browser.oips.AddRef
53
-
54
- return Windows::S_OK
55
- end
56
-
57
- super
58
- end
59
- end
60
-
61
- super()
62
-
63
- @events = Windows::WebBrowserEvents.new
64
-
65
- @events.instance_variable_set(:@browser, self)
66
-
67
- class << @events
68
- attr_reader :browser
69
-
70
- (self::VTBL.members - Windows::IDispatch::VTBL.members).each { |name|
71
- define_method(name) { |dispParams|
72
- (handlers = browser.handlers && browser.handlers[name]) && handlers.each { |handler|
73
- (handler.arity == 0) ? handler.call : handler.call(dispParams)
74
- }
75
- }
76
- }
77
- end
78
-
79
- QueryInstance(Windows::ConnectionPointContainer) { |cpc|
80
- FFI::MemoryPointer.new(:pointer) { |pcp|
81
- cpc.FindConnectionPoint(Windows::WebBrowserEvents::IID, pcp)
82
-
83
- @cp = Windows::ConnectionPoint.new(pcp.read_pointer)
84
- }
85
- }
86
-
87
- @cookie = nil
88
- FFI::MemoryPointer.new(:ulong) { |p| @cp.Advise(@events, p); @cookie = p.get_ulong(0) }
89
-
90
- QueryInstance(Windows::OleObject) { |oo|
91
- oo.SetClientSite(@ocs)
92
- oo.DoVerb(Windows::OLEIVERB_INPLACEACTIVATE, nil, @ocs, 0, @parent.handle, @parent.rect)
93
- }
94
-
95
- @parent.
96
- on(:size) {
97
- r = @parent.rect
98
-
99
- put_Top(r[:top]); put_Left(r[:left]); put_Width(r[:right]); put_Height(r[:bottom])
100
- }.
101
-
102
- on(:destroy) {
103
- @oips.Release
104
- @ocs.Release
105
- @cp.Unadvise(@cookie)
106
- @events.Release
107
- @cp.Release
108
- Release()
109
- }.
110
-
111
- instance_variable_set(:@__WebBrowser__, self)
112
- end
113
-
114
- attr_reader :parent, :oips, :ocs, :events, :cp, :handlers
115
-
116
- def on(event, &block)
117
- ((@handlers ||= {})[event] ||= []) << block
118
-
119
- self
120
- end
121
-
122
- def goto(where)
123
- where = Windows.SysAllocString("#{where}\0".encode('utf-16le'))
124
-
125
- Navigate(where, nil, nil, nil, nil)
126
-
127
- self
128
- ensure
129
- Windows.SysFreeString(where)
130
- end
131
-
132
- def back; GoBack(); self; rescue; self end
133
- def forward; GoForward(); self; rescue; self end
134
- def home; GoHome(); self end
135
- def search; GoSearch(); self end
136
-
137
- def refresh; Refresh(); self end
138
-
139
- def document
140
- disp = nil
141
-
142
- FFI::MemoryPointer.new(:pointer) { |pdisp|
143
- get_Document(pdisp)
144
-
145
- disp = Windows::Dispatch.new(pdisp.read_pointer)
146
-
147
- return disp.QueryInstance(Windows::HTMLDocument2)
148
- }
149
- ensure
150
- disp.Release if disp
151
- end
152
- end
153
- end
data/lib/fzeet/Dialog.rb DELETED
@@ -1,6 +0,0 @@
1
- require_relative 'Dialog/FileDialog'
2
- require_relative 'Dialog/ShellFileDialog' if Fzeet::Windows::WINVER.AtLeastWindowsVista?
3
- require_relative 'Dialog/FontDialog'
4
- require_relative 'Dialog/ColorDialog'
5
- require_relative 'Dialog/FindReplaceDialog'
6
- require_relative 'Dialog/PrintDialog'
@@ -1,44 +0,0 @@
1
- require_relative 'Common'
2
-
3
- module Fzeet
4
- class ColorDialog < CommonDialog
5
- DialogStruct = Windows::CHOOSECOLOR
6
-
7
- HookProc = -> *args { CommonDialog::HookProc.(*args.unshift(DialogStruct)) }
8
-
9
- def initialize(opts = {})
10
- _opts = {
11
-
12
- }
13
- badopts = opts.keys - _opts.keys; raise "Bad option(s): #{badopts.join(', ')}." unless badopts.empty?
14
- _opts.merge!(opts)
15
-
16
- @struct = DialogStruct.new
17
-
18
- @struct[:lStructSize] = @struct.size
19
- @struct[:hInstance] = Windows.GetModuleHandle(nil)
20
- @struct[:lpCustColors] = @buf = FFI::MemoryPointer.new(:ulong, 16)
21
- @struct[:Flags] = Fzeet.flags(:enablehook, :cc_)
22
- @struct[:lCustData] = object_id
23
- @struct[:lpfnHook] = HookProc
24
-
25
- super()
26
-
27
- begin
28
- yield self
29
- ensure
30
- dispose
31
- end if block_given?
32
- end
33
-
34
- def dispose; @buf.free end
35
-
36
- def show(window = Application.window)
37
- @struct[:hwndOwner] = window.handle
38
-
39
- DialogResult.new((Windows.ChooseColor(@struct) == 0) ? Windows::IDCANCEL : Windows::IDOK)
40
- end
41
-
42
- def color; result = @struct[:rgbResult]; [Windows.GetRValue(result), Windows.GetBValue(result), Windows.GetBValue(result)] end
43
- end
44
- end