You have to use BeginPaint() to get the handle of the device context when
handling the WM_PAINT message, and EndPaint() when you've done.
PAINTSTRUCT ps ;
HDC hdc;
case WM_PAINT
{
hdc = BeginPaint (hwnd, &ps) ;
TextOut(hdc,100,30,"hello",5);
EndPaint (hwnd, &ps) ;
return 0 ;
}
That way, Windows knows that the painting is done and should not call your
handler until the window needs painting again.
Try that, and let us know if your message box problem is solved as well.
Kev.
----- Original Message -----
From: christiaan scholtz <ck...@ia...>
To: <dev...@li...>
Sent: Monday, March 18, 2002 1:04 PM
Subject: [Dev-C++] message box not showing up
Thanx to kevin I was able to display text in fullscreen, but i have two new
problems now:
One is that the text gets these flashing white lines in it, i solved this as
follows:
case WM_PAINT:
if (first)
{
TextOut(GetDC(hWnd),100,30,"hello",5);
first = false;
}
Is that what i must do or did i do something wrong?
Secondly, ever since I put the WM_PAINT message in my messageboxes dont show
untill I press alt!
|