Cusem Posted April 12, 2008 Posted April 12, 2008 Hey guys, have been searching the forum for a while now and found some stuff about getting the control under the mousecursor. I just need to get the Windowtitle under the mousecursor when I call a function. I'm writing a betpot script for Ongame (Pokerroom). Right now I click the window where I want to bet the pot and just use WinGetTitle("", ""), but the focus of the window is stolen if another window needs attention and this happens quite often when 12-tabling. So I want to start the BetPot function with some lines of code that get the window under the mousecursor.
rasim Posted April 12, 2008 Posted April 12, 2008 Try this: $aMousePos = MouseGetPos() $aWinList = WinList() For $i = 1 To $aWinList[0][0] $aWinPos = WinGetPos($aWinList[$i][1]) If ($aMousePos[0] >= $aWinPos[0]) And ($aMousePos[0] <= $aWinPos[0] + $aWinPos[2]) _ And ($aMousePos[1] >= $aWinPos[1]) And ($aMousePos[1] <= $aWinPos[1] + $aWinPos[3]) Then MsgBox(0, "", $aWinList[$i][0]) ExitLoop EndIf Next
Cusem Posted April 12, 2008 Author Posted April 12, 2008 Works like a charm after some fiddling (Winlist($tablecommonstring, $tablecommonstring)) around. Thanks a lot!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now