VixinG Posted May 10, 2012 Share Posted May 10, 2012 (edited) I couldn't find solution anywhere. This looks like a simple problem...I have created a Gui with images and invisible labels over them (this is the entire gui):simplified code:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include "Icons.au3" #include "WinSnap.au3" $GUI = GUICreate("Station Changer",480,25,0,0,$WS_POPUP+$WS_VISIBLE,$WS_EX_TOPMOST) $all = GUICtrlCreatePic('',110,1,0,0) GuiCtrlSetState(-1, $GUI_DISABLE) $all_png = "all.png" $all_png2 = "all2.png" _SetImage($all, $all_png) $all_label = GUICtrlCreateLabel('',110,1,44,23) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $all_UnderCursor = False _WinSnap_Set($GUI) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() $cursor = GUIGetCursorInfo() If Not @error Then Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $cursor[4] = $all_label And $all_UnderCursor = False _SetImage($all,$all_png2) $all_UnderCursor = True Case $cursor[4] = $all_label And $all_UnderCursor _SetImage($all,$all_png) $all_UnderCursor = False EndSelect EndIf WEndIn that case, whenever a mouse cursor is moved over the label "$all_label", the pictures are changing (from dark to highlighted). But still, if the gui is topmost and I have focus on another window, the 'mouseover' functions are no longer working. Why ? Edited May 10, 2012 by VixinG [indent=3][/indent] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 10, 2012 Moderators Share Posted May 10, 2012 VixinG,When your GUI is not active, you get an error return from GUIGetCursorInfo - so your script never looks at the mouseover section of the script. The solution is to use the winhandle parameter with GUIGetCursorInfo - then the array is returned even when your GUI is not active (as the Help file explains). M23 sathish 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
VixinG Posted May 10, 2012 Author Share Posted May 10, 2012 God I'm so dumb I need to read every word in help file of every single function in my script. Thanks again Melba23, you are great. [indent=3][/indent] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 10, 2012 Moderators Share Posted May 10, 2012 VixinG,I need to read every word in help file of every single function in my scriptVery sound advice which I wish more people would take. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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