Alex Strickland
Alex Strickland

Reputation:

WM_ERASEBKGND not followed by WM_PAINT

My app is getting a WM_ERASEBKGND message which is not followed by a WM_PAINT message. Naturally enough my application erases the background, and then just sits there with a blank window.

I am running under Vista, but it happens under XP as well. I am pretty sure it is my fault, but what could I be doing so that Windows does not behave?

I am fairly sure about the messages as I am using Spy++ to watch. This is a C app compiled under MSVC 2008.

Upvotes: 1

Views: 1265

Answers (1)

Chris Becke
Chris Becke

Reputation: 36026

Don't call BeginPaint / EndPaint in your WM_ERASEBKGND handler.

Upvotes: 3

Related Questions