Post by Noesis » 13.05.2013 18:41:22
The original code I found in these forums somewhere (can't find the thread again) was:
Code: Select all
$handle = WinGetHandle("[TITLE:Dexpot - Main Menu; CLASS:ThunderRT6FormDC]")
$ret = DllCall("user32.dll", "int", "SendMessage", "HWND", $handle, "UINT", 2006, "WPARAM", 0, "LPARAM", 0)
MsgBox(0, "Current Desktop", $ret[0])
Which I modified into AHK code to test if it still worked as:
Code: Select all
#z::
DetectHiddenWindows, On
WinGet, handle, ID, Dexpot - Main Menu ahk_class ThunderRT6FormDC
result := DllCall("user32.dll\SendMessage", "int", handle, "Uint", 2006, "Uint", 0, "Uint", 0)
MsgBox %result%
return
And finally same code again but this time in Lua script format:
Code: Select all
function fn_GetDexDesktop()
local Hwnd = acFindWindow("ThunderRT6FormDC","Dexpot - Main Menu")
local Alien_SendMessage = alien.core.load("user32.dll").SendMessageW
Alien_SendMessage:types{ret = 'int', abi = 'stdcall', 'int', 'uint', 'uint', 'uint'}
return Alien_SendMessage(Hwnd, 2006, 0, 0)
end
The original code I found in these forums somewhere (can't find the thread again) was:
[code]$handle = WinGetHandle("[TITLE:Dexpot - Main Menu; CLASS:ThunderRT6FormDC]")
$ret = DllCall("user32.dll", "int", "SendMessage", "HWND", $handle, "UINT", 2006, "WPARAM", 0, "LPARAM", 0)
MsgBox(0, "Current Desktop", $ret[0])[/code]
Which I modified into AHK code to test if it still worked as:
[code]#z::
DetectHiddenWindows, On
WinGet, handle, ID, Dexpot - Main Menu ahk_class ThunderRT6FormDC
result := DllCall("user32.dll\SendMessage", "int", handle, "Uint", 2006, "Uint", 0, "Uint", 0)
MsgBox %result%
return[/code]
And finally same code again but this time in Lua script format:
[code]function fn_GetDexDesktop()
local Hwnd = acFindWindow("ThunderRT6FormDC","Dexpot - Main Menu")
local Alien_SendMessage = alien.core.load("user32.dll").SendMessageW
Alien_SendMessage:types{ret = 'int', abi = 'stdcall', 'int', 'uint', 'uint', 'uint'}
return Alien_SendMessage(Hwnd, 2006, 0, 0)
end[/code]