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

Modal Windows
Author: Message:
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
O.P. Modal Windows
Is it possible to open a modal window in front of an existing window?

Eg I have my prefs window and the I open a smaller window.

I use EnableWindow to disable the main prefs window, but If I then switch to another program and then select the window in the taskbar, I just see the disabled Prefs window which i can't obviously do anything with, and as the other window is small it's hidden behind it.

How can I do it like for example the plus prefs do it when downloading script documentation etc, which keeps the mini-window on top even when switching to another program and back again.

Thanks for any ideas :)
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
11-17-2007 07:30 PM
Profile E-Mail PM Web Find Quote Report
Deco
Full Member
***


Posts: 188
Reputation: 4
41 / Male / Flag
Joined: Aug 2006
RE: Modal Windows
Catch the API message that brings the main window back to front?

I'm not sure if it's a creatwindow message or bring to front.. but I'm sure you can do this with API calls..

But then again I bet Cookie could give you a certain answer :P
[Image: signature-user=31&back=4&clr=106,141,166&size=100.png]
11-17-2007 09:29 PM
Profile E-Mail PM Web Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: Modal Windows
Try using the SetParent API to set the small window a child of your Preferences-window. The small window will now be inside the small window, so it will only appear when the actual window appears. You might need to set the TOP_MOST attribute on the window, so it doesn't hide behind various controls, use the SetWindowPos API.
I haven't tried this, but it should work, give it a shot!

This isn't the Win32 way to do it, but this is pretty easy, and it's available for scripting.
11-17-2007 09:57 PM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: Modal Windows
It would be nice if we had the opportunity to have pop-up windows as well as the dialog and child types.  I was looking into this a while ago and a childwindow doesnt work exactly how you want.  You can always use a timer to check for the forground window and if it matches the one you wanted then you can just use the user32 function to forground the window you wanted infront.
[Image: markee.png]
11-18-2007 10:04 AM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Modal Windows
what you need to do is modal windows and currently, scripts are only allowed to do modeless. That's a technical limitation designed to prevent stack overflows and other similar problems. Plus! rarely uses modal windows (although, in the case of the "downloading..." window, yes, it is one).

A workaround is to intercept WM_ACTIVATE in the parent and automatically set the child in the foreground when it's displayed.
[Image: signature2.gif]
11-18-2007 11:17 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