There is small mistake in the code hardware scan code is wrong it should be for alt 0X12 and for tab 0X09 i put delay just to see the output. :) keybd_event( VK_MENU ,0x12,KEYEVENTF_EXTENDEDKEY | 0, 0 ); Sleep(1); keybd_event( VK_TAB ,0x09,KEYEVENTF_EXTENDEDKEY | 0, 0 ); Sleep(1000); keybd_event( VK_TAB ,0x12,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0); keybd_event( VK_MENU ,0x09,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);