Fokus eines anderen Apps killen und Fokus auf eigenes setzen
-
Hi Leute!
Ich habe eine Dialog-Applikation erstellt. Das Dialogfenster ist ständig im Vordergrund (mit Flag wndTopMost) und fängt sämtlich Mausevents im System ab.
Wenn ich jetzt auf irgendein anderes Fenster klicke, dann soll sofort der Fokus auf ein Textfeld (CEdit-Klasse) in meinem Dialog gesetzt werden.Probiert habe ich schon
SetFocus, SetWindowActive, SetForegroundWindow, BringWindowOnTop, ShowWindow
(sowohl MFC als auch die API-Verion)Kann mir einer helfen?
-
Aus da MSDN:
Windows 98/Me: The system restricts which processes can set the foreground window. A process can set the foreground window only if one of the following conditions is true:
The process is the foreground process.
The process was started by the foreground process.
The process received the last input event.
There is no foreground process.
The foreground process is being debugged.
The foreground is not locked (see LockSetForegroundWindow).
The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).
Windows 2000/XP: No menus are active.