Jump to content

"Child"-like message box


Sokko
 Share

Recommended Posts

When creating GUI windows, you can specify a "parent" window, which makes the window in question a "child". I'm wondering if you can apply the same attributes to a regular MsgBox. Specifically, I'd like a message box that:

--Has no button in the taskbar

--Always remains on top of its parent window

--Is minimized and restored along with its parent window

The reason I want a MsgBox with these attributes is that I don't want to bother creating new GUI windows for every error message and dialog box in my program. I realize I might have to do that anyway, I'm just asking if the above is possible.

Link to comment
Share on other sites

When creating GUI windows, you can specify a "parent" window, which makes the window in question a "child". I'm wondering if you can apply the same attributes to a regular MsgBox. Specifically, I'd like a message box that:

--Has no button in the taskbar

--Always remains on top of its parent window

--Is minimized and restored along with its parent window

The reason I want a MsgBox with these attributes is that I don't want to bother creating new GUI windows for every error message and dialog box in my program. I realize I might have to do that anyway, I'm just asking if the above is possible.

<{POST_SNAPBACK}>

What makes a GUI window a child is specifying the parent window in the GUICreate() function. There is no option like that for MsgBox(). So I am afraid you would have to create your own GUI message boxes if you would like that type of functionality for them.
Link to comment
Share on other sites

This almost gives me the desired result (message box is on top and GUI is disabled until it is dismissed):

#include <GUIConstants.au3>
guiCreate("")
local $btn = GUICtrlCreateButton ("MsgBox",  12, 12, 72)
guiSetState()

while 1
    $msg = GUIGetMsg()
    if $msg = $btn then msgBox(0x42000, "Testing", "Testing")
    if $msg = $GUI_EVENT_CLOSE then exitLoop
wEnd
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...