发布时间:2024-08-02 13:01
#include
#include
#include
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSharedMemory shared("A10032-GCD33259-129972"); //共享内存唯一标识
if( !shared.create( 512, QSharedMemory::ReadWrite) )
{
QMessageBox::critical(0, "错误", "检测到未完全退出的软件,启动失败!");
return 0;
}
Widget w;
w.show();
return a.exec();
}