Re: WM_PAINT NON-STOP IN CUSTOM CONTROL
Hello Fellas,
With that BeginPaint I have the constantly receiving WM_PAINT's stopped, but
instead of updating whole region when I draw an image, it updates the only
erased rectangles or doesn't update at all if there is no dirty areas, but
the background image already changed and I need it to be full updated!!..
Loading an image function sends just one message to that image win to
WM_UPDATE and the image win callback returns 0, no problem with that
function..
Sending the message func works Ok..
But without BeginPaint it was non-stop update, so I couldn't even move the
window!!
Then I placed Beep function, just to control when the image win receives
WM_UPDATE..
And then suddenly, I commented BeginPaint/End functions and just left only
Beep..
And again I began to hear that beep non-stop again (WM_UPDATE), BUT>>>!!!!!!
Image update and window moving was fine!!!!! it works now good, exactly how
it suppose to.
So, now I placed Beep (0,1) function and no sound and perfect work..
Of course I understand that's stupid and unwell, but what can I do..???
Any Idea??
/*************************************************************/
case WM_PAINT:
// PAINTSTRUCT ps;
// BeginPaint(hwnd, &ps);
Beep(0, 1);
if (hImage != NULL)
{
HDC tmpDC;
hdc = GetDC(hwnd);
tmpDC = CreateCompatibleDC(hdc); //
GetWindowRect(hwnd, &rct);
SelectObject(tmpDC, hImage);
BitBlt(hdc, 0, 0, rct.right, rct.bottom, tmpDC, 0, 0, SRCCOPY);
DeleteDC(tmpDC);
ReleaseDC(hwnd, hdc);
}
// EndPaint(hwnd, &ps);
return 0;