Cusem Posted June 7, 2007 Posted June 7, 2007 I making a function that will get the coordinates of a rectangle on screen by clicking the left-top corner once, followed by clicking the right-bottom corner. This selecting a rectangle for the PixelChecksum command. While 1 If _Ispressed(01) = 1 Then $pos1 = MouseGetPos() SoundPlay(@WindowsDir&"\Media\Ding.wav") ExitLoop EndIf WEnd Sleep(350) While 1 If _Ispressed(01) = 1 Then $pos2 = MouseGetPos() SoundPlay(@WindowsDir&"\Media\Ding.wav") $left=$pos1[0] $top=$pos1[1] $right=$pos2[0] $bottom=$pos2[1] $width=$pos2[0]-$pos1[0] $height=$pos2[1]-$pos1[1] ExitLoop EndIf WEnd However, I want to display what i've "selected". Everything went fine, except when I changed the PixelCoordMode from 1 to 2. I do this with: Local $cw = WinGetPos($windowname) GUICreate ("",$width, $height, $left + $cw[0], $top + $cw[1], $WS_POPUP,$WS_EX_TOOLWINDOW) GUISetBkColor(0x00FF00) GUISetState() Sleep(1000) GUIDelete() It seems that $cw[0] and $cw[1] is were the "frame" (don't know what it's called. I mean the titlebar etc.) of the target window begins. However, I want the coordinates were the content of the window is positioned, so withouth the titlebar. Anyone knows a way to do this? (I hope you guys get what I mean, since my English isn't marvellous )
Zedna Posted June 7, 2007 Posted June 7, 2007 Look at my Frame project.It draw frame window without title and with hole in it so I think it's exactly what you want Resources UDF ResourcesEx UDF AutoIt Forum Search
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