SlowCoder74 Posted January 16, 2014 Share Posted January 16, 2014 I am writing another utility for my job that pulls data from a server and displays it on agent desktops. It is critical that the information window remain on top of all other windows, including other windows that want to fight for "top position". I placed my WinSetOnTop within my main loop. It works nicely for me, 0 issues. However, some of the agents have mentioned that since I deployed in beta, focus from their other application windows seems to get stolen. Strange thing is it only seems to happen every once in a while. Anyone have any ideas about this? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 16, 2014 Moderators Share Posted January 16, 2014 SlowCoder74,Try using:GUISetState(@SW_SHOWNOACTIVATE, $hWnd)when you display your GUI - that way the focus is never taken. M23 SlowCoder74 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...
SlowCoder74 Posted January 16, 2014 Author Share Posted January 16, 2014 (edited) Let me just punch that into my test app and see what happens ... ... tickety clickety click ... Ok, that doesn't make the window topmost. I can drag the window underneath other topmost windows. Edited January 16, 2014 by SlowCoder74 Link to comment Share on other sites More sharing options...
l3ill Posted January 16, 2014 Share Posted January 16, 2014 (edited) If its your own GUI you can set it as an attribute. $WS_EX_TOPMOST tippfehler Edited January 16, 2014 by l3ill SlowCoder74 1 My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted January 17, 2014 Moderators Solution Share Posted January 17, 2014 SlowCoder74,That GUISetState parameter just prevents the focus from bring stolen by the GUI when it appears - which should solve your problem. Of course you still need to use the TOPMOST style or WinSetOnTop to get your GUI to the top of the z-order - sorry for any confusion. 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...
SlowCoder74 Posted January 22, 2014 Author Share Posted January 22, 2014 Well, I never actually had to change anything. The issue (if it existed in the first place) seems to have disappeared. Thank you! Link to comment Share on other sites More sharing options...
qwert Posted February 8, 2015 Share Posted February 8, 2015 I've experienced a situation with one of my scripts that seems very in line with the recommendations in this thread ... except that the pieces don't quite add up. My script's GUI is created with $WS_POPUP and $WS_EX_TOPMOST ... which works in every instance when it runs amongst other programs. It stays solidly on top ... EXCEPT when some embedded video is maximized from the browser. The video takes over the screen and my GUI disappears behind it. Even worse, the video overlays the taskbar, so I can't summon my GUI back. What I've found, however, is that if I have another script running in background, that script can perform a WinSetOnTop($hMyGUI) and restore MyGUI to the top ... where is stays solidly, regardless of any click actions on the video ... even if the video is minimized and remaximized. This leads me to believe that TopMost at creation is separate from the SetOnTop at runtime. Is that the case? And what is the prescribed GUISetState command for giving a GUI the best chance of staying on top following its initial display? Should a script perform a SetOnTop() of itself? Thanks in advance for clarifications. 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