你用这种方法呢
program test;uses
Forms,Windows,SysUtils;
{$R *.RES}Var
hMutex:HWND;
Ret:Integer;
begin
Application.Initialize;
Application.Title := 'test';
hMutex:=CreateMutex(nil,False,'test');
Ret:=GetLastError;
If Ret<>ERROR_ALREADY_EXISTS Then
Begin
Application.CreateForm(TForm1, Form1);
Application.Run;
End
Else
Application.MessageBox('已经运行!','警告!',MB_OK);
ReleaseMutex(hMutex);
end.
program test;uses
Forms,Windows,SysUtils;
{$R *.RES}Var
hMutex:HWND;
Ret:Integer;
begin
Application.Initialize;
Application.Title := 'test';
hMutex:=CreateMutex(nil,False,'test');
Ret:=GetLastError;
If Ret<>ERROR_ALREADY_EXISTS Then
Begin
Application.CreateForm(TForm1, Form1);
Application.Run;
End
Else
Application.MessageBox('已经运行!','警告!',MB_OK);
ReleaseMutex(hMutex);
end.
解决方案 »
- 怎么给fastreport4里的名称为Memo1的控件赋值??
- 在frreport中,怎样才能同时显示三个表的数据
- 视频会议系统全国统一最低价4000元/套
- 关于Combobox的问题!
- 如何把当前时间 赋值到 某个表的时间字段中?
- 这个结构在DELPHI中要怎么定义
- 请教:什么报表控件在不安装EXCEL软件的情况下将表格中数据以EXCEL格式倒出?
- 关于数组的问题
- rave report 的问题
- 请教DELPHI中的打印机设置问题,各位师兄请进来看一下!
- 三层式中显性的开始一个事务?
- 我用ole链接word文件,为何只显示文件的第一页,其它页不显示,怎样解决,若在OLE中无法解决,还有何方法可以读取word文件?
if not assigned(someform) then begin
application.createform.(Tsomeform,someform);
try
someform.showmodal;
finally
domeform.free;
someform:=nil;
end;
end
else
someform.showmodal;
end;
[email protected]
begin
halt; {退出程序}
end;
'TMainForm' 是主 Form
我很急啊,真的没人能解决吗?