Alt Tab 覆盖 Win32 标识符 [英] Alt Tab overlay Win32 identificator

查看:35
本文介绍了Alt Tab 覆盖 Win32 标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将来自外部传感器(例如键盘)的事件映射到键盘快捷键,我想使用快速切换覆盖窗口(即 Alt-Tab 菜单"),但我想一直显示切换菜单,直到选择了应用程序.

I'm mapping events coming from an external sensor (e.g. a keypad) to keyboard shortcuts and I would like to switch applications using the Fast switch overlay window ( i.e. Alt-Tab menu"), but I want to keep showing the switch menu until an application is chosen.

基本上,我在做什么:

if(notInSwitchMenu) 
{   // Alt-Tab keystroke, but Alt remains pressed : the menu is still visible
    Press(VK_MENU); 
    Press(VK_TAB); 
    Release(VK_TAB);
}
else
{

    if(event1) //Tab keystroke : next app
    {
        Press(VK_TAB);
        Release(VK_TAB) ;
    } 
    else if(event2) //Shift-Tab keystroke  : previous app
    { 
        Press(VK_SHIFT); 
        Press(VK_TAB);
        Release(VK_TAB);
        Release(VK_SHIFT) 
    }
    else if(event3) // we get out of the menu : the selected app has the focus.
    {
        Release(VK_MENU);
    } 
}

Press and Release 只需调用具有正确属性的 SendInput.

The Press and Release simply call SendInput with the right properties.

我的问题是我不知道确定用户当前是否在 Alt-Tab 程序列表中的可靠方法.有人知道如何使用 Win32 API 识别 Alt-Tab 覆盖菜单吗?

My problem is that I don't know a robust method to determine if the user is currently in the Alt-Tab program list. Do anyone know how to identify the Alt-Tab overlay menu with the Win32 API ?

推荐答案

EVENT_SYSTEM_SWITCHSTART/EVENT_SYSTEM_SWITCHEND 事件告诉您 Alt+Tab 窗口出现和消失.

The EVENT_SYSTEM_SWITCHSTART/EVENT_SYSTEM_SWITCHEND events tell you when the Alt+Tab window appears and disappears.

这篇关于Alt Tab 覆盖 Win32 标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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