What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [questions] CreateChildWnd

[questions] CreateChildWnd
Author: Message:
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
O.P. [questions] CreateChildWnd
I want to create a child window that locks the parent window and prevents the parent window from getting focus until the child window is closed. Is that what the CreateChildWnd function is for? If not can someone please let me know what it does? If so, I can't seem to get it working currently.
[Image: clb2.jpg]
06-25-2006 09:32 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: [questions] CreateChildWnd
quote:
Originally posted by cooldude_i06
I want to create a child window that locks the parent window and prevents the parent window from getting focus until the child window is closed. Is that what the CreateChildWnd function is for? If not can someone please let me know what it does? If so, I can't seem to get it working currently.
Nope, the create child window is used to create a window inside of another window.

The MsgPlus::CreateChildWnd function creates a child window for an existing interface window. It can be used to create wizards or any other kind of more complex windows.

Use the Windows API to disable the first window then when the second is distroyed reenable it.
06-25-2006 09:35 PM
Profile E-Mail PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: [questions] CreateChildWnd
This is what i do and no that function is for creating child windows inside other plus windows

calling the windows api EnableWindow does what you want though

//call this on the plus window to lock
code:
Interop.Call('User32','EnableWindow',wnd.Handle,0);


//call this on the plus window to unlock
code:
Interop.Call('User32','EnableWindow',wnd.Handle,1);

[Image: dt2.0v2.png]      Happy Birthday, WDZ
06-25-2006 09:38 PM
Profile PM Web Find Quote Report
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
O.P. RE: [questions] CreateChildWnd
thanks guys, that made sense, and worked

another question i would like to ask now is that, is there an event (i couldnt find it in the documentation) fired when an interface window receives focus, and a function or property that can put focus on another window?

I can use the visible property for now, but the focus one would be better i guess. thanks

This post was edited on 06-25-2006 at 10:01 PM by cooldude_i06.
[Image: clb2.jpg]
06-25-2006 10:00 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: [questions] CreateChildWnd
quote:
Originally posted by cooldude_i06
thanks guys, that made sense, and worked

another question i would like to ask now is that, is there an event (i couldnt find it in the documentation) fired when an interface window receives focus, and a function or property that can put focus on another window?

I can use the visible property for now, but the focus one would be better i guess. thanks
No there isn't an event for recieving focus. You can however add a timer and monitor the GetForegroundWindow() api for the handle and compare it to the one you want to remove from focus.
06-25-2006 10:04 PM
Profile E-Mail PM Find Quote Report
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
O.P. RE: [questions] CreateChildWnd
I'll just stick with the visible property then. thanks for the reply
[Image: clb2.jpg]
06-25-2006 10:10 PM
Profile E-Mail PM Web Find Quote Report
mathieumg
Full Member
***


Posts: 181
Reputation: 2
34 / Male / Flag
Joined: May 2004
RE: [questions] CreateChildWnd
I read somewhere in the doc that if you recreate the same window (with the same id, etc.) and it is already opened, it will just put the focus on it. I can't find where in the doc I saw that though...

This post was edited on 06-25-2006 at 10:15 PM by mathieumg.
Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
06-25-2006 10:14 PM
Profile E-Mail PM Web Find Quote Report
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
O.P. RE: [questions] CreateChildWnd
I tried it, it just creates two identical windows
[Image: clb2.jpg]
06-25-2006 10:19 PM
Profile E-Mail PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: [questions] CreateChildWnd
quote:
Originally posted by mathieumg
I read somewhere in the doc that if you recreate the same window (with the same id, etc.) and it is already opened, it will just put the focus on it. I can't find where in the doc I saw that though...

to do that you need to do something like


code:
focusWindow(wnd.Handle);

function focusWindow(hwnd){
    Interop.Call('User32','BringWindowToTop',hwnd);
    Interop.Call('User32','ShowWindow',hwnd , 1);
}



[Image: dt2.0v2.png]      Happy Birthday, WDZ
06-26-2006 12:09 AM
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