我有一个 app 安装在远程机子上, 如果直接用 Remote Desktop 连接机子, 再运行 app, 一切正常.
但是如果通过配置 .rdp 文件来连接运行这个 app, 表面看起来一切正常, 但是想要打开一个特定页面时, 会有报错:
这个页面是用 wpf 写的
Error Details:
Main Exception:
An error occured in the following.
Type: System.ComponentModel.Win32Exception
Source: WindowsBase
Message: Source: Access is denied
Stack Trace: at MS.Win32.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
at System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.CreateSourceWindowDuringShow()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at System.Windows.Window.ShowDialog()
at SI.KillLine.VB6_Interface.KillLineComponents.Pricing_Display(Int32 ownerHandle, String siteCode, String abbatoir, DateTime killDate, String species, String lot, String lps3ConnectionString, String controlFormatConnectionString, String username, String password, Int32 WindowToShow)
Target Site: IntPtr CreateWindowEx(Int32, System.String, System.String, Int32, Int32, Int32, Int32, Int32, System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, System.Object)
研究了很久, 不知道这个问题怎么出现的.
2023/7/17
在新窗口被定义为老窗口的字窗口, 操作逻辑是: 老窗口创建的之后, 获取窗口句柄, 创建新窗口的时候, 将老窗口句柄传递给新窗口. 但是不知道什么情况, 这样会有问题.
解决办法: 创建新窗口的时候获取老窗口句柄, 将该句柄给新窗口, 问题消失.
是不是没有下载megowseos
wpf写的应该是Windows软件,不是app 手机软件对吧,目前看你的提示是权限不够
你网上换个remote版本试试
wpf创建窗口时遇到了权限或者资源的限制,导致调用CreateWindowEx函数失败
不知道你这个问题是否已经解决, 如果还没有解决的话:1、开始菜单中,选择“运行”(Win+R),输入“secpol.msc”启用“本地安全设置”;
2、选择“安全设置”;选择“本地策略”;在“安全选项”的右窗口中,找到“账户:使用空白密码的本地账户只允许进行控制台登录”,双击
选择“已禁用”;
3、选择“已禁用”点击确定即可。
Royal TSX常见问题:解决远程桌面(RDP)连接错误
可以参考下
你遇到的问题可能是由于远程桌面连接的方式导致的。当通过 Remote Desktop 直接连接到远程计算机时,所有的窗口和句柄都是本地计算机的,因此你的应用程序可以正常工作。但是,当通过 .rdp 文件连接时,所有的计算都在远程计算机上执行,而你的本地计算机只提供了图形界面。
可能是权限问题导致的
重新启动应用程序
更新应用程序
检查 .rdp 文件