Where's the HWND in Form?
-
How do you get an HWND handle inside a Form object in C++, VC2005 ? Thanks swine [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
-
How do you get an HWND handle inside a Form object in C++, VC2005 ? Thanks swine [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
It's the .Handle property, I believe. Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
It's the .Handle property, I believe. Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
Is it a HWND type? I get a compiler error saying: Error 3 error C2440: 'type cast' : cannot convert from 'System::IntPtr' to 'HWND' My code is: HWND h = (HWND)Handle; [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
-
Is it a HWND type? I get a compiler error saying: Error 3 error C2440: 'type cast' : cannot convert from 'System::IntPtr' to 'HWND' My code is: HWND h = (HWND)Handle; [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
I'm not sure how to do that conversion, but I've passed the Handle in from C# when I make pinvoked API calls and it's worked fine. Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
I'm not sure how to do that conversion, but I've passed the Handle in from C# when I make pinvoked API calls and it's worked fine. Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
That's great but here it doesn't work. :confused: [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
-
That's great but here it doesn't work. :confused: [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
To verify that the Handle property really contains a HWND: MSDN quote: "Syntax public IntPtr Handle { get; } Property Value An IntPtr that contains the window handle (HWND) of the control. Remarks The value of the Handle property is a Windows HWND. If the handle has not yet been created, referencing this property will force the handle to be created." --- b { font-weight: normal; }
-
Is it a HWND type? I get a compiler error saying: Error 3 error C2440: 'type cast' : cannot convert from 'System::IntPtr' to 'HWND' My code is: HWND h = (HWND)Handle; [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
If form was your form object, try: (HWND)form.Handle.ToPointer()
-
If form was your form object, try: (HWND)form.Handle.ToPointer()
Excellent! That's exactly what I needed. Thanks :) :) [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.