[讨论]GetWindowThreadProcessId返回的数据LONG是什么意思啊?
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
'窗体代码
Private Sub Command1_Click()
Dim a As Long, PID As Long, b As Long
a = FindWindow(vbNullString, 0)'获得任意窗口的句柄
Print a
PID = GetWindowThreadProcessId(a, b)'看到网上介绍的..该函数应该返回的 是查找句柄的进程PID序号,
Print PID, b '输出来的时候..这两个值不相等.也就是说PID变量不等于进程pid
End Sub
参数表 | |
参数 | 类型及说明 |
lpdwProcessId | Long,指定一个变量,用于装载拥有那个窗口的一个进程的标识符 |
hwnd | Long,指定窗口句柄 |