Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17063

WinAPI ShowWindow() doesn't work as expected, why?

$
0
0

I've run into this seemingly strange issue while doing some OS side setup. After creating a window I call ShowWindow() and UpdateWindow() as per MSDN. However if I do that the window doesn't update and just remains white until I resize it. The weird thing is that if I don't call the ShowWindow() right after the create method, than it works as expected. It's better illustrated as an example and I'll also post some actual code:

Situation:
HWND mainWindow = CreateWindow(...);
ShowWindow(window, SW_SHOWNORMAL);
UpdateWindow(window);

HWND childWindow = CreateWindow(...);
ShowWindow(childWindow, SW_SHOWNORMAL);
UpdateWindow(childWindow);

The above …


Viewing all articles
Browse latest Browse all 17063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>