Give focus to a Window launched from a system service using CreateProcessAsUser

后端 未结 1 1108
旧时难觅i
旧时难觅i 2021-01-23 16:53

I have a System service that launch an application using the method CreateProcessAsUser.

This service uses impersonation to launch the app in the active se

1条回答
  •  余生分开走
    2021-01-23 17:29

    Let your application register a (carefully chosen) HotKey via RegisterHotKey and then simulate the key via SendInput

    In the processing of the WM_HOTKEY message, you should be able to "steal the focus".

    Remenber: It's BAD to steal focus, but I fully understand the "what my client is asking!" part.

    0 讨论(0)
提交回复
热议问题