最大化系统托盘中的应用程序?
我编写了一个小 WPF 应用程序,当“关闭”时最小化到系统托盘(客户要求)。双击可将其弹出,或者右键单击可提供上下文菜单以退出。
但是,如果应用程序最小化,并且用户导航到“开始”->“所有程序”->“应用程序”,它将启动一个新实例。
如果用户这样做而不是启动新实例,我需要做什么(在 C# 中)才能让应用程序最大化正在运行的实例?
谢谢!
I wrote a little WPF app that when 'closed' minimizes to the system tray (customer requirement). Double clicking pops it back up, or right click gives a context menu to exit.
But if the app is minimized, and the users navigate to Start->All Programs->The Application it starts a new instance.
What (in C#) do I need to do to get the app to maximize the running instance if the user does this rather than fire up a new instance?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Jon Skeet 的答案讨论了使用互斥锁来做到这一点
马修·布林德利 (Matthew Brindley) 在 的同一问题中给出了这个示例他的回答
要最大化其他应用程序,您需要向其发送最大化消息。请参阅这篇关于消息发送的文章
This answer from Jon Skeet discusses using a mutex to do it
Matthew Brindley gives this example in the same question for his answer
To maximize the other application you'll need to send it the message to maximize. See this article on message sending