I am using InvalidataRect(hWnd, &rect, TRUE) to clear my client rect....does this mean that a WM_PAINT message will the invoked automatically by it....
neways fot the time being lets assume it does....
look at this code snippet...
Expand|Select|Wrap|Line Numbers
- switch(message)
- {
- case WM_CREATE:
- srand(time(0));
- break;
- case WM_SIZE:
- GetClientRect(hWnd, &rect);
- break;
- case WM_LBUTTONUP:
- InvalidateRect(hWnd, &rect, TRUE); // TRUE so that it clears
- // the screen
- break;
- case WM_PAINT:
- BeginPaint(hWnd, &ps);
- ShowText(hWnd, rect);
- EndPaint(hWnd, &ps);
- break;
- case WM_DESTROY:
- PostQuitMessage(0);
- break:
- ...
- ...
- ...
- ...
- }
Now my question is if InvalidateRect() invokes WM_PAINT every time its called then it should print the desired text every time i click on a blank screen....but the fact is nothin happens after just for once the text is being displayed...