SetForegroundWindow() Problem
-
hwnd3 = FindWindow(0,"test.docx [Kompatibilitätsmodus] - Microsoft Word"); AttachThreadInput(GetWindowThreadProcessId(GetForegroundWindow(), 0), GetWindowThreadProcessId(hwnd3, 0), 1); SetForegroundWindow(hwnd3);Ich möchte per Programm das Word Fenster in den Vordergrund bringen. Komischerweise funktioniert das nur manchmal. Was tun?
Gruß.
-
debugge und gucke ob das Handle gültig ist.
-
Ist Dein Proramm das aktive. Dann vergiss den Käse mit AttachThreadInput.