GetWindowThreadProcessId的一些问题
先看代码Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Sub Form_Click()
Dim a As Long
Dim b As Long
a = FindWindow(vbNullString, "计算器") '获得窗口句柄
b = GetWindowThreadProcessId(a, vbNull) '获得进程PID
Print a
Print CStr(b)
End Sub
b的值和任务管理器的PID值不一样? 不管是 什么程序 都不一样? 怎么回事, 360 什么的都关了 就开一个VB 。。