在Mac上激活之前的过程 [英] Activate previous process on Mac

查看:69
本文介绍了在Mac上激活之前的过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以确定以前的活动进程来激活它?

Is it possible to determine the previous active process to activate it?

Mac OS X/C ++/Carbon.

Mac OS X / C++ / Carbon.

GetNextProcess()不涉及进程的Z顺序,但是我需要真实的前一个.

GetNextProcess() does not refer to Z-order of processes, but I need the real previous.

最初的任务是在用户关闭我的信息窗口时将其带回他们的工作.当前,我的应用程序的另一个窗口(如果有)获得焦点,或者只有一个没有焦点的窗口.这是无法使用的.

The original task is to bring the user back to their work when they closes my info window. Currently another window of my app gets the focus, if any, or there just no window with focus. It is unusable.

更新.现在,我使用以下变通方法:500毫秒计时器监视 GetFrontProcess(),它不等于 GetCurrentProcess().然后调用 SetForegroundProcess()作为最后存储的序列号.

Update. Now I'm using the following workaround: 500ms timer watches for GetFrontProcess() which is not equal GetCurrentProcess(). Then calling SetForegroundProcess() for the last stored serial number.

推荐答案

您可以从位置.最后一个过程应该是您要寻找的过程.或更改代码以反向读取.

You can get the zorder of processes from this place. Last process should be the one you are looking for. Or change code to read in reverse.

这篇关于在Mac上激活之前的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆