今年过节不散分

DawnPine 2006-12-30 09:01:52
要散就散技术分

入门题
请给出VB取命令行参数示例

进阶题
已取得(另一个正在运行的程序的)窗口内控件的句柄,如何识别该控件的属性?
比如说, 它是一个按钮还是复选框?它是否visble 是否enable等...

说明
答题一定有分
接分的...应该能接到, 但不能保证

祝每一个看到此帖的网友都会享受一个快乐的元旦^_^
...全文
347 点赞 收藏 51
写回复
51 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzd8310 2007-01-03
学习
回复
cpp2017 2007-01-02
散分只散200分.
回复
sstlwg 2007-01-02
抢分喽!!!!!!!!
回复
kirate 2007-01-02
啥叫句柄啊。新手。。不太懂。。呵呵
回复
vbnewer 2007-01-02
接分吖
回复
ap0106204 2007-01-02
JJJJJJJJFFFFFFFFFFF
回复
ap0106204 2007-01-02
JJJJJJFFFFFFFFFFFF
回复
ap0106204 2007-01-01
JF
回复
heziyun99 2007-01-01
up
回复
DengXingJie 2007-01-01
要散就散200分
回复
zzyong00 2006-12-31
进阶题:

模块中:
Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function GetClassName Lib "user32.dll" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public Declare Function EnumChildWindows Lib "user32.dll" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Declare Function IsWindowVisible Lib "user32.dll" (ByVal hwnd As Long) As Long
Public Declare Function IsWindowEnabled Lib "user32.dll" (ByVal hwnd As Long) As Long

Public Function EnumChildProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
Dim strclsname As String, str1 As String, l As Long, h1 As Long, h2 As Long
strclsname = Space(255)
str1 = Space(255)
l = GetClassName(hwnd, strclsname, Len(strclsname))
h1 = IsWindowVisible(hwnd)
h2 = IsWindowEnabled(hwnd)

If Left(strclsname, l) <> "" Then Form1.List1.AddItem Left(strclsname, l) & ":" & IIf(h1, "Visible", "Invisible") & "," & IIf(h2, "Enable", "Disable")
'continue enumeration
EnumChildProc = 1
End Function
form中:
Private Sub Command1_Click()
Dim h As Long, l As Long, strclsname As String, strwndname As String
strclsname = vbNullString
strwndname = "!@#$%^&"'你要找的窗口名
h = FindWindow(strclsname, strwndname)
EnumChildWindows h, AddressOf EnumChildProc, ByVal 0&
End Sub

但是找不到label控件!!! 求解
回复
zzyong00 2006-12-31
入门题
请给出VB取命令行参数示例:msgbox command
回复
colorslife 2006-12-31
接分,呵呵,
回复
Dunzip 2006-12-31
该接分时就接分。
回复
diclover 2006-12-31
路过
回复
DawnPine 2006-12-31
使用API查找句柄,对象是什么自己判断类型,属性嘛,就是直接访问就是了
=====================================
给个例子让俺窥窥
行不?
回复
DawnPine 2006-12-31
dabie() ( ) 信誉:100 Blog 2006-12-30 17:03:53 得分: 0


为什么能开200分的贴在这里,我开不了赐教!!!


============================================
多穿几条三角裤就行了(比如偶今天就穿了5条来)
如果长得跟猩猩一样
不用穿三角裤就能发300分的贴子

回复
dash24 2006-12-31
接分吖!呵呵好好学习了!
回复
eyadcn 2006-12-31
什么啊 给我分
回复
AFIC 2006-12-30
jf
回复
发动态
发帖子
VB基础类
创建于2007-09-28

7449

社区成员

VB 基础类
申请成为版主
社区公告
暂无公告