M
Matt
Hello to all,
I'm having something of a problem with the WinAPI call SetParent.
Here's the scenario.
I am trying to take an existing program, and run it within my own
window. I can make this
happen, the code looks like this:
/ Remove border and whatnot
long style = GetWindowLong(appWin, GWL_STYLE);
long new_style = WS_CHILD | WS_VISIBLE;
SetWindowLong(appWin, GWL_STYLE, new_style);
// Put it into this form
SetParent(appWin, this.panel1.Handle);
// Move the window to overlay it on this window
MoveWindow(appWin, 0, 0, this.Width, this.Height, true);
SendMessage((int)m_appWin, WM_PAINT, 0, "");
Where appWin is the handle to the main window of the program I start
with Process.Start and
Handle is the handle of the control I want to "reparent" the window
within. It works fine, the
application is "relocated" within my window. However...
For Itunes (which is the program I'm trying to reparent), I can launch
it, reparent it, and have
it display itself properly. However, once I do, it no longer receives
any mouse clicks. It doesn't
even act as if the mouse is getting to that window. I've checked to
see if the mouse clicks are
going to MY window handle, but they are not.
Any ideas?
Thanks
Matt
I'm having something of a problem with the WinAPI call SetParent.
Here's the scenario.
I am trying to take an existing program, and run it within my own
window. I can make this
happen, the code looks like this:
/ Remove border and whatnot
long style = GetWindowLong(appWin, GWL_STYLE);
long new_style = WS_CHILD | WS_VISIBLE;
SetWindowLong(appWin, GWL_STYLE, new_style);
// Put it into this form
SetParent(appWin, this.panel1.Handle);
// Move the window to overlay it on this window
MoveWindow(appWin, 0, 0, this.Width, this.Height, true);
SendMessage((int)m_appWin, WM_PAINT, 0, "");
Where appWin is the handle to the main window of the program I start
with Process.Start and
Handle is the handle of the control I want to "reparent" the window
within. It works fine, the
application is "relocated" within my window. However...
For Itunes (which is the program I'm trying to reparent), I can launch
it, reparent it, and have
it display itself properly. However, once I do, it no longer receives
any mouse clicks. It doesn't
even act as if the mouse is getting to that window. I've checked to
see if the mouse clicks are
going to MY window handle, but they are not.
Any ideas?
Thanks
Matt