locked
Can not simulate Win+D on Metro UI in Windows 8?

    Question

  • I want to switch Metro UI to desktop. Simulate Win+D can work on traditional desktop, but can not work on Metro UI. Code as below:

      keybd_event(VK_LWIN, MapVirtualKeyEx(VK_LWIN,0,GetKeyboardLayout(0)),  0, 0);
        Sleep(30);
        keybd_event(VK_D  ,MapVirtualKeyEx(VK_D,0,GetKeyboardLayout(0)) ,  0, 0);
        Sleep(30);

        keybd_event(VK_D , MapVirtualKeyEx(VK_D,0,GetKeyboardLayout(0)) ,   KEYEVENTF_KEYUP,0);
        Sleep(30);
        keybd_event(VK_LWIN, MapVirtualKeyEx(VK_LWIN,0,GetKeyboardLayout(0)), KEYEVENTF_KEYUP,0);

    Win+C can work well. Please tell me why it can not work well.

    • Moved by Jesse Jiang Friday, August 3, 2012 6:03 AM (From:Visual C++ MFC and ATL)
    Thursday, August 2, 2012 2:08 AM

Answers

All replies