[Win32 API] Drawing screen to client area & draw something on screen

so I have this code to draw screen to client area every 100ms

1
2
3
4
5
6
					HDC hDC = GetDC(hWnd);

					SetStretchBltMode(hDC, HALFTONE);
					StretchBlt(hDC, 0, 0, screen.right/2, screen.bottom/2, GetDC(NULL), 0, 0, screen.right, screen.bottom, SRCCOPY);

					DeleteDC(hDC);


however whenever it draws the program freezes for a while (like 10ms), it's not really noticeable unless you move the window around - then you can see how window stutters and just "teleports" to where it is supposed to be, is there something I can do to fix this?

also is it possible to draw, for example, blue rectangle on the screen, no matter what's going on? e.g. my program is minimized and there's a game running on fullscreen (or at least fullscreen-windowed (borderless))
Last edited on
Topic archived. No new replies allowed.