Discussion:
Getting child MDI window
(too old to reply)
Angus
2010-03-20 16:06:01 UTC
Permalink
Raw Message
Hello

I am automating a MDI application. The application has an API so I can post
data to set fields, but I need to revert back to the original active child
window after posting data to a potentially different child window.

I have the mdi parent window handle and I am thinking I simply need the
child window so I can do this:
SendWindow(mdiparenthandle, WM_MDIACTIVATE, childwindow, 0);

But how do I get the child window handle. I looked at WM_MDIGETACTIVE but I
think it assumes that you are calling from the mdi program??? The first
parameter is destination control? Assume it means a control on the child
mdi form. I just need to get the child window? How do I do that?

Angus
Angus
2010-03-20 20:43:34 UTC
Permalink
Raw Message
Hello
I am automating a MDI application.  The application has an API so I can post
data to set fields, but I need to revert back to the original active child
window after posting data to a potentially different child window.
I have the mdi parent window handle and I am thinking I simply need the
SendWindow(mdiparenthandle, WM_MDIACTIVATE, childwindow, 0);
But how do I get the child window handle.  I looked at WM_MDIGETACTIVE but I
think it assumes that you are calling from the mdi program???  The first
parameter is destination control?  Assume it means a control on the child
mdi form.  I just need to get the child window?  How do I do that?
Angus
I worked it out.

You need to get three windows - the frame window (parent), the client
area window and the specific mdi child window. You SendMessage
WM_MDIGETACTIVE to the client window to get the active child window.

Then you send the WM_MDIACTIVATE message to the child window.

Loading...