Sign in to follow this  
Followers 0
SweatyOgre

$WS_EX_TOPMOST

2 posts in this topic

I'm trying to make a GUI with a label that displays a counter of how many times an event occurs. Everything displays fine, but I want the GUI window to stay on top of all other windows, as is my understanding of what $WS_EX_TOPMOST does. The window appears, and shows the counter, but goes under other windows. Is there a problem with my code that is preventing this from happening?

$style1 = BitOR($WS_POPUP, $WS_EX_TOPMOST)
GuiCreate("Counter", 115, 67,(@DesktopWidth-115)/2, (@DesktopHeight-67)/2 , $style1)

Share this post


Link to post
Share on other sites



I'm trying to make a GUI with a label that displays a counter of how many times an event occurs. Everything displays fine, but I want the GUI window to stay on top of all other windows, as is my understanding of what $WS_EX_TOPMOST does. The window appears, and shows the counter, but goes under other windows. Is there a problem with my code that is preventing this from happening?

$style1 = BitOR($WS_POPUP, $WS_EX_TOPMOST)
GuiCreate("Counter", 115, 67,(@DesktopWidth-115)/2, (@DesktopHeight-67)/2 , $style1)

<{POST_SNAPBACK}>

$WS_EX_TOPMOST is an extended style NOT a style so you need

GuiCreate("Counter", 115, 67-1, -1 , $WS_POPUP,$WS_EX_TOPMOST) :)

You don't even need to compute the position of the window -1,-1 will center the window

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0