百思不得其解  :(

解决方案 »

  1.   

    请选择:
    A:EnumWindow枚举窗口
    B:ToolHelp枚举进程
      

  2.   

    http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=18848
      

  3.   

    'Add this code to a form
    Private Sub Form_Load()
        'Set the form's graphics mode to persistent
        Me.AutoRedraw = True
        'call the Enumwindows-function
        EnumWindows AddressOf EnumWindowsProc, ByVal 0&
    End Sub
    'Add this code to a module
    Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Boolean
    Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
    Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
        Dim sSave As String, Ret As Long
        Ret = GetWindowTextLength(hwnd)
        sSave = Space(Ret)
        GetWindowText hwnd, sSave, Ret + 1
        Form1.Print Str$(hwnd) + " " + sSave
        'continue enumeration
        EnumWindowsProc = True
    End Function