I created a window with WS_EX_LAYERED style, then i checked the first WM_PAINT message, I called BeginPaint to retrieve the area need to be paint, but the area i got is empty. But, when i create this window using WS_EX_LAYERED | WS_EX_COMPOSITED, i got the right area which need to be paint for the first WM_PAINT message. Why? Code fragments:
WM_PAINT:
PAINTSTRUCT ps;
BeginPaint(&ps);
RECT rcPaint;
CopyRect(&rcPaint, ps.rcPaint);
//If the ExStyle of window is WS_EX_LAYERED, and the very first time received WM_PAINT message, the value of rcPaint is
//rcPaint.left = 0, rcPaint.top = 0, rcPaint.right = 0, rcPaint.bottom = 0;
//else, if the ExStyle of window is WS_EX_LAYERED | WS_EX_COMPOSITED, the value of rcPaint is
//rcPaint.left = 0, rcPaint.top = 0, rcPaint.right = 123, rcPaint.bottom = 213;
//do some paiting...
EndPaint(&ps);
What's the problem?