Click here to Skip to main content
15,906,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Mark Salsbery6-Sep-07 8:27
Mark Salsbery6-Sep-07 8:27 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? [modified] Pin
abiemann6-Sep-07 8:33
abiemann6-Sep-07 8:33 
QuestionRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
David Crow6-Sep-07 8:41
David Crow6-Sep-07 8:41 
AnswerRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
abiemann6-Sep-07 8:52
abiemann6-Sep-07 8:52 
QuestionRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
David Crow6-Sep-07 8:56
David Crow6-Sep-07 8:56 
AnswerRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
abiemann6-Sep-07 9:00
abiemann6-Sep-07 9:00 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
David Crow6-Sep-07 10:20
David Crow6-Sep-07 10:20 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? [modified] Pin
abiemann6-Sep-07 13:08
abiemann6-Sep-07 13:08 
Hi David,

I've made the change and the background bitmap doesn't flicker at all, however, the controls ontop of the bitmap still flicker.

This is the change I've made:

KeyHandler now triggers OnEraseBkgnd instead of performing PatBlt
When the user presses a key, the key's number is stored in a private member variable of the Dialog.
To subsequently make it update the background image, the Dialogs' key handler performs :
this->Invalidate(TRUE);<br />
this->UpdateWindow();


OnEraseBkgnd now does the PatBlt of the static image behind the controls
Next, OnEraseBkgnd(CDC* pDC) is processed.
this handler first checks that a key was pressed, if so, it performs the targetDC.PatBlt (I just use the pDC that's passed in) then it returns TRUE.
If no key was pressed then I let this handler perform the default CDialog::OnEraseBkgnd(pDC)


After this change I noticed that the individual controls no longer need their RedrawWindow() called, however, they still flicker (but the background static image doesn't flicker at all now).
I've also removed the SetRedraw() calls



-- modified at 19:14 Thursday 6th September, 2007
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Mark Salsbery6-Sep-07 14:31
Mark Salsbery6-Sep-07 14:31 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
David Crow6-Sep-07 17:30
David Crow6-Sep-07 17:30 
QuestionRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Hamid_RT6-Sep-07 7:33
Hamid_RT6-Sep-07 7:33 
AnswerRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
abiemann6-Sep-07 7:39
abiemann6-Sep-07 7:39 
AnswerRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Waldermort6-Sep-07 9:31
Waldermort6-Sep-07 9:31 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
Mark Salsbery6-Sep-07 9:45
Mark Salsbery6-Sep-07 9:45 
GeneralRe: Is there an equivalent to SuspendLayout/ResumeLayout for a MFC Dialog ? Pin
abiemann7-Sep-07 11:03
abiemann7-Sep-07 11:03 
QuestionInfinity Symbol Pin
paper676-Sep-07 6:05
paper676-Sep-07 6:05 
AnswerRe: Infinity Symbol Pin
Mark Salsbery6-Sep-07 6:35
Mark Salsbery6-Sep-07 6:35 
AnswerRe: Infinity Symbol Pin
Matthew Faithfull6-Sep-07 6:40
Matthew Faithfull6-Sep-07 6:40 
QuestionLooking for a &quot;Thumb Wheel&quot; control [modified] Pin
bscaer6-Sep-07 4:26
bscaer6-Sep-07 4:26 
AnswerRe: Looking for a "Thumb Wheel" control Pin
led mike6-Sep-07 5:25
led mike6-Sep-07 5:25 
JokeRe: Looking for a "Thumb Wheel" control Pin
Cedric Moonen6-Sep-07 7:21
Cedric Moonen6-Sep-07 7:21 
AnswerRe: Looking for a &quot;Thumb Wheel&quot; control Pin
Hamid_RT6-Sep-07 7:39
Hamid_RT6-Sep-07 7:39 
AnswerRe: Looking for a &quot;Thumb Wheel&quot; control Pin
Waldermort6-Sep-07 9:27
Waldermort6-Sep-07 9:27 
AnswerRe: Looking for a &quot;Thumb Wheel&quot; control Pin
Sreedhar DV7-Sep-07 1:13
Sreedhar DV7-Sep-07 1:13 
QuestionCreateWindowEx fails Pin
GauranG Shah6-Sep-07 4:02
GauranG Shah6-Sep-07 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.