admin管理员组

文章数量:1392002

Using WinWrap, trying to open Notepad and paste the Clipboard text inside. I mean, it works on Windows 10 but on Windows 11 it seems like the TaskID returned from Shell command is wrong, so the AppActivate(TaskID) fails.

Notepad opens and I can see the text pasted, but I'm inside an "On Error" statement, so an error message appears to the user. The error description is "Impossible to find the window".

This is the part of the code:

                    Clipboard Msg & vbCrLf
                    TaskID = Shell("Notepad",vbNormalFocus )
                    Debug.Print(TaskID)
                    AppActivate(TaskID)
                    SendKeys("^V"),1    'Control-V

If I take a look to the debug, I can see that the TaskID is different from the notepad PID on the task manager.

Any suggestion?

本文标签: winwrapShell command return wrong TaskID on Windows 11Stack Overflow