Click here to Skip to main content
15,888,908 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am having dialog box application in MFC. To refresh view on dialog box we are using WM_NCPAINT, it does call OnNCPaint, but sometimes view is not getting refreshed. Behaviour is not always reproducible. Same behaviour is happening with WM_PAINT also.

When we use SendMessage(WM_SIZE), behaviour is not reproducible, and working as expected.

Before checking in the code, I wanted to make sure, should I use WM_SIZE instead of WM_NCPAINT or WM_PAINT, because it is working fine with it.
Posted
Comments
Kornfeld Eliyahu Peter 13-Jan-15 7:18am    
WM_NCPAINT is for painting the none-client (NC!) part of the window (means frame) so it is different from WM_PAINT...
I should advise to check your code...

1 solution

From the WM_PAINT[^] MSDN page:
Quote:
The WM_PAINT message is generated by the system and should not be sent by an application
To update or redraw a window use the UpdateWindow[^] and RedrawWindow[^] functions.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900