program waterSave;
uses
Forms,
windows,
sysutils,
Controls,
Unitdata in 'Unitdata.pas' {DtModule: TDataModule},
login in 'login.pas' {LoginForm},
usermess in 'usermess.pas',
newidform in 'newidform.pas' {KHXXXGForm},
grouping in 'grouping.pas' {LLDFORM},
main in 'main.pas' {MainForm},
chgsave in 'chgsave.pas' {ChgSaveForm};
{$R *.RES}
var
tmpPassForm: TloginForm;
wnd:Hwnd;
begin
wnd:=Findwindow(nil,'用户存款处理中心');
application.Terminate;
if wnd=0 then
begin
Application.Initialize;
Application.Title := '用户存款处理中心';
Application.CreateForm(TDtModule, DtModule);
tmpPassForm := TloginForm.Create( Application);
if Assigned( tmpPassForm) then
begin
tmpPassForm.Caption:='用户存款处理中心';
tmpPassForm.ShowModal;
if tmpPassForm.ModalResult = mrOK then
begin
userid:=TmppassForm.UID;
username:=TmppassForm.UName;
Level2:=TmppassForm.Level2;
Level1:=TmppassForm.Level1;
Application.CreateForm(TMainForm, MainForm);
tmpPassForm.Free;
Application.Run;
end
else
tmpPassForm.Free;
end;
end
else
begin
setforegroundwindow(wnd);
showWindow(wnd,SW_SHOW);
Application.Terminate;
end;
end.
朋友你可以使用以上办法,保证没有问题,我可是要钱的