Sign in to follow this  
Followers 0
sigil

WinSetOnTop() doesn't keep window on top?

4 posts in this topic

As far as I understand, this code:

msgbox(0,"test","stay on top")
winsetontop("test","",1)

should make a MsgBox() window that is always on top, even if it isn't active. But when I run the script, I just get a MsgBox() that goes behind any other window when I click on that window, the same as it would if I didn't have the WinSetOnTop() line. It seems like WinSetOnTop() isn't doing anything. Am I using it correctly?

I'm running AutoIt v3.2.10.0 on Windows 2000.

Share this post


Link to post
Share on other sites



As far as I understand, this code:

msgbox(0,"test","stay on top")
 winsetontop("test","",1)

should make a MsgBox() window that is always on top, even if it isn't active. But when I run the script, I just get a MsgBox() that goes behind any other window when I click on that window, the same as it would if I didn't have the WinSetOnTop() line. It seems like WinSetOnTop() isn't doing anything. Am I using it correctly?

I'm running AutoIt v3.2.10.0 on Windows 2000.

The problem is that MsgBox() is a blocking function, it pauses your script until you close it. therefore the WinSetOnTop() executes after the MsgBox is closed, to fix this try making your own msgbox :D

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

You can set a TOPMOST style, too : MsgBox(262144,"top",":D")


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Thanks. I made a GUI and used winsetontop(). It completely meets my needs now.

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