Results 1 to 15 of 15

Thread: Get the Hwnd's of TaskBar

Threaded View

  1. #5

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    16

    Red face Re: Get the Hwnd's of TaskBar

    With this i can get the number of buttons in the Task-Toolbar

    In Win2k (here in Work) is not same than WinXP (in home). In fact, is different if you have the QuickIcons (is another Toolbar)

    VB Code:
    1. Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
    2. ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    3. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    4. (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    5. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
    6. hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    7.  
    8. Private Const WM_USER = &H400
    9. Private Const TB_BUTTONCOUNT = (WM_USER + 24)
    10.  
    11. Private Sub Form_Load()
    12.  twnd = FindWindow("Shell_TrayWnd", vbNullString)
    13.  twnd = FindWindowEx(twnd, 0&, "ReBarWindow32", vbNullString)
    14.  twnd = FindWindowEx(twnd, 0&, "MsTaskSwWClass", vbNullString)
    15.  twnd = FindWindowEx(twnd, 0&, "ToolbarWindow32", vbNullString)
    16.  
    17.  MsgBox "Buttons : " & SendMessage(twnd, TB_BUTTONCOUNT, 0&, 0&)
    18. End Sub

    That is for another stuff, because is not related to the Task-Toolbar. Is related only to the Shell_TrayWnd

    VB Code:
    1. bWnd = FindWindowEx(tWnd, bWnd, "BUTTON", vbNullString)

    Please, if somebody wants to help then give some REAL samples

    As i say, i can get the Task-Toolbar, the number of Buttons and the Text of every Button (with AA). I'm just want to get the Hwnd's or some identifier to i can know what button is for what window
    Last edited by sunco; Oct 11th, 2005 at 09:53 AM. Reason: some corrections on the text. too long strings

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