I'm just trying to output the value of a variable to a window.
Here is the function I run after a WM_PAINT message:
Code:
void OnPaint(HWND hWnd,MACHINE *machine)
{
RECT rect;
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rect);
SetTextColor(hdc, RGB(0xFF, 0x00, 0x00));
SetBkMode(hdc, TRANSPARENT);
rect.left = 10;
rect.top = 40;
char reg[10] = { 0 };
DrawText(hdc,( LPTSTR )(_itoa_s(machine->cpu.AddressBus, reg, 16)), -1, &rect, DT_SINGLELINE | DT_NOCLIP);
// SelectObject(hdc, oldPen);®
//DeleteObject(hPen);
EndPaint(hWnd, &ps);
I also do UpdateWindow(GetDesktopWindow)); in my main loop. Debug confirms the my paint routine is being run as it should.
Blank window is all I get
EDIT: Just realized UpdateWindow is being called, but after the initial window draw, WM_PAINT doesn't seem to be being sent. How do I force a redraw of the client area?