我看RegisterHotKey功能:如何在C#.Net中將空指針傳遞給Win32 API?
http://msdn.microsoft.com/en-us/library/ms646309(VS.85).aspx
BOOL RegisterHotKey(
__in HWND hWnd,
__in int id,
__in UINT fsModifiers,
__in UINT vk
);
我一直在使用IntPtr
在第一個參數,它工作在大多數情況下,精細遍。但是現在我需要故意傳遞一個空指針作爲第一個參數,而IntPtr
(故意)不會這樣做。我剛接觸.Net,這讓我感到困惑。我怎樣才能做到這一點?
其它方式傳遞的第一個參數:https://stackoverflow.com/questions/47997942/how-do-i-handle-optional -c-dll-struct-arguments -in -c-sharp – River