i have this code that simulates the pressing of the window key. But how would i make it to press window+d key, essentially showing desktop.
void ShowDesktop(void)
{
// Simulate a key press
keybd_event( VK_LWIN,
0x5B,
KEYEVENTF_EXTENDEDKEY | 0,
0 );
// Simulate a key release
keybd_event( VK_LWIN,
0x5B,
KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,
0);
}
you must call
keybd_eventfunction with the Virtual key value and the hardware scan code for the D key to get this value you can use theMapVirtualKeyfunction.try this sample.