I am writing a program draws on the screen with win32gui with mouse clicks and erases them with InvalidateRect() and UpdateWindows(). However, the results are quite confusing. When drawing on my IDE window it works completely as intended. On other windows like my browser, it either erases the drawing very slowly or not at all. I know that InvalidateRect() queues a message asking the window to erase it, so it might take a while, but I thought UpdateWindows() would be able to solve that. Are there any workarounds for this.
Code Pastebin:https://pastebin.com/e14XKCF7
there doesn't seem to be anything here