I would use my function like this:
or in the case of Notepad:
Code: Select all
ControlGet, hCtl, Hwnd,, Edit1, ahk_class Notepad
JEE_SendChars("hello world", hCtl)
When you use:
% "ahk_id " hWnd
hWnd can be a control or a window.
Btw, yes, the code where you modified my SendChars function, would work if the hWnd specified was that of Notepad's window.
==================================================
Example of SendInput and OnMessage scripts:
Code: Select all
;==================================================
;SCRIPT 1
q::
SendInput ^+{Left}
return
;==================================================
;SCRIPT 2
OnMessage(0x100, "KeyPress")
OnMessage(0x101, "KeyPress")
Gui, Add, Edit
Gui, Show
return
KeyPress(wParam, lParam, uMsg, hWnd)
{
uMsg := Format("0x{:X}", uMsg)
wParam := Format("0x{:X}", wParam)
lParam := Format("0x{:08X}", lParam)
Clipboard .= "`r`n" uMsg ", " wParam ", " lParam
}
;==================================================
[EDIT:] Best of luck. My original script in the link, worked for sending ctrl+shift+left and ctrl+left, but I've not been able to get ctrl+c and ctrl+v to work.