|
-
Oct 10th, 2005, 11:41 PM
#1
Thread Starter
Junior Member
Re: Get the Hwnd's of TaskBar
Well.. with that i only can get the Hwnd of the ToolBar and how many buttons have it with TB_BUTTONCOUNT. But i can't get the Hwnds yet
What i really need is get and identifier to know what button is from what window. I can get the Text with AccesibleObjects but 2 windows can have the same text, so is not good
Edit : I can get the Text when move the mouse with AccessibleObjects, but i need the Hwnd
-
Oct 11th, 2005, 01:51 AM
#2
Re: Get the Hwnd's of TaskBar
Here you go, add these snippets:
This is for VB.NET.
VB6, change integers to long.
VB Code:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer
VB Code:
Dim tWnd As Integer
Dim bWnd As Integer
tWnd = FindWindow("Shell_TrayWnd", vbNullString)
bWnd = FindWindowEx(tWnd, bWnd, "BUTTON", vbNullString)
-
Oct 11th, 2005, 09:52 AM
#3
Thread Starter
Junior Member
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:
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 FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_USER = &H400
Private Const TB_BUTTONCOUNT = (WM_USER + 24)
Private Sub Form_Load()
twnd = FindWindow("Shell_TrayWnd", vbNullString)
twnd = FindWindowEx(twnd, 0&, "ReBarWindow32", vbNullString)
twnd = FindWindowEx(twnd, 0&, "MsTaskSwWClass", vbNullString)
twnd = FindWindowEx(twnd, 0&, "ToolbarWindow32", vbNullString)
MsgBox "Buttons : " & SendMessage(twnd, TB_BUTTONCOUNT, 0&, 0&)
End Sub
That is for another stuff, because is not related to the Task-Toolbar. Is related only to the Shell_TrayWnd
VB Code:
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|