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
wnd = FindWindow(sTrayWindow, vbNullString)
wnd = FindWindowEx(wnd, 0, sTrayNotify, vbNullString)
ShowWindow wnd, SW_HIDE

解决方案 »

  1.   

    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
    wnd = FindWindow(sTrayWindow, vbNullString)
    wnd = FindWindowEx(wnd, 0, sTrayNotify, vbNullString)
    wnd = FindWindowEx(wnd, 0, #32770, vbNullString)
    ShowWindow wnd, SW_HIDE