标题:getwindow获取任意应用程序句柄操作请教,
只看楼主
a414715440
Rank: 2
等 级:论坛游民
帖 子:37
专家分:26
注 册:2011-8-28
结帖率:100%
 问题点数:0 回复次数:2 
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我应该怎么去写这个代码呢,求高手指教下哦,

搜索更多相关主题的帖子: 应用程序 index 
2011-09-29 13:53
shikang
Rank: 2
等 级:论坛游民
帖 子:3
专家分:10
注 册:2011-5-27
得分:0 
Please Search the API Function "GetWindow" In Online Msdn.
2011-09-30 18:57
a414715440
Rank: 2
等 级:论坛游民
帖 子:37
专家分:26
注 册:2011-8-28
得分:0 
回复 2楼 shikang
西利哥,
2011-10-04 11:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-351280-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.421918 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved