Habe diese Antwort in der Delphi Newsgroup erhalten:
Zitat:
<quote
source="ms-help://MS.MSDNQTR.2004JAN.1033/winui/winui/windowsuserinterface/wind
owing/windows/windowreference/windowfunctions/findwindowex.htm">
If the lpszWindow parameter is not NULL, FindWindowEx calls the GetWindowText
function to retrieve the window name for comparison. For a description of a
potential problem that can arise, see the Remarks section of GetWindowText.
</quote>
The remarks section for GetWindowText is, however, somewhat misleading. The
naked truth is that GetWindowText cannot retrieve the caption of a window in
another process reliably because it is *not* using WM_GETTEXT in that case. And
that is what would have to be done to match on the caption in your FindWindowEx
call.
Fazit: Bei der FindWindowEx() Funktion lpszWindow nil übergeben, wenn sie
Childfenster in einem anderen Prozess sucht.
Grund: FindWindowEx vergleicht bei Angabge von lpszWindow die Übereinstimmung des FensterNamens (lpszWindow) mittels GetWindowText, welche aber nicht zuverlässig ChildFenster Text in einem anderen Prozess ermitteln kann.
Delphi-Quellcode:
HWND FindWindowEx(
HWND hwndParent,
// handle to parent window
HWND hwndChildAfter,
// handle to a child window
LPCTSTR lpszClass,
// pointer to class name
LPCTSTR lpszWindow
// pointer to window name
);