C# SendKeys.SendWait to a dialog of another Process (notepad.exe)

北慕城南 提交于 2019-12-06 04:57:56

You can't give what you don't have - SetForegroundWindow() only works if your application currently has the focus.

Modern Windows versions prevent applications from stealing focus, as that was a major annoyance back in the Windows 9x days.

Also, 'Alt+F, x' only refers to exit on English Windows versions, it won't work on most other languages. Avoid using SendKeys(), it's impossible to use in a reliable way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!