Flash Win32 Programmer.

Hi, everyone.

I have write a win32 program which use.

// after update I call InvalidateRect to get WM_PAINT message
InvalidateRect(hWnd,NULL,TRUE);

but the window flash sometimes.

Please help me how to deal with this matter.

Thanks.

HANDLE_MSG(hWnd,WM_PAINT,OnPaint);

void OnPaint(HWND hwnd)
{

ClearScreen(hwnd);

PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd,&ps);

//memset(contStr, '\0', sizeof(char) * 8);
TextOut(hdcMem1,160,230,itoa(cont, contStr, 10),2);
TextOut(hdcMem1,320,230,"Communicate",12);
TextOut(hdcMem1,440,230,"Turn",4);
TextOut(hdcMem1,480,230,"River",5);
int y = 250; int x = 300;


//Rectangle(hdcMem1, 220, 5, 570, 220);


BitBlt(hdcMem1,53 ,50,100, 98, hdcMemUnActivePlayer, 0, 0,SRCCOPY);

BitBlt(hdcMem1,x ,y,pokerWidth, pokerHeight, hdcMem, 2 * pokerBitmapPositionX, 0 * pokerBitmapPositionY ,SRCCOPY);
BitBlt(hdcMem1,x + 40 ,y,pokerWidth, pokerHeight, hdcMem,12 * pokerBitmapPositionX, 2 * pokerBitmapPositionY ,SRCCOPY);
BitBlt(hdcMem1,x + 80 ,y,pokerWidth, pokerHeight, hdcMem,6 * pokerBitmapPositionX, 3 * pokerBitmapPositionY ,SRCCOPY);
BitBlt(hdcMem1,x + 140,y,pokerWidth, pokerHeight, hdcMem,7 * pokerBitmapPositionX, 1 * pokerBitmapPositionY ,SRCCOPY);
BitBlt(hdcMem1,x + 180,y,pokerWidth, pokerHeight, hdcMem,8 * pokerBitmapPositionX, 2 * pokerBitmapPositionY ,SRCCOPY);

BitBlt(hdc,0 ,0,JWidth, JHeight, hdcMem1, 0,0 ,SRCCOPY);

EndPaint(hwnd,&ps);
Sleep(200);
}
Topic archived. No new replies allowed.