Results 1 to 2 of 2

Thread: show/hide systray clock

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Question

    What API calls can be used to show/hide the systray
    clock if it is not showing as if you right click on the
    taskbar, click Properties, and uncheck Show Clock?

    This code does not work:
    Code:
    lHwnd = FindWindowEx(0, 0, "Shell_TrayWnd", vbNullString)
    lHwnd = FindWindowEx(lHwnd, 0, "TrayNotifyWnd", vbNullString)
    lHwnd = FindWindowEx(lHwnd, 0, "TrayClockWClass", vbNullString)
    Call ShowWindow(lHwnd, 5)

  2. #2
    Matthew Gates
    Guest
    Try this:


    Code:
    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
    
    
    Dim shelltraywnd As Long, traynotifywnd As Long, trayclockwclass As Long
    
    Private Sub Form_Load()
        shelltraywnd = FindWindowEx(0, 0, "shell_traywnd", _
        vbNullString)
        traynotifywnd = FindWindowEx(shelltraywnd, _
        0&, "traynotifywnd", vbNullString)
        trayclockwclass = FindWindowEx(traynotifywnd, _
        0&, "trayclockwclass", vbNullString)
        ShowWindow trayclockwclass, 5
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width