I'm trying to implement a simulation of pressing a key (backspace) using Virtual-Key Codes. Running the code while a text file is open works as expected (deletes the text), but running it while Win 8 photo App is open does not do anything (I would expect it to go up one level to the upper photo album for example).
Does anyone have an idea why? What do I need to do in order to simulate a backspace key press in Win8 photo App?
My code:
INPUT input;
input.type = INPUT_KEYBOARD;
input.ki.wScan = 0;
input.ki.dwFlags = 0;
input.ki.time = 0;
input.ki.dwExtraInfo = NULL;
input.ki.wVk = VK_BACK;
SendInput(1, &(input), sizeof(INPUT));
input.type = INPUT_KEYBOARD;
input.ki.wScan = 0;
input.ki.dwFlags = KEYEVENTF_KEYUP;
input.ki.time = 0;
input.ki.dwExtraInfo = NULL;
input.ki.wVk = VK_BACK;
SendInput(1, &(input), sizeof(INPUT));