Shoutbox

[questions] CreateChildWnd - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [questions] CreateChildWnd (/showthread.php?tid=61434)

[questions] CreateChildWnd by cooldude_i06 on 06-25-2006 at 09:32 PM

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.


RE: [questions] CreateChildWnd by matty on 06-25-2006 at 09:35 PM

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.
RE: [questions] CreateChildWnd by -dt- on 06-25-2006 at 09:38 PM

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);


RE: [questions] CreateChildWnd by cooldude_i06 on 06-25-2006 at 10:00 PM

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


RE: [questions] CreateChildWnd by matty on 06-25-2006 at 10:04 PM

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.
RE: [questions] CreateChildWnd by cooldude_i06 on 06-25-2006 at 10:10 PM

I'll just stick with the visible property then. thanks for the reply


RE: [questions] CreateChildWnd by mathieumg on 06-25-2006 at 10:14 PM

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...


RE: [questions] CreateChildWnd by cooldude_i06 on 06-25-2006 at 10:19 PM

I tried it, it just creates two identical windows


RE: [questions] CreateChildWnd by -dt- on 06-26-2006 at 12:09 AM

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);
}