Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ MFC dialog
I have a dialog that updates a static control with a drawing thumbnail in OnInitDialog. This works fine on Windows XP but the initial update fails on Windows 7. Has something changed here? Once the dialog is displayed on Windows 7, any updates cause the thumbnail to redraw properly, but the first one fails...
 

Edit:
 
Further investigation reveals that it is 'Aero' theme on Windows 7 causing the problem, if I switch to the 'Classic' theme, the problem goes away.
 
Any idea how to handle that?
 

Edit 2:
 
I think the DWM is getting out of synce with the screen in some fashion, but
I can't find any way to kick the DWM into action on opening the dialog, perhaps I need to look through the DWM api...
 
Cheers
Posted 10-Dec-12 13:31pm
Kyudos6.5K
Edited 10-Dec-12 18:27pm
v4
Comments
Eugen Podsypalnikov at 11-Dec-12 2:09am
   
// but the first one fails...
What code is it ? :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I had a similar problem that was somehow related to the Windows Colour Management. Please check this discussion[^] on how to set the correct Colour Profile (applies to Windows Photo Viewer, but will affect other programs as well)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

does the static control is created ????
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hack fix: I used a timer to run my refresh code fractionally after the dialog opens. It's ugly as sin but it works. I don't have time to figure out Windows behaviour!
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 370
1 Sergey Alexandrovich Kryukov 205
2 Prakriti Goyal 177
3 jlopez788 134
4 _Amy 110
0 OriginalGriff 6,762
1 Sergey Alexandrovich Kryukov 5,539
2 Maciej Los 3,479
3 Peter Leow 3,323
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 20 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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