怎么样能得到任务管理器中(Ctrl+alt+del出来的那个)所有任务的窗体句柄
也就是任务栏上所有现在运行的程序,我想得到它们窗体的句柄,该怎么做?
也就是任务栏上所有现在运行的程序,我想得到它们窗体的句柄,该怎么做?
解决方案 »
- 用控件Browser多个度文件夹,获取路径
- SSDBGRID问题
- 请问XOR用法~~~
- 谁能帮我说说在vsflexgrid加入CHECKBOX的例子?
- split分离做的exe生成器一条内容正常 生成2条不行
- ZeroMemory怎么用?
- 如何合并2个表? 在线等待! 急!!
- 如何做一个远程登录2000的程序
- $$$$$$大家讨论一下哪个打包程序好一点,并请提供下载地址,散分50$$$$$
- Adodc1.Recordset.RecordCount问题!?急!!1
- 怎样在XP的任务管理器-程序里隐藏自己?
- 急,期待高手救命!setupfactory打包生成的setup.exe的“属性”->“版本”里有Indigo Rose 公司的信息,怎么去掉啊?
caption:Windows 任务管理器
使用findwindow
Dim l As Long
List1.Clear
'遍历所有的窗口
l = EnumWindows(AddressOf EnumWindowsProc, 0)
End SubDeclare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long'该函数是EnumWindows的回调函数,EnumWindows函数将遍历的窗口句柄传递到hwnd参数中
Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
Dim astr As String * 256
Dim l As Long
Dim i As Long
l = GetWindowText(hwnd, astr, Len(astr))
If InStr(astr, " ") > 1 Then
i = InStr(1, astr, Chr(0))
astr = LCase(Left(astr, i - 1))
Form1.List1.AddItem Trim(astr) & hwnd
End If
EnumWindowsProc = True
End Function