Jump to content
Sign in to follow this  
alexpere

How to set a window (not dialog) always on top?

Recommended Posts

alexpere

I'm currently using the command:

GUICreate($progName, 350, 400, -1, -1, BitOr($WS_CAPTION, $WS_POPUP))

to create a very simple GUI window with no close buttons, etc. I want this window to always stay on top. I've tried the switches $DS_MODALFRAME (which I guess won't work because it's not a dialog) and $WS_EX_TOPMOST to no avail.

Has anyone else done this with success that can help me out?

Share this post


Link to post
Share on other sites
CyberSlug

This should stay on top (unless other windows also have the "topmost" property):

#include <GuiConstants.au3>

GUICreate("Example", 350, 400, -1, -1, BitOr($WS_CAPTION, $WS_POPUP), $WS_EX_TOPMOST)
GuiSetState()

While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd
You could also AutoIt's WinSetOnTop function :lmao:

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites
alexpere

Thanks CyberSlug, there's so many options these days and I was choosing the complicated one!

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.