wie auch schon im Thread http://www.xbaseforum.de/viewtopic.php?f=27&t=4422 geht es um FindWindow / GetWindow.
Code: Alles auswählen
LOCAL hwnd := DllCall("User32.dll", DLL_STDCALL, "FindWindowA","Shell_TrayWnd", Chr(0))
es geht um das "Loop through" wo ich nicht weiss wie ich das machen soll ?lngStartMenuHand = FindWindow("Shell_TrayWnd", vbNullString)
'Get the handle to the first child window of the start menu.
lngChildHand = GetWindow(lngStartMenuHand, GW_CHILD)
'Loop through all siblings until we find the 'System Tray' (A.K.A. --> TrayNotifyWnd)
Do
lngClassNameLen = GetClassName(lngChildHand, strClass, Len(strClass))
'If it is the tray then store the handle.
If InStr(1, strClass, "TrayNotifyWnd"/"Lautstärke" ) Then
lngTrayHand = lngChildHand
Exit Do
End If
'If we didn't find it, go to the next sibling.
lngChildHand = GetWindow(lngChildHand, GW_HWNDNEXT)
Loop
wie/was macht GetClassName() ? ist das sowas wie ":Childlist()" ?
Ich mache das sonst mit WinID http://www.dennisbabkin.com/php/m_download.php (Empfehlung von Günter Beyes) und kann damit von jedem Part das Handle, "Title" und Parent Window ermitteln, aber ich würde es gerne mit Xbase++ machenSyntax
int WINAPI GetClassName(
__in HWND hWnd,
__out LPTSTR lpClassName,
__in int nMaxCount
);
Parameters
hWnd [in]
HWND
A handle to the window and, indirectly, the class to which the window belongs.
lpClassName [out]
LPTSTR
The class name string.
nMaxCount [in]
int
The length, in characters, of the buffer pointed to by the lpClassName parameter. The class name string is truncated if it is longer than the buffer and is always null-terminated.
Return Value
int
If the function succeeds, the return value is the number of characters copied to the specified buffer.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
wenn ich z.b. das Icon "Lautstärke" in der Taskleiste ansprechen will müsste ich
Code: Alles auswählen
LOCAL cTitle := "Lautstärke"
LOCAL hwnd := DllCall("User32.dll", DLL_STDCALL, "FindWindowA","Shell_TrayWnd", Chr(0))
LOCAL nEdithwnd := DllCall("User32.dll",DLL_STDCALL, "FindWindowExA",hWnd,, 0,cTitle,"")