I have two problem with this code:
1 / Apparently the # WM_KEYUP double the character, is this normal?
2 / I can not write the numbers 1 and 2, they are replaced by the symbol that is on the same key.
I'm sending the SHIFT key, it still does not work
Could you help me?
Code: Select all
RunProgram("notepad.exe")
Delay(1000)
hwnd = FindWindow_(0,"Sans titre - Bloc-notes")
If hwnd
Hwndedit = FindWindowEx_(hwnd, 0, "edit", 0)
a$ = "Hello 1"+ #CR$ + "Hello 2"
For i = 1 To Len(a$)
vk$ = Mid(a$, i, 1)
vk = VkKeyScanEx_(Asc(vk$),GetKeyboardLayout_(0)) ; Normal key found
PostMessage_(Hwndedit, #WM_KEYDOWN, #VK_SHIFT, 0);
Delay(10)
PostMessage_(Hwndedit, #WM_KEYDOWN, vk, 0);
Delay(10)
PostMessage_(Hwndedit, #WM_KEYUP, vk, 0)
Delay(10)
PostMessage_(Hwndedit, #WM_KEYUP, #VK_SHIFT, 0);
Delay(10)
Next
Else
MessageRequester("Error", "Not found NotePad")
EndIf