Click here to Skip to main content
15,905,914 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: [C++] Fast Fourier Transform algorithm does not work properly Pin
leon de boer4-Mar-19 4:55
leon de boer4-Mar-19 4:55 
GeneralRe: [C++] Fast Fourier Transform algorithm does not work properly Pin
Member 141687014-Mar-19 8:16
Member 141687014-Mar-19 8:16 
AnswerRe: [C++] Fast Fourier Transform algorithm does not work properly Pin
Member 1433176610-Oct-19 5:49
Member 1433176610-Oct-19 5:49 
QuestionMDI or SDI. How do I connect View with a resource formview. Pin
Member 118836021-Mar-19 1:44
Member 118836021-Mar-19 1:44 
AnswerRe: MDI or SDI. How do I connect View with a resource formview. Pin
Victor Nijegorodov1-Mar-19 2:30
Victor Nijegorodov1-Mar-19 2:30 
GeneralRe: MDI or SDI. How do I connect View with a resource formview. Pin
Member 118836021-Mar-19 4:05
Member 118836021-Mar-19 4:05 
GeneralRe: MDI or SDI. How do I connect View with a resource formview. Pin
Victor Nijegorodov1-Mar-19 20:45
Victor Nijegorodov1-Mar-19 20:45 
GeneralRe: MDI or SDI. How do I connect View with a resource formview. Pin
Member 118836021-Mar-19 21:59
Member 118836021-Mar-19 21:59 
GeneralRe: MDI or SDI. How do I connect View with a resource formview. Pin
Victor Nijegorodov1-Mar-19 22:34
Victor Nijegorodov1-Mar-19 22:34 
GeneralRe: MDI or SDI. How do I connect View with a resource formview. Pin
Member 118836022-Mar-19 2:03
Member 118836022-Mar-19 2:03 
QuestionHow to stop flickering of controls in my Dialog window Pin
manoharbalu28-Feb-19 0:43
manoharbalu28-Feb-19 0:43 
AnswerRe: How to stop flickering of controls in my Dialog window Pin
Victor Nijegorodov28-Feb-19 1:02
Victor Nijegorodov28-Feb-19 1:02 
GeneralRe: How to stop flickering of controls in my Dialog window Pin
manoharbalu28-Feb-19 1:56
manoharbalu28-Feb-19 1:56 
AnswerRe: How to stop flickering of controls in my Dialog window Pin
mo149228-Feb-19 3:01
mo149228-Feb-19 3:01 
GeneralRe: How to stop flickering of controls in my Dialog window Pin
manoharbalu1-Mar-19 1:09
manoharbalu1-Mar-19 1:09 
GeneralRe: How to stop flickering of controls in my Dialog window Pin
Victor Nijegorodov1-Mar-19 2:25
Victor Nijegorodov1-Mar-19 2:25 
GeneralRe: How to stop flickering of controls in my Dialog window Pin
mo14921-Mar-19 3:18
mo14921-Mar-19 3:18 
GeneralRe: How to stop flickering of controls in my Dialog window Pin
mo14921-Mar-19 3:33
mo14921-Mar-19 3:33 
AnswerRe: How to stop flickering of controls in my Dialog window Pin
leon de boer1-Mar-19 6:48
leon de boer1-Mar-19 6:48 
I am not a real fan of MFC but I can tell you what windows API is doing.

Dialog backgrounds paint by WM_CTLCOLORDLG, WM_CTLCOLORSTATIC it used to be WM_CTLCOLOR and I suspect MFC still uses WM_CTLCOLOR because it has a couple of bugs.

Usually what you want to do is return a NULL_BRUSH with GetStockObject(NULL_BRUSH);

So this one if you paint the entire dialog then return a NULL_BRUSH
WM_CTLCOLORDLG message - Windows applications | Microsoft Docs[^]

MFC may use this one and again return a NULL_BRUSH
WM_CTLCOLOR message - Windows applications | Microsoft Docs[^]

That means it doesn't paint the background before it sends you an WM_PAINT Smile | :)

If you want/need to transparent overlay the bitmap you have to use a transparent colour to stop flashing
void CDemoDialog::OnPaint()
{
   CPaintDC dc(this); // device context for painting
 
   // transfer the bitmap into paint DC using a transparent color  
   dc.TransparentBlt(
      10, 10, bmp.bmWidth, bmp.bmHeight, // destination coordinates and sizes
      &pDCTmp,                           // source DC .. your DC with bitmap
      0, 0, bmp.bmWidth, bmp.bmHeight,   // source coordinates and sizes
      RGB(255, 0, 0));                   // transparent color

}

In vino veritas


modified 1-Mar-19 12:54pm.

QuestionDialog box margins Pin
Alexander Kindel21-Feb-19 0:24
Alexander Kindel21-Feb-19 0:24 
AnswerRe: Dialog box margins Pin
Richard MacCutchan21-Feb-19 1:04
mveRichard MacCutchan21-Feb-19 1:04 
AnswerRe: Dialog box margins Pin
mo149221-Feb-19 8:45
mo149221-Feb-19 8:45 
GeneralRe: Dialog box margins Pin
Alexander Kindel21-Feb-19 9:30
Alexander Kindel21-Feb-19 9:30 
GeneralRe: Dialog box margins Pin
mo149221-Feb-19 10:02
mo149221-Feb-19 10:02 
GeneralRe: Dialog box margins Pin
leon de boer22-Feb-19 6:05
leon de boer22-Feb-19 6:05 

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.