Method: AutoItX3::Window#handle
- Defined in:
- lib/AutoItX3/window.rb
#handle ⇒ Object
Returns the numeric handle of a window as a string. It can be used with the WinTitleMatchMode option set to advanced or for direct calls to the windows API (but you have to call .to_i(16) on the string then).
183 184 185 186 187 188 189 190 |
# File 'lib/AutoItX3/window.rb', line 183 def handle Window.functions[__method__] ||= AU3_Function.new("WinGetHandle", 'SSPI') buffer = " " * AutoItX3::BUFFER_SIZE buffer.wide! Window.functions[__method__].call(@title.wide, @text.wide, buffer, AutoItX3::BUFFER_SIZE - 1) raise_unfound if AutoItX3.last_error == 1 buffer.normal.strip end |