What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Active Dialog Window?

Active Dialog Window?
Author: Message:
a0369
Junior Member
**

Avatar

Posts: 16
35 / Male / Flag
Joined: Oct 2004
O.P. Active Dialog Window?
Here's what I'm trying to do, but have no clue how to do it. In some windows on Messenger Plus, you can click a button and it will bring up a dialog and while that dialog is on the screen you are not allowed to click the main window until you close the dialog, is there a way to do this same behavior in scripting?
09-22-2008 05:21 PM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Active Dialog Window?
Could you give us an example? Do you mean a modal dialog box, like this:
[Image: ms644996.MessageBox_01(en-us,VS.85).png]
or do you mean that you want a Plus! window created by MsgPlus.CreateWnd to be a modal of another (Plus!) window?

In the first case, you can simply use the MessageBox function. You can easily find an example when searching these forums.

In the second case, you'll have to do it in a dirty way. That is, when you open your "modal" window, you disable your parent window with EnableWindow and re-enable it when you close it (in the OnWindowIdEvent_Destroyed event). I don't know if it's possible to set the focus to your modal window when you try to enable the parent window through a click or something, maybe you should experiment with that? :P
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-22-2008 05:40 PM
Profile E-Mail PM Web Find Quote Report
a0369
Junior Member
**

Avatar

Posts: 16
35 / Male / Flag
Joined: Oct 2004
O.P. RE: RE: Active Dialog Window?
quote:
Originally posted by Mattike

In the second case, you'll have to do it in a dirty way. That is, when you open your "modal" window, you disable your parent window with EnableWindow and re-enable it when you close it (in the OnWindowIdEvent_Destroyed event). I don't know if it's possible to set the focus to your modal window when you try to enable the parent window through a click or something, maybe you should experiment with that? :P

That's what I'm currently doing for right now. It's the only thing I could think of to prevent the user from clicking the main window while a dialog box is open.
09-22-2008 05:44 PM
Profile PM Web Find Quote Report
a0369
Junior Member
**

Avatar

Posts: 16
35 / Male / Flag
Joined: Oct 2004
O.P. RE: Active Dialog Window?
there's only one tiny problem with disabling the main window while a dialog is open though. If that main window somehow goes on top of the dialog, then there is no way to get control back. Since the main window is disabled no messages get sent to it and it can't be closed.
09-22-2008 05:50 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Active Dialog Window?
Why not hide the parent diaglog and show it on destroyed, this way you aren't creating a modal window but you can't do anything until afterwards.

Or make your "modal" window AlwaysOnTop
09-22-2008 06:01 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Active Dialog Window?
quote:
Originally posted by a0369
there's only one tiny problem with disabling the main window while a dialog is open though. If that main window somehow goes on top of the dialog, then there is no way to get control back. Since the main window is disabled no messages get sent to it and it can't be closed.
Well, yeah, that's the only point where it doesn't behave like a real modal window...
Someone with more creativity who might be able to find a workaround (or even better, a native way) to do this?
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-22-2008 06:02 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Active Dialog Window?
Have a read it will explain a bit more why what you want to do doesn't natively exist: http://support.microsoft.com/kb/147817
09-22-2008 06:13 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Active Dialog Window?
quote:
Originally posted by matty
Have a read it will explain a bit more why what you want to do doesn't natively exist: http://support.microsoft.com/kb/147817
That's about a system-modal window. We're talking here about an application-modal window, which means that the user must complete the actions in the "modal" window first to go on in that application but it shouldn't block the user from doing things in other applications.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-22-2008 06:29 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Active Dialog Window?
Yes I am aware but there is no native function.

You can do this successfully with Window hooks and the enable window function and a bit of tweaking. But easiest way is to hide the parent and show it after the other has been destroyed.
09-22-2008 06:42 PM
Profile E-Mail PM Find Quote Report
a0369
Junior Member
**

Avatar

Posts: 16
35 / Male / Flag
Joined: Oct 2004
O.P. RE: Active Dialog Window?
I think i'm going to have the main window be disabled when a dialog box comes up and have the dialog box set to always on top so that the main window will never become on top of it.
09-22-2008 09:32 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On