Alt Tab overlay Win32 identificator

时光毁灭记忆、已成空白 提交于 2019-12-10 14:08:18

问题


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.

Basically, what am I doing is this :

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);
    } 
}

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

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 ?


回答1:


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



来源:https://stackoverflow.com/questions/12862213/alt-tab-overlay-win32-identificator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!