I am trying to call the PrintDlgW Win32 API from C # through P / Invoke. With P / Invoke Interop Assistant 1.0 from Microsoft, I can declare the necessary data structures and import functions from the DLL. But how to use HDC or HWND in C #? Thanks in advance.
This site has nice examples with structures already defined for quite a few APIs. The structure is here .
HWND in C ++ is indeed void *, which is presented in C # as IntPtr.
It can make it easier.
using HWND = System.IntPtr;
Then use HWND in your pInvoke ... to make it easier to read and keep it βthe sameβ as the pin code signature.
Hope this helps, Regards, Tom.