help, send msg to child windows 
Author Message
 help, send msg to child windows

HI all;

I have a DOC-VIEW program,  in side the theApp->InitInstance(), I want
to send a message to all its MDI Child windows.
I use m_pMainWnd->SendMessageToDescendants(ID_MSG)
Where ID_MSG is a menu id like ID_EDIT_COPY, it does not work. What I
want to do is try to let the program do something
which used to need the mouse to click the menu item.  By sending message
to child window, I can do something like automation
without fancy code.  Anyone has idea?

Thanks

CS



Tue, 04 Dec 2001 03:00:00 GMT  
 help, send msg to child windows

I take it that you are talking about sending the message to ANY child window
and not a specific one.
You can do it by simply posting a WM_COMMAND to Mainwindow:

m_pMainWnd->PostMessage(WM_COMMAND, ID_MSG, 0L);

This would make the message go to main window and that would take it to
current MDI Frame etc. If you want all MDI frames to get it, you will have
to explicitly send it to all. You can do it by overriding OnCmdMsg() of
MainFrame and route the particular message to all MDI frame windows.

Ajay Kalra

Quote:

>HI all;

>I have a DOC-VIEW program,  in side the theApp->InitInstance(), I want
>to send a message to all its MDI Child windows.
>I use m_pMainWnd->SendMessageToDescendants(ID_MSG)
>Where ID_MSG is a menu id like ID_EDIT_COPY, it does not work. What I
>want to do is try to let the program do something
>which used to need the mouse to click the menu item.  By sending message
>to child window, I can do something like automation
>without fancy code.  Anyone has idea?

>Thanks

>CS



Tue, 04 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. help, send msg to child windows

2. help..send a mouse msg to windows in dll

3. How to pause a msg until all child windows are closed

4. Handling msg in child window

5. Send and read msg like net send

6. Send & read msg like Net send

7. How to send info to a child window ?

8. Sending messages to child windows

9. Sending message to all child MDI windows.

10. Getting a handle to a child window / Resizing a child window

11. Child Window in Child Window

12. Getting a handle to a child window / Resizing a child window

 

 
Powered by phpBB® Forum Software