![]() |
General MFC problem |
Post Reply
|
| Author | |
terrym
Senior Member
Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
Quote Reply
Topic: General MFC problemPosted: 11 September 2007 at 4:19pm |
|
Anybody know what function is called after OnShowWindow() in MFC ???
As I need to make sure a window is shown before showing a dialog, currently have in a timer, but this sometimes fails.
Any help much appreciated
|
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
|
pascal
Groupie
Joined: 07 February 2005 Location: Germany Status: Offline Points: 25 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 September 2007 at 5:37pm |
|
Hi,
I use a workaround for this: - I define a member BOOL m_bFirstActivation, initialized with FALSE - catch the message WM_ACIVATE - ON_WM_ACTIVATE() - toggle m_bFirstActivation in the message method, do the first initialization void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)Hope that it will help you. There is may be a better way ... BR Pascal |
|
|
Pascal Verdier
Software Engineer Manager |
|
![]() |
|
pascal
Groupie
Joined: 07 February 2005 Location: Germany Status: Offline Points: 25 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 September 2007 at 5:40pm |
|
Sorry, i make a mistake:
... |
|
|
Pascal Verdier
Software Engineer Manager |
|
![]() |
|
terrym
Senior Member
Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 September 2007 at 6:13am |
|
Cheers, for that, as much better than timer implementation
|
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
|
terrym
Senior Member
Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 September 2007 at 7:46am |
|
Found a better implementation, is to start a timer, then in the timer function to have
IsWindowVisble()
and if not then exit timers
Also playing with WM_WINDOWPOSCHANGED
Cheers
Terry
|
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
|
terrym
Senior Member
Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 September 2007 at 9:41am |
|
Ok the best method is to handle this in the WM_WINDOWPOSCHANGED message as this happens just after the window has appeared
It works perfect now, cheers
|
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
![]() |
|
kylechen
Groupie
Joined: 29 November 2004 Status: Offline Points: 57 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 September 2007 at 10:58am |
|
Ever got the same problem here, thank you for reply.
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |