Click here to Skip to main content
14,843,256 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionBeginPaint issues Pin
Waldermort18-Oct-11 9:08
MemberWaldermort18-Oct-11 9:08 
AnswerRe: BeginPaint issues Pin
TheGreatAndPowerfulOz18-Oct-11 12:22
MemberTheGreatAndPowerfulOz18-Oct-11 12:22 
GeneralRe: BeginPaint issues Pin
Waldermort18-Oct-11 21:00
MemberWaldermort18-Oct-11 21:00 
GeneralRe: BeginPaint issues Pin
TheGreatAndPowerfulOz19-Oct-11 5:01
MemberTheGreatAndPowerfulOz19-Oct-11 5:01 
AnswerRe: BeginPaint issues Pin
Chuck O'Toole18-Oct-11 12:52
MemberChuck O'Toole18-Oct-11 12:52 
GeneralRe: BeginPaint issues Pin
Waldermort18-Oct-11 21:03
MemberWaldermort18-Oct-11 21:03 
GeneralRe: BeginPaint issues Pin
Chuck O'Toole18-Oct-11 23:04
MemberChuck O'Toole18-Oct-11 23:04 
GeneralRe: BeginPaint issues Pin
Waldermort19-Oct-11 3:46
MemberWaldermort19-Oct-11 3:46 
It's too much code to simply paste here. You'll have to take my word for it that there is no way for the rect to be invalidated other than when I explicitly call for it.

My code works like this. bitmap A is updated from a thread. Thread calls InvalidateRect when done updating a frame. bitmap B contains the window background and doesn't change. bitmap C is a double buffer. When WM_PAINT arrives, call BeginPaint, alpha blend bitmap A with B onto C and BitBlt bitmap C to the screen. When done call EndPaint.

Like I said this is GDI 101, and I have never had a problem like this with previous versions of windows or Visual Studio.

As it stands now, calling ValidateRect from anywhere in the WM_PAINT handler solves the problem. I currently have it after the call to EndPaint. Without this call, WM_PAINT is being sent from window creation and always with the full client area. Even though at that time my drawing routines have not yet begun. And yes I do call Begin End on EVERY WM_PAINT.

On another note, passing the message onto DefWindowProc, after those two calls, also results in undesired behaviour. rectangles are being validated but not those that are in the paint struct.

I'm really beginning to think this is a bug.
Waldermort

GeneralRe: BeginPaint issues Pin
Chuck O'Toole19-Oct-11 5:02
MemberChuck O'Toole19-Oct-11 5:02 
GeneralRe: BeginPaint issues Pin
Waldermort19-Oct-11 5:41
MemberWaldermort19-Oct-11 5:41 
Questionselect and accept socket calls Pin
vikramlinux18-Oct-11 8:33
Membervikramlinux18-Oct-11 8:33 
AnswerRe: select and accept socket calls Pin
Richard Andrew x6418-Oct-11 8:39
professionalRichard Andrew x6418-Oct-11 8:39 
AnswerRe: select and accept socket calls Pin
Chuck O'Toole18-Oct-11 10:37
MemberChuck O'Toole18-Oct-11 10:37 
QuestionHow to use a collection Pin
jkirkerx18-Oct-11 7:45
professionaljkirkerx18-Oct-11 7:45 
AnswerRe: How to use a collection Pin
Richard MacCutchan18-Oct-11 22:44
mveRichard MacCutchan18-Oct-11 22:44 
GeneralRe: How to use a collection Pin
jkirkerx19-Oct-11 5:18
professionaljkirkerx19-Oct-11 5:18 
QuestionCompiling DOS Apps With Windows 7 Pin
softwaremonkey18-Oct-11 7:35
Membersoftwaremonkey18-Oct-11 7:35 
AnswerRe: Compiling DOS Apps With Windows 7 Pin
Albert Holguin18-Oct-11 7:44
professionalAlbert Holguin18-Oct-11 7:44 
AnswerRe: 64 bit Windows 7 does not support 16-bit applications Pin
Software_Developer18-Oct-11 7:53
MemberSoftware_Developer18-Oct-11 7:53 
GeneralRe: 64 bit Windows 7 does not support 16-bit applications Pin
softwaremonkey18-Oct-11 9:53
Membersoftwaremonkey18-Oct-11 9:53 
GeneralRe: 64 bit Windows 7 does not support 16-bit applications Pin
enhzflep18-Oct-11 11:52
Memberenhzflep18-Oct-11 11:52 
GeneralRe: 64 bit Windows 7 does not support 16-bit applications Pin
Richard MacCutchan18-Oct-11 22:43
mveRichard MacCutchan18-Oct-11 22:43 
AnswerRe: Compiling DOS Apps With Windows 7 Pin
«_Superman_»18-Oct-11 17:23
professional«_Superman_»18-Oct-11 17:23 
GeneralRe: Compiling DOS Apps With Windows 7 Pin
softwaremonkey18-Oct-11 19:45
Membersoftwaremonkey18-Oct-11 19:45 
GeneralRe: run older 16-bit Windows programs on a 64-bit platform Pin
Goto_Label_18-Oct-11 23:23
MemberGoto_Label_18-Oct-11 23:23 

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.