在 CF 3.5 中从 VB.NET 调用外部 GPS 应用程序并返回到 VB.NET 应用程序
我正在 VB.NET 中编写一个应用程序,允许用户调用 Garmin Mobile XT 来获取路线。
我有一个表单在 Garmin 后面保持打开状态,并在退出 Garmin 后允许用户返回。
但有时,WM 操作系统会自动隐藏此表单。
有什么想法可以让表单保持原状 - 或者我可以检查启动我的应用程序以检查应用程序是否已经在运行并且表单隐藏,并使表单返回顶部?
我尝试将表单设置为 TopMost,但这意味着无法看到 GPS 应用程序,因为我的表单位于 GPS 应用程序的最上面。
我尝试捕获表单的关闭处理程序,但这不会触发 - 我猜是因为 WM 操作系统只是隐藏了表单而不是实际关闭它。
我尝试在表单 Deactivate handler 上进行捕获以防止焦点丢失,但这与 TopMost 属性的作用相同,并且我看不到 GPS 应用程序。
任何人都知道我可以从这里去哪里,因为我现在真的不知道!
谢谢, 亚当
I'm writing an app in VB.NET that allows the user to call Garmin Mobile XT to get a route.
I've got a form that stays open behind Garmin and upon quitting Garmin, allows the user to go back.
Sometimes, however, this form is automatically hidden by the WM OS.
Any ideas how I can either get the form to stay put - or can I put a check on launching my application to check if the app is already running and the form hidden, and make the form come back to the top?
I've tried setting the form to be TopMost but this then means that the GPS app can't be seen as my form is topmost over the GPS app.
I've tried catching the closing handler for the form but this doesn't fire - I'd guess because WM OS is simply hiding the form and not actually closing it.
I tried a catch on the form Deactivate handler to prevent focus being lost but this then does the same as the TopMost property and I can't see the GPS app.
Anyone any ideas on where I can go from here as I really don't have a clue now!
Thanks,
Adam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信这必须像在“常规”VB /VBA 中一样通过操作系统 API 来完成。
为自己获取一个 winAPI 帮助文件:-)。
现在我建议您的应用程序迭代所有窗口,找到您的 GPS 应用程序,使用:
然后您可以更改其 Z 顺序(将其放置在其他特定窗口的上方或下方):
,或者只是要求使用以下命令恢复它(这应该自动将其恢复到最高 Z 顺序):
I believe this has to be done as in "regular" VB /VBA, through the OS API.
Get yourself a winAPI help file :-).
Now I suggest your app iterates all windows, find your GPS app, using:
and then you can either change its Z-order (place it above or below some other specific windown):
, or just ask to restore it (which should automatically bring it to highest Z-order) using: