getwindow获取任意应用程序句柄操作请教,
我有一个程序,有一个command1数组,6个按钮,index分别为0-5,一个label1标签 代码如下:
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Const GW_HWNDPREV = 3
Private Const GW_HWNDNEXT = 2
Private Const GW_HWNDLAST = 1
Private Const GW_HWNDFIRST = 0
Private Const GW_CHILD = 5
Private Const GW_OWNER = 4
Dim n As String
------------------------------------------
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0
n = GetWindow(Form1.hwnd, 5)
Case 1
n = GetWindow(GW_HWNDLAST, 1)
Case 2
n = GetWindow(GW_HWNDNEXT, 2)
Case 3
n = GetWindow(GW_HWNDPREV, 3)
Case 4
n = GetWindow(GW_OWNER, 4)
Case 5
n = GetWindow(GW_CHILD, 5)
End Select
Label1.Caption = n
End Sub
我是想请问一下,传值vcmd.0-5分别有什么不同,0-5,分别代表了什么意思呢, 然后我要获取其它的应用程序,比如,QQ.exe我应该怎么去写这个代码呢,求高手指教下哦,