HWND chromeWnd = :: FindWindow ( L "Chrome_WidgetWin_1" , NULL ); if ( NULL != chromeWnd ) { :: SetForegroundWindow ( chromeWnd ); keybd_event ( VK_RSHIFT , 0 , 0 , 0 ); //按下Shift键 keybd_event ( VK_RCONTROL , 0 , 0 , 0 ); //按下Cont
HWND chromeWnd = ::FindWindow(L"Chrome_WidgetWin_1", NULL);
if (NULL != chromeWnd)
{
::SetForegroundWindow(chromeWnd);
keybd_event(VK_RSHIFT, 0, 0, 0);//按下Shift键
keybd_event(VK_RCONTROL, 0, 0, 0);//按下Control键
keybd_event(VK_TAB, 0, 0, 0);//按下Tab键
keybd_event(VK_RSHIFT, 0, KEYEVENTF_KEYUP, 0);//松开Shift键
keybd_event(VK_RCONTROL, 0, KEYEVENTF_KEYUP, 0);//松开Control键
keybd_event(VK_TAB, 0, KEYEVENTF_KEYUP, 0);//松开Tab键
keybd_event(VK_RCONTROL, 0, 0, 0);//按下Control键
keybd_event(0x57, 0, 0, 0);//按下W键
keybd_event(VK_RCONTROL, 0, KEYEVENTF_KEYUP, 0);//松开Shift键
keybd_event(0x57, 0, KEYEVENTF_KEYUP, 0);//松开W键
}