模拟Win7的组合键【Win+P】(切换显示器屏幕)

// 按下【LWIN】键
keybd_event( VK_LWIN, 0x00, KEYEVENTF_EXTENDEDKEY | 0, 0 );

//按下【P】键,扫描码0x50
keybd_event( 0x50, 0x00, KEYEVENTF_EXTENDEDKEY | 0, 0 );

//抬起【P】键,扫描码0x50
keybd_event( 0x50, 0x00, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);

//抬起【LWIN】
keybd_event( VK_LWIN, 0x00, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);

你可能感兴趣的:(模拟Win7的组合键【Win+P】(切换显示器屏幕))