Jump to content
Sign in to follow this  
crz

Simple question, difficult answer?

Recommended Posts

crz

Hello autoitscripters!

I've searched and searched, without finding what I'm looking for.

I want my GUI to display a simple MsgBox - Just like notepad does it, when you wanna close it, without saving your changes.

I don't want my MsgBox to be displayed in the taskbar along with my GUI. - Like it does by diffault.

Is there a solution?

Thanks in advance.

- crz


Steffen "crz" Jorgensenwww.crz.dkcrz@crz.dk

Share this post


Link to post
Share on other sites
faire

I did a quick search for you. You could try using this code:

$window = WinGetHandle("MsgBox title")
$newParent = WinGetHandle("Program Manager")

DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $window, "hwnd", $newParent)

Substitute "MsgBox title" for the title of your message box.

Though I'm sure there's an easier way.

Edit: doesn't seem to work on MsgBox...

Edited by faire

Share this post


Link to post
Share on other sites
crz

@faire

Can't quite get it to work with the MsgBox either. Works on the GUI though, lol.

Thanks anyways, m8!


Steffen "crz" Jorgensenwww.crz.dkcrz@crz.dk

Share this post


Link to post
Share on other sites
PsaltyDS

I did a quick search for you. You could try using this code:

$window = WinGetHandle("MsgBox title")
$newParent = WinGetHandle("Program Manager")

DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $window, "hwnd", $newParent)

Substitute "MsgBox title" for the title of your message box.

Though I'm sure there's an easier way.

Edit: doesn't seem to work on MsgBox...

While the MsgBox() is up, your script is blocked, so the script can't modify it's own MsgBox(). There are ways around this, where you launch a separate process for the MsgBox(), but they are kind of ugly. Better to just create a custom MsgBox GUI of your own.

:)

P.S. As Siao pointed out, you can make the MsgBox() a child of your main GUI by providing the $hWND option, and it doesn't show on the taskbar. It still blocks the script while it's up, though.

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
rudi

Hi.

Use a GUI instead. To see how to hide away from taskbar see this posting.

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites
Siao

Damn, how I hate topics like these.

In latest version of AutoIt, parent window parameter was added to MsgBox(), FileSelectFolder(), FileOpenDialog(), FileSaveDialog(). It's documented both in changelog and corresponding helpfile articles. Case closed.

Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites
crz

@Siao

Wauw, I didn't actually miss that. I saw it many trys, searches, topics and replys ago. But it didn't change a thing adding the GUI handle to the MsgBox's parent parameter.

Now I get it.

I didn't add the "timeout" parameter, that lies just before it. So it probably ignored me adding the GUIs handle.

Sick!!

Thanks.


Steffen "crz" Jorgensenwww.crz.dkcrz@crz.dk

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.