Click to See Complete Forum and Search --> : HINSTANCE from LPCREATESTRUCT...


YourSurrogateGod
February 26th, 2005, 12:54 PM
Below is an attached program that uses GetModuleHandle in order to get the instance to the program that is running. I tried to do the same with (((LPCREATESTRUCT) lParam) -> hInstance), but when I tried that, the program crashed. I went through with a debugger and when I got to the point that hInstance was declared it was described as 0x00000...0 in hex. My question is, why can't I get the instance to the program with the LPCREATESTRUCT? Is it no longer supported in .NET and was used in the yester-years of the WinAPI?

Mick
February 26th, 2005, 02:09 PM
A WM_LBUTTONDOWN does not carry a CREATESTRUCT. Look for the WM_CREATE