Simplest way to create a HWND
Solution 1
I submit my own test code for critique:
HWND dummyHWND = ::CreateWindowA("STATIC","dummy",WS_VISIBLE,0,0,100,100,NULL,NULL,NULL,NULL);
::SetWindowTextA(dummyHWND,"Dummy Window!");
It seemed to work...
Solution 2
After CreateWindow you need to call ShowWindow to make it visible.
Solution 3
In the first tutorial of NeHe they describe carefully what you need to do to set up an OpenGL rendering context, and the creation of a window (and HWND) is a part of it. If you need it for something else than OpenGL context I believe the code they present can be easily adopted.
Comments
-
Mr. Boy over 1 year
I need a dummy window in MSVC++, this will never be visible and is created even before the app's main window. It's required by a rendering engine. So I'd rather not have to register a class if possible.
For testing it would be better to make it visible to prove it is there - can I use a static or a button or something? I've been trying with CreateWindow() but while I am getting a return value, nothing visible is appearing.