J0ker Posted April 23, 2007 Share Posted April 23, 2007 (edited) Hi, How can I detect when mouse(cursor) is over a control? I know that GuiGetCursorInfo can achieve this but how can I use it with cases? #include <GuiConstants.au3> GuiCreate("Touch me!", 392, 316,-1, -1) $Button_0 = GuiCtrlCreateButton("", 125, 100, 100, 100, $BS_BITMAP) Guisetstate() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Exit Edited April 23, 2007 by J0ker Link to comment Share on other sites More sharing options...
smashly Posted April 23, 2007 Share Posted April 23, 2007 I'm not sure exactly you meant by "use with cases", but this is one way I'd trip off a mouse over a button event using a While 1/WEnd loop #include <GuiConstants.au3> $gui = GuiCreate("Touch me!", 392, 316,-1, -1) $Button_0 = GuiCtrlCreateButton("", 125, 100, 100, 100, $BS_BITMAP) Guisetstate() While 1 If WinActive($gui) Then $ggci = GUIGetCursorInfo($gui) If $ggci[4] = $Button_0 Then ;; Mouse is over button_0, do stuff ToolTip("mouse over button") Else ;; Mouse has left button_0 ToolTip("") EndIf EndIf $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Exit Cheers Link to comment Share on other sites More sharing options...
J0ker Posted April 23, 2007 Author Share Posted April 23, 2007 (edited) Thanks alot ! Edited April 23, 2007 by J0ker Link to comment Share on other sites More sharing options...
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