Click here to Skip to main content
13,624,563 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.
Posted 13-Jun-18 3:50am
Updated 24-Jun-18 22:47pm
Comments
Mohibur Rashid 13-Jun-18 10:04am
   
Does this help?
https://msdn.microsoft.com/en-us/library/ms821579.aspx
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
 
good
Please Sign up or sign in to vote.

Solution 2

By handling the event OnActivateApp and calling RedrawWindow() inside it got fixed.

Thanks everyone for your valuable suggestions.
  Permalink  
Rate this: bad
 
good
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.
  Permalink  
Comments
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.
Thaddeus Jones 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 ?

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
Web02-2016 | 2.8.180712.1 | Last Updated 15 Jun 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

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