I want to write me a small window framework for OpenGL on windows. I know there are a lot of good window libraries but I like to do it myself. But I have a small problem, if I want to create a window with the Win32 API I need the parameters like "hInstance" .... How I get this needed variables in a Window.class ? How the other Window libraries do it ?
You can use GetModuleHandle(0);
to get the programs hInstance
. Just passing 0
as the hInstance
parameter worked for me.
"Passing 0 retrieves the handle of the calling process, not the calling module. If the library/framework is implemented as a DLL, you would end up with the wrong handle. Use the handle passed to DllMain()
or DllEntryPoint()
instead. – Remy Lebeau"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With