C#調用Windows API函數的基本方式
一般整型参数声明:
[DllImport("user32.dll", CallingConvention = CallingConvention.StdCall]
privatestaticexternint ShowWindow(IntPtr hWnd, int nShowCmd);
带字符串参数的API函数声明:
[DllImport("user32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)] private static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);

浙公网安备 33010602011771号