umain.pas
来自「很好的汽车管理系统 很实用的 谢谢合作」· PAS 代码 · 共 938 行 · 第 1/2 页
PAS
938 行
var
OFile:String;
HWndCalculator:HWnd;
begin
HWndCalculator:=FindWindow(nil,'计算器');
if (HWndCalculator=0) then
begin
OFile:='calc.exe';
Shellexecute(handle,'Open',pchar(OFile),nil,pchar(ExtractFilePath(OFile)),SW_SHOWNORMAL);
end;
end;
procedure TMain.N9Click(Sender: TObject);
var
OFile:String;
HWndCalculator:HWnd;
begin
HWndCalculator:=FindWindow(nil,'记事本');
if (HWndCalculator=0) then
begin
OFile:='NOTEPAD.EXE';
Shellexecute(handle,'Open',pchar(OFile),nil,pchar(ExtractFilePath(OFile)),SW_SHOWNORMAL);
end;
end;
procedure TMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if MessageBox(0,'是否要退出本系统?','提示信息',MB_YESNO+MB_ICONQUESTION)=IDYES then
begin
Application.Terminate;
end
else
begin
Action := caNone;
end;
end;
procedure TMain.N36Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(TBXXX,BXXX);
BXXX.Left:=0;
BXXX.Width:=796;
BXXX.Top:=0;
BXXX.Height:=568;
ActionCD:='M';
BXXX.ShowModal;
BXXX.Free;
end;
if (Screen.Width=1024) and ( Screen.Height=768) then
begin
Application.CreateForm(TBXXX,BXXX);
BXXX.Width:=796;
BXXX.Height:=568;
BXXX.Position:=poDesktopCenter;
ActionCD:='M';
BXXX.ShowModal;
BXXX.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.N35Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(TWZDJ,WZDJ);
WZDJ.Left:=0;
WZDJ.Width:=796;
WZDJ.Top:=0;
WZDJ.Height:=568;
ActionCD:='M';
WZDJ.ShowModal;
WZDJ.Free;
end;
if (Screen.Width=1024) and (Screen.Height=768) then
begin
Application.CreateForm(TWZDJ,WZDJ);
WZDJ.Width:=796;
WZDJ.Height:=568;
WZDJ.Position:=poDesktopCenter;
ActionCD:='M';
WZDJ.ShowModal;
WZDJ.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.N37Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(TWZDJCX,WZDJCX);
WZDJCX.Left:=0;
WZDJCX.Width:=796;
WZDJCX.Top:=0;
WZDJCX.Height:=568;
WZDJCX.ShowModal;
WZDJCX.Free;
end;
if (Screen.Width=1024) and (Screen.Height=768) then
begin
Application.CreateForm(TWZDJCX,WZDJCX);
WZDJCX.Width:=796;
WZDJCX.Height:=568;
WZDJCX.Position:=poDesktopCenter;
WZDJCX.ShowModal;
WZDJCX.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.FormShow(Sender: TObject);
begin
label6.Caption:='操 作 员: ' + Auser.UserName;
Label7.Caption:='系统时间: '+DateTimeToStr(now);
end;
procedure TMain.Timer1Timer(Sender: TObject);
begin
Label7.Caption:='系统时间: '+DateTimeToStr(now)+'''';
end;
procedure TMain.N38Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(TXPCXX_Z,XPCXX_Z);
XPCXX_Z.Left:=0;
XPCXX_Z.Width:=796;
XPCXX_Z.Top:=0;
XPCXX_Z.Height:=568;
ActionCD:='M';
XPCXX_Z.ShowModal;
XPCXX_Z.Free;
end;
if (Screen.Width=1024) and ( Screen.Height=768) then
begin
Application.CreateForm(TXPCXX_Z,XPCXX_Z);
XPCXX_Z.Width:=796;
XPCXX_Z.Height:=568;
XPCXX_Z.Position:=poDesktopCenter;
ActionCD:='M';
XPCXX_Z.ShowModal;
XPCXX_Z.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.N39Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(TWXXX,WXXX);
WXXX.Left:=0;
WXXX.Width:=796;
WXXX.Top:=0;
WXXX.Height:=568;
ActionCD:='M';
WXXX.ShowModal;
WXXX.Free;
end;
if (Screen.Width=1024) and (Screen.Height=768) then
begin
Application.CreateForm(TWXXX,WXXX);
WXXX.Width:=796;
WXXX.Height:=568;
WXXX.Position:=poDesktopCenter;
ActionCD:='M';
WXXX.ShowModal;
WXXX.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.N6Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(TJYZXX_Z,JYZXX_Z);
JYZXX_Z.Left:=0;
JYZXX_Z.Width:=796;
JYZXX_Z.Top:=0;
JYZXX_Z.Height:=568;
ActionCD:='M';
JYZXX_Z.ShowModal;
JYZXX_Z.Free;
end;
if (Screen.Width=1024) and (Screen.Height=768) then
begin
Application.CreateForm(TJYZXX_Z,JYZXX_Z);
JYZXX_Z.Width:=796;
JYZXX_Z.Height:=568;
JYZXX_Z.Position:=poDesktopCenter;
ActionCD:='M';
JYZXX_Z.ShowModal;
JYZXX_Z.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.N19Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(TJYXX,JYXX);
JYXX.Left:=0;
JYXX.Width:=796;
JYXX.Top:=0;
JYXX.Height:=568;
ActionCD:='M';
JYXX.ShowModal;
JYXX.Free;
end;
if (Screen.Width=1024) and (Screen.Height=768) then
begin
Application.CreateForm(TJYXX,JYXX);
JYXX.Width:=796;
JYXX.Height:=568;
JYXX.Position:=poDesktopCenter;
ActionCD:='M';
JYXX.ShowModal;
JYXX.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.N40Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(TQTFY_Z,QTFY_Z);
QTFY_Z.Left:=0;
QTFY_Z.Width:=796;
QTFY_Z.Top:=0;
QTFY_Z.Height:=568;
ActionCD:='M';
QTFY_Z.ShowModal;
QTFY_Z.Free;
end;
if (Screen.Width=1024) and (Screen.Height=768) then
begin
Application.CreateForm(TQTFY_Z,QTFY_Z);
QTFY_Z.Width:=796;
QTFY_Z.Height:=568;
QTFY_Z.Position:=poDesktopCenter;
ActionCD:='M';
QTFY_Z.ShowModal;
QTFY_Z.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.N41Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(TJYJLCX,JYJLCX);
JYJLCX.Left:=0;
JYJLCX.Width:=796;
JYJLCX.Top:=0;
JYJLCX.Height:=568;
JYJLCX.ShowModal;
JYJLCX.Free;
end;
if (Screen.Width=1024) and (Screen.Height=768) then
begin
Application.CreateForm(TJYJLCX,JYJLCX);
JYJLCX.Width:=796;
JYJLCX.Height:=568;
JYJLCX.Position:=poDesktopCenter;
JYJLCX.ShowModal;
JYJLCX.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.N46Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(THYXX,HYXX);
HYXX.Left:=0;
HYXX.Width:=796;
HYXX.Top:=0;
HYXX.Height:=568;
ActionCD:='M';
HYXX.ShowModal;
HYXX.Free;
end;
if (Screen.Width=1024) and (Screen.Height=768) then
begin
Application.CreateForm(THYXX,HYXX);
HYXX.Width:=796;
HYXX.Height:=568;
HYXX.Position:=poDesktopCenter;
ActionCD:='M';
HYXX.ShowModal;
HYXX.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.N45Click(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Application.CreateForm(THYXXCX,HYXXCX);
HYXXCX.Left:=0;
HYXXCX.Width:=796;
HYXXCX.Top:=0;
HYXXCX.Height:=568;
HYXXCX.ShowModal;
HYXXCX.Free;
end;
if (Screen.Width=1024) and (Screen.Height=768) then
begin
Application.CreateForm(THYXXCX,HYXXCX);
HYXXCX.Width:=796;
HYXXCX.Height:=568;
HYXXCX.Position:=poDesktopCenter;
HYXXCX.ShowModal;
HYXXCX.Free;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600','提示!',0+64);
exit;
end;
end;
procedure TMain.Timer2Timer(Sender: TObject);
begin
if label1.left>-label1.Width then
label1.left:=label1.left-1
else
label1.left:=self.Width;
end;
procedure TMain.SpeedButton8Click(Sender: TObject);
begin
N35.Click;
end;
procedure TMain.N10Click(Sender: TObject);
var
stable:TStringList;
i:integer;
begin
if application.messagebox(pchar('系统初始化将清空所有数据,是否要开始?'),
pchar('警告'),64+MB_YESNO)<>IDYES then
begin
exit;
end;
stable:=TStringlist.create;
stable.Add('BXLXSZ');
stable.Add('CLXX');
stable.Add('KHXX');
stable.Add('BXXX');
stable.Add('JSYXX');
stable.Add('XPCXX');
stable.Add('JYZXX');
stable.Add('ZLDJ');
stable.Add('ZLJS');
stable.Add('JYXX');
stable.Add('WZDJ');
stable.Add('WXXX');
stable.Add('HYXX');
stable.Add('QTFY');
stable.Add('userpower');
stable.Add('userlogin');
for i:=0 to stable.count-1 do
begin
dm.csh.SQL.clear;
dm.csh.SQL.Add('delete from '+stable.Strings[i]);
dm.csh.ExecSQL;
end;
dm.csh.SQL.Clear;
dm.csh.sql.add('insert into userpower(UserNo,UserName,pas,n1,n2,n5,n11) values(''1001'',''mingrisoft'',''mingrisoft'',''1'',''1'',''1'',''1'')');
dm.csh.ExecSQL;
dm.ADOConn.Close;
dm.ADOConn.Open;
application.MessageBox('系统初始化成功!','提示',0);
exit;
stable.free;
end;
procedure TMain.N34Click(Sender: TObject);
begin
Application.CreateForm(TBXLXSZ,BXLXSZ);
Actioncd:='M';
BXLXSZ.ShowModal;
BXLXSZ.Free;
end;
procedure TMain.N43Click(Sender: TObject);
begin
Application.CreateForm(TSJHF,SJHF);
SJHF.ShowModal;
SJHF.Free;
end;
procedure TMain.FormCreate(Sender: TObject);
begin
try
if (Screen.Width=800) and (Screen.Height=600) then
begin
Main.Left:=0;
Main.Width:=796;
Main.Top:=0;
Main.Height:=568;
end;
if (Screen.Width=1024) and ( Screen.Height=768) then
begin
Main.Width:=796;
Main.Height:=568;
Main.Position:=poDesktopCenter;
end;
except
Application.MessageBox('请正确选择屏幕分辨率:1024X768 或 800X600 !','提示!',0+64);
exit;
end;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?