Jump to content


Recommended Posts

Posted (edited)

Hi all,
When creating a GUI, we often want it to stay on top, no matter any other window we clic on.
To achieve this, I found 2 different ways. When you run the following script, just clic on any other window and see how the GUI will stay on top :

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

For $i = 1 to 2
   If $i = 1 Then
      $hGui = GUICreate("1 - @SW_SHOWDEFAULT", 300, 300, -1, -1, _
      $hGui = GUICreate("2 - $WS_EX_TOPMOST", 300, 300, -1, -1, _
   While GUIGetMsg() <> $GUI_EVENT_CLOSE

It appears that @SW_SHOWDEFAULT or $WS_EX_TOPMOST do the same job, both keeping the window on top.

The question is : anyone knows if one of them should always be used instead of the other, for a particular reason ?


Edited by pixelsearch

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