WM_KEYUP in PostMessage and SendMessage doesn't work
I tried change ASCII code from 0x57 to 0x005701, because my friend says it should work, but it doesn't.
#include <iostream>
#include <windows.h>
using namespace std;
int KEY_DOWN = 0x57;
int main()
{
HWND hwnd;
if (!(hwnd = FindWindow(L"AAAA", NULL))) {
cout << "Couldn't find window";
}
else {
Sleep(5000);
PostMessage(hwnd, WM_SETFOCUS, NULL, NULL);
PostMessage(hwnd, WM_KEYDOWN, KEY_DOWN, NULL);
}
}
I want to make application that will send WM_KEYDOWN, and WM_KEYUP to application with PostMessage or SendMessage but WM_KEYUP doesn't work