AutoHotkey_L-Docs icon indicating copy to clipboard operation
AutoHotkey_L-Docs copied to clipboard

ControlSend[Raw], example 1 not working on latest Windows 11 build

Open Animan8000 opened this issue 2 years ago • 1 comments

WinWait, ahk_pid %PID%  ; Wait for it to appear.
; Send the text to the inactive Notepad edit control.
; The third parameter is omitted so the last found window is used.
ControlSend, Edit1, This is a line of text in the notepad window.{Enter}
ControlSendRaw, Edit1, Notice that {Enter} is not sent as an Enter keystroke with ControlSendRaw.

MsgBox, Press OK to activate the window to see the result.
WinActivate, ahk_pid %PID%  ; Show the result.

Doesn't work. It won't open notepad it seems. This has surely something to do because notepad was changed in the latest Windows 11 build.

Animan8000 avatar Mar 02 '22 17:03 Animan8000

Yes, the Notepad we knew is no more, and something completely new by the same name has taken its place. It is a UWP app, not pure Win32, and does not use an Edit control.

I ran the example a few times and at first Notepad started just fine, but after a few tries it began to either not open, or to appear on the taskbar and then disappear. Actually, it's crashing with exception code 0xc000027b whenever I try to launch it minimized.

Notepad has served as a good target in code examples because it was ubiquitous and virtually unchanging...

Lexikos avatar May 02 '22 08:05 Lexikos

This issue has been fixed via b43bfd41dd1027cb954eae9239243337850b440b and can be closed.

Ragnar-F avatar Oct 10 '22 08:10 Ragnar-F