#include <iostream>
#include <stdlib.h>
#include "myhead1.h"
#include <windows.h>
int main(){
HANDLE mutex=CreateMutex(NULL,TRUE,"一个全局独有的字符串");
if(mutex && ERROR_ALREADY_EXISTS==GetLastError()){
printf("客户端已经运行 \n");
}else{
printf("客户端第一次运行\n");
}
system("pause");
return 0;
}
C++:通过windows函数CreateMutex来禁止双开功能
猜你喜欢
转载自blog.csdn.net/u011624903/article/details/104808673
今日推荐
周排行