Converting IntPtr to HWND

  • Thread starter Thread starter Edward Diener
  • Start date Start date
E

Edward Diener

How do I convert a System::IntPtr returned by .net as a handle to an actual
Win32 handle like an HWND ? Attempts to use static_cast<HWND>(anIntPtr) do
not work.
 
Convert to void* before cast, like this:

HWND handle = static_cast<HWND>(anIntPtr.ToPointer());

Willy.
 
Back
Top