Method: AutoItX3::Window#class_list

Defined in:
lib/AutoItX3/window.rb

#class_listObject

Returns an array of all used window classes of self.

Return value

An array containg all the window classes as strings.

Raises

Au3Error

Window not found.

Example

p win.class_list 
#=> ["SciTEWindowContent", "Scintilla", "Scintilla", "ToolbarWindow32", "SciTeTabCtrl", "msctls_statusbar32"]


239
240
241
242
243
244
245
246
# File 'lib/AutoItX3/window.rb', line 239

def class_list
  Window.functions[__method__] ||= AU3_Function.new("WinGetClassList", '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.split("\n").map{|str| str.strip.empty? ? nil : str.strip}.compact
end