以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 关于ShowAppWindow (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=75619) |
-- 作者:lswwsl -- 发布时间:2015/10/11 17:25:00 -- 关于ShowAppWindow 如题,请问如何获取QQ对话窗口的标题以方便使用ShowAppWindow最小化?是QQ好友聊天窗口而非QQ主程序。 |
-- 作者:大红袍 -- 发布时间:2015/10/11 19:48:00 -- 汗,测试了一下,没有完善的方法,只能大致获取,参考代码
全局代码
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As EnumWindowsProc, ByVal lParam As Integer) As Integer Public Delegate Function EnumWindowsProc(ByVal hwnd As Integer, ByVal lParam As Integer) As Boolean Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As StringBuilder, ByVal cch As Integer) As Integer <DllImport("user32.dll")> _ Public Function EnumWindowsProcCallBack(ByVal hwnd As Integer, ByVal lParam As Integer) As Boolean <DllImport("user32.dll")> _
内部函数 EnumWindowsProcCallBack
Dim hwnd As Integer = args(0) Dim len As Integer = GetWindowTextLength(hWnd) + 1
调用代码
vars("ls") = new List(Of String) Dim CallBack As New EnumWindowsProc(AddressOf EnumWindowsProcCallBack) |