有时是类型的窗口句柄,有时是类型的窗口int
句柄IntPtr
int
例子:
[DllImport("user32.dll")]
static extern uint GetWindowThreadProcessId(int hWnd, int ProcessId);
IntPtr
例子:
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, StringBuilder lParam);
我似乎无法从一个转换/转换到另一个。
当我尝试时this.ProcessID = GetWindowThreadProcessId(windowHandle.ToInt32(),0)
出现错误cannot implicitly convert from uint to int