阻止用户打开第二个应用程序。 [英] Prevent user from opening up a second app.

查看:96
本文介绍了阻止用户打开第二个应用程序。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我有一个应用程序,当x出来时,只是关闭窗口但仍然在运行并且可以通过托盘访问(直到用户从那里退出)。如果程序完全关闭,单击.exe文件会导致它打开 - 正如它应该的那样。但是,
如果文件已在运行且用户点击.exe文件,它会打开应用程序的另一个实例,而不是只弹出当前正在运行的应用程序的窗口。

Basically I have an app that, when x'd out of, simply closes the window but remains running and is accessible by the tray (until the user exits from there). If the program is fully closed, clicking on the .exe file causes it to open up--as it should. However, if the file is already running and the user clicks on the .exe file, it opens another instance of the app instead of simply having the window of the current running app pop up.

我有办法解决这个问题吗?即。

Is there a way I can fix this? I.e.

if(app-is-closed){

if (app-is-closed) {

    open-app;

    open-app;

}其他{

   提起当前窗口;

    bring-up-current-window;

}

推荐答案

当然。 在互联网上搜索如何创建单件(或单个实例)应用程序。


Sure.  Search the internet for how to create a singleton (or single instance) application.


这篇关于阻止用户打开第二个应用程序。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆