I'm not sure if this makes a difference but do you see that problem with dialogs (resources + DialogBox) rather than basic windows?
If I remember & get a chance later I can try to make a minimal example.
Edit: Based on this comment [1] I'm guessing you're on something like Windows 8.1 rather than a recent version of Windows 10 or later.
[1] https://www.reddit.com/r/programming/comments/d77mf7/comment...