problem bei GetWindowText()
-
hi
also ich habe ein problem mit einer funktion...
ich ermittle über GetWindow das Handle des windows dessen text ich haben will
dann ermittle ich auch das Handle der richedit (childwindow) die handles stimmen ich habe alles schon mit winID überprüft und vom parent window kann ich auch den text (fensternamen) auslesen aber beim child window geht nix mehr
vielleicht kann mir einer helfen und sagen was ich falsch gemacht habehier ist der quelltext:
char buffer[1024]; HWND win; HWND win2; win = FindWindow(0, "Unbenannt - Editor"); win2 = FindWindowEx(win, 0, NULL, NULL); SetForegroundWindow(win); Sleep(1000); GetWindowText(win2, buffer, strlen(buffer)); cout << win << endl; cout << win2 << endl; cout << buffer << endl;ich hoffe einer kann mir helfen
mfg LoLCat
-
remarks beachten

msdn schrieb:
If the target window is owned by the current process, GetWindowText causes a WM_GETTEXT message to be sent to the specified window or control. If the target window is owned by another process and has a caption, GetWindowText retrieves the window caption text. If the window does not have a caption, the return value is a null string. This behavior is by design. It allows applications to call GetWindowText without hanging if the process that owns the target window is hung. However, if the target window is hung and it belongs to the calling application, GetWindowText will hang the calling application.
To retrieve the text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.
ps: wurde schon ein paar mal beantwortet
forensuche
-
danke ggg
und sry