I'm using the DrawText function in a Win32 program to display "Local" at the top center of the screen and "Server" in the center. When I run the program it displays "Local" but not "Server". Here is the code in my message loop:
case WM_PAINT:
{
RECT localLabel;
localLabel.left = 0;
localLabel.top = 0;
localLabel.right = 270;
localLabel.bottom = 20;
PAINTSTRUCT localPs;
HDC localHandle = BeginPaint(hwnd, &localPs);
DrawText(localHandle, "Local", -1, &localLabel, DT_CENTER);
EndPaint(hwnd, &localPs);
PAINTSTRUCT serverPs;
RECT serverLabel;
serverLabel.left = 0;
serverLabel.top = 100;
serverLabel.right = 270;
serverLabel.bottom = 20;
HDC serverHandle = BeginPaint(hwnd, &serverPs);
DrawText(serverHandle, "Server", -1, &serverLabel, DT_CENTER);
EndPaint(hwnd, &serverPs);
}
break;
I tried using the same PAINTSTRUCT but that didn't help. I tried using the same HDC but that didn't help either. How can I display both on the screen?
Thanks.