Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Const SW_SHOW = 5Private Sub Command1_Click() Dim lHwnd As Long lHwnd = FindWindow(vbNullString, "xxxxx")'假如那个窗口的caption是xxxxx lHwnd = FindWindowEx(lHwnd, 0, vbNullString, "Command1") ShowWindow lHwnd, SW_SHOW
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_SHOW = 5Private Sub Command1_Click()
Dim lHwnd As Long
lHwnd = FindWindow(vbNullString, "xxxxx")'假如那个窗口的caption是xxxxx
lHwnd = FindWindowEx(lHwnd, 0, vbNullString, "Command1") ShowWindow lHwnd, SW_SHOW
End Sub