How can i tell the parent to do so?
Because its not like i told the parent to stop handling the timer event...
Should i set something to tell the parent to process the events even though it doesn't have focus?
Main Topics
Browse All TopicsHello
I have a class that inherit from CScrollView which creates a modeless dialog box when the user clicks on a button:
m_dlg = new CActorPropertiesDlg;
m_dlg->Create(IDD_PROPERTI
m_dlg->ShowWindow(SW_SHOWN
What i want to achieve is the parent must still be refreshed when the focus is on the modeless dialog... right now, its only redrawn when the focus is on the parent.
My parent CScrollView object is refreshed using SetTimer(1, 100, NULL)... and in OnTimer( ), i use Invalidate.
How could i tell the modeless dialog to continue to update its parent each 100 ms?
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I'm going to make a wild guess that your modeless dialog is performing a lengthy operation. This will 'stop' the normal message handling in the thread (because it is very busy). A patch is as follows.
In the processing in the modeless dialog
while(...) <<--------------- or for loop or whatever
{
//work work work
DoEvents(); <<------------------------
}
void DoEvents()
{
MSG msg;
while ( ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE ) )
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
}
This forces the message queue to be processed - gives timer and paint messages a chance to work.
If I have guessed correctly then you ought to consider using threads to perform the operation.
Hi,
Create a user defined message like
#define WM_UD_PARENTUPDATE WM_USER+10
In the modeless dialog class has you are doing some operation so whenver you want to update parent
send the message to the parent as :
::SendMessage ( h_wndParent, WM_UD_PARENTUPDATE , NULL, NULL );
Handle the message handler in the parent window class as :
BEGIN_MESSAGE_MAP ....
ON_MESSAGE(WM_UD_PARENTUPD
END_MESSAGE_MAP..
LRESULT OnUpdateParent (WPARAM wParam,LPARAM lParam)
{
// write code here what ever you want to do in the parent.
return 0;
}
Thanks,
Ramesh.
Business Accounts
Answer for Membership
by: AlexFMPosted on 2006-06-19 at 11:50:43ID: 16936632
When modeless dialog is active, parent window must continue to handle WM_TIMER messages. You don't need to do anything special for this.