[questions] CreateChildWnd |
Author: |
Message: |
cooldude_i06
Full Member
I'm so cool I worry myself.
Posts: 272 Reputation: 9
– / / –
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.
|
|
06-25-2006 09:32 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
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 |
|
|
-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
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);
Happy Birthday, WDZ
|
|
06-25-2006 09:38 PM |
|
|
cooldude_i06
Full Member
I'm so cool I worry myself.
Posts: 272 Reputation: 9
– / / –
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.
|
|
06-25-2006 10:00 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
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 |
|
|
cooldude_i06
Full Member
I'm so cool I worry myself.
Posts: 272 Reputation: 9
– / / –
Joined: Sep 2003
|
O.P. RE: [questions] CreateChildWnd
I'll just stick with the visible property then. thanks for the reply
|
|
06-25-2006 10:10 PM |
|
|
mathieumg
Full Member
Posts: 181 Reputation: 2
35 / /
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 |
|
|
cooldude_i06
Full Member
I'm so cool I worry myself.
Posts: 272 Reputation: 9
– / / –
Joined: Sep 2003
|
O.P. RE: [questions] CreateChildWnd
I tried it, it just creates two identical windows
|
|
06-25-2006 10:19 PM |
|
|
-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
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);
}
Happy Birthday, WDZ
|
|
06-26-2006 12:09 AM |
|
|
|