Jump to content
Sign in to follow this  
Sokko

"Child"-like message box

Recommended Posts

Sokko

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.

Share this post


Link to post
Share on other sites
AutoChris

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.

Share this post


Link to post
Share on other sites
LxP

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

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.