HWND hWindowHandle = FindWindow(NULL, L"Untitled - Блокнот");
HWND EditClass = FindWindowEx(hWindowHandle, NULL, L"Edit", NULL);
PostMessage(EditClass, WM_KEYDOWN, 0x5A, 0x002C0001);
PostMessage(EditClass, WM_CHAR, 0x7A, 0x002C0001);
PostMessage(EditClass, WM_KEYUP, 0x5A, 0xC02C0001);
I used the code above on Windows 10 64-bit and everything worked. But on Windows 7 64-bit Ultimate, it doesn't work. It doesn't send a message to Notepad, although if I compare messages in Spy++ when I click and what I send, they are the same. But when I try to send a message, it is not even visible in Spy++.