I need to retrieve HWND and HINSTANCE for my window!
hey, i am using a backbuffering system called tiny PTC for my software rasterizer. The only problem is tiny ptc registers the window for my program within its init function. This means that I dont have access to the HWND and HINSTANCE for the window (i tried rewriting the tiny ptc but i dont understand it and it was a big disaster.) The reason i need to get the HWND and HINSTANCE for the window is that i need to use them for the initialization of DirectInput things.
What i am wondering is if there is a windows API function that returns the HWND and HINSTANCE.
Any help would be greatly appreciated.
Try GetActiveWindow() to get the HWND and you may be able to get the HINSTANCE by using GetModuleHandle() you program is wrapped up in a DLL, if not then I'm not sure about getting the HINSTANCE.
use GetWindowLong ()to get the hinstance but before u need to get the handle. GetWindowLong (hWnd,GWL_HINSTANCE);
If it's a console applicationm you can use:
HWND hwnd = GetForegroundWindow();
...and of couse for HINSTANCE (as described above) is:
HINSTANCE hInstance = GetModuleHandle(0);
HWND hwnd = GetForegroundWindow();
...and of couse for HINSTANCE (as described above) is:
HINSTANCE hInstance = GetModuleHandle(0);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement