最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

winwrap - Shell command return wrong TaskID on Windows 11 - Stack Overflow

programmeradmin2浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论