qt 防止应用重复启动

QApplication a(argc, argv);
QSharedMemory singleton(a.applicationName());
if(!singleton.create(1))
{
QMessageBox::warning(NULL, "Waring", "Program already running!");
return false;
}
---------------------
作者:whatnamecaniuse
来源:CSDN
原文:https://blog.csdn.net/whatnamecaniuse/article/details/80563146
版权声明:本文为博主原创文章,转载请附上博文链接!

转载于:https://www.cnblogs.com/nanqiang/p/10974422.html

你可能感兴趣的:(qt 防止应用重复启动)