Saturday, February 5, 2011

C# .NET creating a IntPtr to a int

A IntPtr to int can be simply created using a constructor of IntPtr.
Example: In many windows message queue API function we need to send a brodacast message to all top level window using hwnd = 0xFFFF and for such cases we can get the IntPtr to 0xFFFF using

IntPtr hwnd = new IntPtr(0xFFFF);

No comments:

Post a Comment