Click here to Skip to main content
13,895,744 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have a dialog which is derived from CDialog (Modal ) .Now when I press window+D to minimize all the windows and again when I restore the dialog then all the control over it get disapper which only reappear when I move the dialog window.
Why it is happening so and how to fix this .

What I have tried:

I believe RedrawWindow window will do the trick but don't know where to implement this. Which event is going to get hit upon restoring the window through window+D click.
Updated 15-Jul-18 21:39pm
Mohibur Rashid 13-Jun-18 10:04am
Does this help?
iampradeepsharma 13-Jun-18 10:07am
no this api is not present in the MFC dialog.
Richard MacCutchan 13-Jun-18 10:29am
The dialog, like any Window, should repaint itself when it gets restored. You need to look into your code to try and see what may be missing.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

On restoring after minimise, OnSize[^] is called with nType set to SIZE_RESTORED.

Normally the window would redraw itself automatically though. If you're already using OnSize, check to make sure you're calling the base class' function.
iampradeepsharma 14-Jun-18 4:15am
OnSize isn't even getting called . I just said it is happening upon pressing window+D as key for minimizing everything and then restoring it using the same key combination.
User 7429338 14-Jun-18 4:18am
Is your application doing processing on the main thread?
iampradeepsharma 25-Jun-18 4:48am
what is the event which is called when you restore your window but not necessarily activating that window ?
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

By intercepting the WM_NCPAINT and calling the RedrawWindow() along with the base class handler I could refresh the dialog .
Thanks all .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190306.1 | Last Updated 16 Jul 2018
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100