4Eyes Posted August 23, 2011 Share Posted August 23, 2011 (edited) Folks, I have a bunch of controls (labels actually) that I'd like to get messages from while moving the mouse over them with left button depressed. That is, select one control then get a message from any other as the mouse is moved over it. I was using $GUI_EVENT_MOUSEMOVE and determining the relative position but that is unreliable due to height of menu bar and maybe other differences between XP and Windows 7. I looked at registering a message but I'm a novice with that stuff. Doesn't appear to be a style I can use with GuiCtrlCreate... funcs either. Can somebody please make a suggestion? [Edit] Just found MrCreatoR's GUICtrlSetOnHover UDF which looks like the answer. Edited August 23, 2011 by 4Eyes Link to comment Share on other sites More sharing options...
4Eyes Posted August 25, 2011 Author Share Posted August 25, 2011 Is there no solution to this? As I can't obfuscate the GUICtrlSetOnHover UDF, it has to be at least temporarily shelved. I could change the labels to buttons but that doesn't change the undderlying issue I think. Major sigh... Link to comment Share on other sites More sharing options...
smashly Posted August 26, 2011 Share Posted August 26, 2011 (edited) Hi,Global $hGui, $aGCCI, $iLastID $hGui = GUICreate("") For $i = 0 To 4 GUICtrlCreateLabel("Label " & $i + 1, 5, 5 + ($i * 35), 60, 20) Next GUISetState(@SW_SHOW, $hGui) While 1 Switch GUIGetMsg() Case -3 Exit Case Else $aGCCI = GUIGetCursorInfo($hGui) If $aGCCI[2] And $aGCCI[4] And $iLastID <> $aGCCI[4] Then $iLastID = $aGCCI[4] ConsoleWrite("LMB Down and over Control ID: " & $iLastID & " - Control Text: " & GUICtrlRead($iLastID) & @LF) Else $iLastID = $aGCCI[4] EndIf EndSwitch WEnd Cheers Edited August 26, 2011 by smashly Link to comment Share on other sites More sharing options...
4Eyes Posted August 26, 2011 Author Share Posted August 26, 2011 (edited) smashly, GuiGetCursorInfo? I've never used that before and while I did see it in the help file I glossed over it for this purpose due to the name.... "I don't need cursor info!". That is certainly more elegent (and correct) than the solution I just finished debugging which uses relative positioning based on the position of another control. I had difficulties until I used Opt("MouseCoordMode", 2) which then removes variables like the height of the menu bar, large desktop fonts etc. That's really helpful and I thank you, kind sir. Edited August 26, 2011 by 4Eyes Link to comment Share on other sites More sharing options...
monoscout999 Posted August 30, 2011 Share Posted August 30, 2011 1 - i can ofuscate GuiCtrlSetOnHover but only Striped the functions, you should add manually the function that the ofuscator cant ofuscate 2 - GuiGetCurorInfo is what you need 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