Window glitches after redrawing with RedrawWindow or SendMessage(WM_PAINT)
Window glitches after redrawing with RedrawWindow or SendMessage(WM_PAINT) I'm writing an application in C++ using the standard Windows API. It does some simple registry modification using buttons. When a button is pressed, it changes a label displayed at the bottom. To change it, I need to repaint the window (which automatically changes the label as needed). But when I redraw the window, it starts glitching. The static labels start flickering, and the buttons are missing altogether, but it stops after moving the window. Here is a GIF of it happening: Here is my WndProc function: WndProc LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static HFONT s_hFont = NULL; HWND drive; switch (message) { case WM_COMMAND: { int wmId = LOWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_ABOUT: Dial...
