GetWindowThreadProcessId VB声明
Declare Function GetWindowThreadProcessId Lib "user32" Alias "GetWindowThreadProcessId" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
说明
获取与指定窗口关联在一起的一个进程和线程标识符
返回值
Long,拥有窗口的线程的标识符
参数表
参数 类型及说明
lpdwProcessId Long,指定一个变量,用于装载拥有那个窗口的一个进程的标识符
hwnd Long,指定窗口句柄
Declare Function GetWindowThreadProcessId Lib "user32" Alias "GetWindowThreadProcessId" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
说明
获取与指定窗口关联在一起的一个进程和线程标识符
返回值
Long,拥有窗口的线程的标识符
参数表
参数 类型及说明
lpdwProcessId Long,指定一个变量,用于装载拥有那个窗口的一个进程的标识符
hwnd Long,指定窗口句柄
HWND hWnd, // handle to window
LPDWORD lpdwProcessId // address of variable for process identifier
);
Parameters
hWnd
Handle to the window.
lpdwProcessId
Pointer to a 32-bit value that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the 32-bit value; otherwise, it does not.
Return Values
The return value is the identifier of the thread that created the window.
只支持win2000建议用WMI
只支持win2000
瞎说,应该是OpenThread只支持2000