论坛: 编程破解 标题: 一个VB的问题。找QQ聊天窗口。可是找不到 复制本贴地址    
作者: baobao [gnijnil]    论坛用户   登录
我用下面的去找QQ聊天窗口。可是找不到。哪位高手帮我改一下。谢谢了。

-------------------------------------------------------------------------------
    Dim GetQQh As Variant
    Dim hLogin As Variant

    GetQQh = FindWindowEx(hWnd1, hWnd2, "#32770", lpsz2)
    hLogin = FindWindowEx(GetQQh, hWnd2, " ", "发送") '第三个参数帮我填一下。^_^
   
    If hLogin <> 0 Then
        MsgBox "找到了。", vbExclamation + vbOKOnly, "^_^"
    End If
-------------------------------------------------------------------------------


[此贴被 286(unique) 在 08月01日13时24分 编辑过]

地主 发表时间: 05-07-30 17:49

回复: gnijnil [gnijnil]   论坛用户   登录
汗....

B1层 发表时间: 05-08-02 14:54

回复: zhoen889 [zhoen889]   论坛用户   登录
下面的可能帮到你
如果要得到下面控件的文本,FindWindowEx查找子控件的句柄就可以了
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const SW_SHOWNORMAL = 1
Const WM_CLOSE = &H10
Const gcClassnameMSWord = "OpusApp"
Const gcClassnameMSExcel = "XLMAIN"
Const gcClassnameMSIExplorer = "IEFrame"
Const gcClassnameMSVBasic = "wndclass_desked_gsk"
Const gcClassnameNotePad = "Notepad"
Const gcClassnameMyVBApp = "ThunderForm"
Private Sub Form_Load()
    Dim WinWnd As Long, Ret As String, RetVal As Long, lpClassName As String
    \'Ask for a Window title
    Ret = InputBox("Enter the exact window title:" + Chr$(13) + Chr$(10) + "Note: must be an exact match")
    \'Search the window
    WinWnd = FindWindow(vbNullString, Ret)
    If WinWnd = 0 Then MsgBox "Couldn\'t find the window ...": Exit Sub
    \'Create a buffer
    MyStr= Space(256)
    RetVal = GetWindowText WinWnd , MyStr, 256
    MsgBox "the text is " + Left$(MyStr, RetVal)
End Sub

B2层 发表时间: 05-08-06 09:01

回复: gnijnil [gnijnil]   论坛用户   登录
谢谢.

B3层 发表时间: 05-08-08 00:47

回复: wwwccsucn [huangketan]   论坛用户   登录
是啊。是要用到api函数。

B4层 发表时间: 05-08-12 15:23

论坛: 编程破解

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号