Jak*_*les 4 windows qt window-managers foreground
状态的Qt文档QWidget::activateWindow()
:
在Windows上,如果您在应用程序当前不是活动应用程序时调用它,则它不会使其成为活动窗口.它将更改任务栏条目的颜色,以指示窗口已以某种方式更改.这是因为Microsoft不允许应用程序中断用户当前在另一个应用程序中执行的操作.
但是,Skype似乎无视这一规则.如果Skype正在运行但不是活动应用程序,我可以从开始菜单启动它,它将现有实例带到前台,激活它并获取输入焦点.
我怎么能这样做?
(NOTE: This is specific to how QtSingleApplication works)
The solution is stupidly simple for my issue. Simply call AllowSetForegroundWindow(ASF_ANY);
at the beginning of the application, and the original process will thus be allowed to bring itself to the foreground by use of SetForegroundWindow()
. No strange hacks, just one line of code to add and no need to modify QtSingleApplication either.
归档时间: |
|
查看次数: |
5555 次 |
最近记录: |