I am trying to call the WinAPI DialogBox() function in C# (I cannot access the System.Windows libraries to use MessageBox) but am unable to determine the correct types to use for the parameters with the exception of HWND which is IntPtr. MSDN has:
INT_PTR WINAPI DialogBox(
_In_opt_ HINSTANCE hInstance,
_In_ LPCTSTR lpTemplate,
_In_opt_ HWND hWndParent,
_In_opt_ DLGPROC lpDialogFunc
);
So far, I have:
[DllImport( "user32.dll" )]
static extern IntPtr DialogBox( ? hInstance, string lpTemplate, IntPtr hWnd, ? lpDialogFunc );
Would anyone be able to assist with this? (I thought HINSTANCE may be an int but it can be set to NULL).