Closed mofashaonvyiliya closed 2 years ago
有关调用实时(JIT)调试而不是此对话框的详细信息, 请参见此消息的结尾。
** 异常文本 **
System.InvalidOperationException: Some simulated input commands were not sent successfully. The most common reason for this happening are the security features of Windows including User Interface Privacy Isolation (UIPI). Your application can only send commands to applications of the same or lower elevation. Similarly certain commands are restricted to Accessibility/UIAutomation applications. Refer to the project home page and the code samples for more information.
在 WindowsInput.WindowsInputMessageDispatcher.DispatchInput(INPUT[] inputs)
在 WindowsInput.KeyboardSimulator.ModifiedKeyStroke(IEnumerable1 modifierKeyCodes, IEnumerable
1 keyCodes)
在 WindowsInput.KeyboardSimulator.ModifiedKeyStroke(VirtualKeyCode modifierKeyCode, VirtualKeyCode keyCode)
在 CopyPaste.Form1.timer1_Tick(Object sender, EventArgs e) 位置 C:\Users\Administrator\source\repos\CopyPaste\CopyPaste\Form1.cs:行号 33
在 System.Windows.Forms.Timer.OnTick(EventArgs e)
在 System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
** JIT 调试 ** 要启用实时(JIT)调试, 该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置 jitDebugging 值。 编译应用程序时还必须启用 调试。
例如:
启用 JIT 调试后,任何未经处理的异常 都将被发送到在此计算机上注册的 JIT 调试程序, 而不是由此对话框处理。
Hello. Thank you for message. Please think of the library as a high-level wrapper over Win32 calls. In this case, over the call to SendInput. Unfortunately, this is a limitation of the API itself, according to this documentation: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput#remarks https://en.wikipedia.org/wiki/User_Interface_Privilege_Isolation
The easiest way to get around this is to run your application as an administrator.
Hello, I used the project's latest Nuget package, and remind the user to use administrator privileges to open the program, but still reported this error what is the reason ah, the following is the log content
2024-07-04 14:53:50.871 [INF] STranslate_1.1.5.703[Administrator] Opened...
2024-07-04 14:54:04.881 [WRN] Replace Execute Error: Some simulated input commands were not sent successfully. The most common reason for this happening are the security features of Windows including User Interface Privacy Isolation (UIPI). Your application can only send commands to applications of the same or lower elevation. Similarly certain commands are restricted to Accessibility/UIAutomation applications. Refer to the project home page and the code samples for more information.
2024-07-04 14:54:04.882 [ERR] UI线程异常
System.InvalidOperationException: Some simulated input commands were not sent successfully. The most common reason for this happening are the security features of Windows including User Interface Privacy Isolation (UIPI). Your application can only send commands to applications of the same or lower elevation. Similarly certain commands are restricted to Accessibility/UIAutomation applications. Refer to the project home page and the code samples for more information.
at WindowsInput.WindowsInputMessageDispatcher.DispatchInput(INPUT[] inputs) in /_/src/libs/H.InputSimulator/WindowsInputMessageDispatcher.cs:line 37
at WindowsInput.KeyboardSimulator.TextEntry(String text) in /_/src/libs/H.InputSimulator/KeyboardSimulator.cs:line 307
at STranslate.Helper.InputSimulatorHelper.PrintText(String content)
at STranslate.ViewModels.Preference.ReplaceViewModel.FailAsync(CancellationToken cancellationToken)
at STranslate.ViewModels.Preference.ReplaceViewModel.ExecuteAsync(String content, CancellationToken token)
at STranslate.ViewModels.NotifyIconViewModel.ReplaceTranslateAsync(Window view)
at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask)
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
I found that 360 security software was installed on the user's computer, and the analog keyboard input was intercepted by 360.
Describe the bug
System. InvalidOperationException: Some simulated input commands were not sent successfully. The most common reason for this happening are the security features of Windows including User Interface Privacy Isolation (UIPI). Your application can only send commands to applications of the same or lower elevation. Similarly certain commands are restricted to Accessibility/UIAutomation applications. Refer to the project home page and the code samples for more information.
Steps to reproduce the bug
C:\Users\Administrator\source\repos\CopyPaste\CopyPaste\bin\Debug Copy other path Open other path Show error log
Expected behavior
No response
Screenshots
No response
NuGet package version
No response
Platform
Windows Forms
IDE
Visual Studio 2019
Additional context
No response