holomind
19-04-2008, 03:57
Hi,
i need some help with the Win_FindByTitle function. Is there a way to get a list of all current open windows, instead of searching one by class or title.
http://www.thinbasic.com/public/products/thinBasic/help/html/index.html?win_findbytitle.htm
In AHK there is the Function i search, in Example2
http://www.autohotkey.com/docs/commands/WinGet.htm
  WinGet, id, list,,, Program Manager
  Loop, %id%
it would be great if i could simulate this function with thinBasic, even if it is done by DllCall , which can be mapped quite easily in thinBasic.
The Same Function can be done with DllCall + Callback, perhaps somebody can help me to translate this into thinBasic syntax.
--------- start ----------
; Example: The following is a working script that displays a summary of all top-level windows.
; For performance and memory conservation, call RegisterCallback() only once for a given callback:
if not EnumAddress ; Fast-mode is okay because it will be called only from this thread:
EnumAddress := RegisterCallback("EnumWindowsProc", "Fast")
DetectHiddenWindows On ; Due to fast-mode, this setting will go into effect for the callback too.
; Pass control to EnumWindows(), which calls the callback repeatedly:
DllCall("EnumWindows", UInt, EnumAddress, UInt, 0)
MsgBox %Output% ; Display the information accumulated by the callback.
EnumWindowsProc(hwnd, lParam)
{
global Output
WinGetTitle, title, ahk_id %hwnd%
WinGetClass, class, ahk_id %hwnd%
if title
Output .= "HWND: " . hwnd . "`tTitle: " . title . "`tClass: " . class . "`n"
return true ; Tell EnumWindows() to continue until all windows have been enumerated.
}
----------- end -----------
i managed the dllcall-alias syntax already, but the callback looks difficult ...
---------
Declare Function EnumWindows Lib "user32.dll" ALIAS "EnumWindows" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
-----------
its nice as its nearly the visualbasic syntax only enhanced with alias.
i want to port my ahk-script (real expose clone) to thinbasic, because there i can use opengl and other hdc/bitblt functions much easier.
http://www.autohotkey.com/forum/viewtopic.php?t=13001
i am wondering that nobody has used "printWindow" dllcall yet in thinBasic, as this is a very nice function to work with window-contents.
thanks for any links and tipps.
holomind
i need some help with the Win_FindByTitle function. Is there a way to get a list of all current open windows, instead of searching one by class or title.
http://www.thinbasic.com/public/products/thinBasic/help/html/index.html?win_findbytitle.htm
In AHK there is the Function i search, in Example2
http://www.autohotkey.com/docs/commands/WinGet.htm
  WinGet, id, list,,, Program Manager
  Loop, %id%
it would be great if i could simulate this function with thinBasic, even if it is done by DllCall , which can be mapped quite easily in thinBasic.
The Same Function can be done with DllCall + Callback, perhaps somebody can help me to translate this into thinBasic syntax.
--------- start ----------
; Example: The following is a working script that displays a summary of all top-level windows.
; For performance and memory conservation, call RegisterCallback() only once for a given callback:
if not EnumAddress ; Fast-mode is okay because it will be called only from this thread:
EnumAddress := RegisterCallback("EnumWindowsProc", "Fast")
DetectHiddenWindows On ; Due to fast-mode, this setting will go into effect for the callback too.
; Pass control to EnumWindows(), which calls the callback repeatedly:
DllCall("EnumWindows", UInt, EnumAddress, UInt, 0)
MsgBox %Output% ; Display the information accumulated by the callback.
EnumWindowsProc(hwnd, lParam)
{
global Output
WinGetTitle, title, ahk_id %hwnd%
WinGetClass, class, ahk_id %hwnd%
if title
Output .= "HWND: " . hwnd . "`tTitle: " . title . "`tClass: " . class . "`n"
return true ; Tell EnumWindows() to continue until all windows have been enumerated.
}
----------- end -----------
i managed the dllcall-alias syntax already, but the callback looks difficult ...
---------
Declare Function EnumWindows Lib "user32.dll" ALIAS "EnumWindows" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
-----------
its nice as its nearly the visualbasic syntax only enhanced with alias.
i want to port my ahk-script (real expose clone) to thinbasic, because there i can use opengl and other hdc/bitblt functions much easier.
http://www.autohotkey.com/forum/viewtopic.php?t=13001
i am wondering that nobody has used "printWindow" dllcall yet in thinBasic, as this is a very nice function to work with window-contents.
thanks for any links and tipps.
holomind