读书人

为何用GetWindowThreadProcessId不能获

发布时间: 2012-12-17 09:31:41 作者: rapoo

为什么用GetWindowThreadProcessId不能获得进程标识?
在VS2005环境下,我用GetWindowThreadProcessId想获得当前与当前窗口在一起的线程标识,但却得到0,但用GetCurrentThreadId却可以,是不是使用GetWindowThreadProcessId有什么限制??

Dim hwd As Integer
Dim pid As Integer

hwd = FindWindow(Nothing, "form1")

GetWindowThreadProcessId(hwd, pid)

Label1.Text = GetCurrentThreadId()

Label2.Text = hwd

Label3.Text = pid

本来Label1.Text应该和Label3.Text是一样的吧,但不管怎么改变,label3.text始终为0,请问这是什么原因??

读书人网 >VB Dotnet

热点推荐