Jump to content

Msgbox On Top


ant2ne
 Share

Recommended Posts

I would like a msgbox to pop up that is on top of all other windows. I can find info on ONTOP for other windows, but not for msgbox, or even if it is possible.

$return_Value = MsgBox(4,"Title ON TOP", "This message is on top of all other windows",10)

Thanks,

Link to comment
Share on other sites

Helpfile: MsgBox

decimal flag Miscellaneous-related Result hexadecimal flag

0 (nothing else special) 0x0

262144 MsgBox has top-most attribute set 0x40000

524288 title and text are right-justified 0x80000

Edited by ProgAndy

*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

Link to comment
Share on other sites

So if you wanted an OK and Cancel button (flag of '1') you would add 1 to 262144 to get:

$return_Value = MsgBox(262145, "Title ON TOP", "This message is on top of all other windows", 10)
Select
    Case $return_Value = 1
        ConsoleWrite("You pressed OK" & @CRLF)
    Case $return_Value = 2
        ConsoleWrite("You pressed CANCEL" & @CRLF)
    Case $return_Value = -1
        ConsoleWrite("The msgbox timed out" & @CRLF)
    Case Else
        ConsoleWrite("something else happened" & @CRLF)
EndSelect
Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

So if you wanted an OK and Cancel button (flag of '1') you would add 1 to 262144 to get:

$return_Value = MsgBox(262145, "Title ON TOP", "This message is on top of all other windows", 10)
Select
    Case $return_Value = 1
        ConsoleWrite("You pressed OK" & @CRLF)
    Case $return_Value = 2
        ConsoleWrite("You pressed CANCEL" & @CRLF)
    Case $return_Value = -1
        ConsoleWrite("The msgbox timed out" & @CRLF)
    Case Else
        ConsoleWrite("something else happened" & @CRLF)
EndSelect
GREAT THANKS !!!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...