如题

解决方案 »

  1.   

    Dim HWD As Integer
            HWD = GetWindow(Me.Handle.ToInt32, GW_HWNDFIRST)
            Dim title As New String(Chr(0), 256)
            Dim tt As String
            Do While HWD <> 0 '''''''''''''''''''''''''这里还要注意
                Dim i As Integer
                i = GetWindowText(HWD, title, 256)            If i <> 0 Then
                    If InStr(title, "Word") <> 0 Then '只要有word字样的都列出来
                        Dim str As String
                        ListBox1.Items.Add(title)
                        ListBox1.Items.Add(HWD.ToString)
                    End If
                End If
                HWD = GetWindow(HWD, GW_HWNDNEXT)
            Loop
      

  2.   

    使用API
    [DllImport("user32.dll")]//引入DLL
    public static extern IntPtr FindWindow(string strclassName, string strWindowName);IntPtr xx=FindWindow("OpusApp",null);
    这里的XX就是你要的句柄
      

  3.   

    楼上你说的findwindow获得的是窗口句柄,我现在想要实例句柄该怎么办呢