|
|
case WM_SIZE:
{
HDC hdc = GetDC(hwnd);
int nwidth=LOWORD(lparam);
int nheight=LOWORD(lparam);
while(msg!=WM_DESTROY)
// draw some text at a random location
{
SetTextColor(hdc, RGB(rand()%256,rand()%256,rand()%256));
// set the background color to black
SetBkColor(hdc, RGB(0,0,0));
// finally set the transparency mode to transparent
SetBkMode(hdc, TRANSPARENT);
TextOut(hdc,rand()%nwidth,rand()%nheight, L"GDI Text Demo!", wcslen(L"GDI Text Demo!"));
Sleep(5);
}
ReleaseDC(hwnd,hdc);
} |
|