How to bring my application to the front?

后端 未结 8 688
孤城傲影
孤城傲影 2020-12-08 15:32

I know all the reasons why it is a bad idea. I dislike it if an application steals input focus, but this is for purely personal use and I want it to happen; it will not dist

8条回答
  •  借酒劲吻你
    2020-12-08 15:47

    You could write an Executable to workaround that limitation. Take for example a simple (non-visual) application (basically a console app but without the {$APPTYPE CONSOLE}) with the only purpose to bring your desired window to front.

    Your monitoring background application calls the helper app via command line call (e.g. ShellExecute) whenever your bringtofront action is needed. Since this app is becoming the foreground process, it is then able to bring other windows to front (SetForeGroundWindow). You could use FindWindow to get a handle on your target window or pass appropriate parameters when starting your helper app.

提交回复
热议问题