?? project1.~dpr
字號:
program Project1;
uses
Forms,
windows,
messages,
SysUtils,
Dialogs,
Unit1 in 'Unit1.pas' {Form1},
Save2 in 'Save2.pas' {Form3},
Splash in 'Splash.pas' {Form2};
{$R *.res}
const
CM_RESTORE =WM_USER + $1000; {自定義的“恢復”消息}
MYAPPNAME ='VLAN錄音記錄監督臺';
type
TDLLRegisterServer=Function:HRESULT;STDCALL;
var
RvHandle : hWnd;
//ATOM:TAtom;
OCXHand:THandle;
RegFunc:TDLLRegisterServer;{Use Activex Or OleCtl}
begin
RvHandle := FindWindow(MYAPPNAME, NIL);
if RvHandle > 0 then
begin
// Atom:=(GlobalAddAtom(pchar(ParamStr(1))));
SendMessage(RvHandle,CM_RESTORE,0,0);
// GlobalDeleteAtom(Atom);
SetForegroundWindow(RvHandle);
exit;
end
else
begin
//ShellExecuteA(application.Handle ,'open','Regsvr32.EXE',Pchar(ExtractFilePath(Application.ExeName)+'PlayClient.ocx /s'),nil,SW_SHOW);
//sleep(400);
///ocx register
try
if Not FileExists(Pchar((ExtractFilePath(Application.ExeName)+'PlayClient.ocx'))) then
begin
showmessage('程序無法運行, 請將PlayClient.ocx復制到'+Pchar(ExtractFilePath(Application.ExeName))+'目錄下');
exit;
end;
OcxHand:=LoadLibrary(Pchar((ExtractFilePath(Application.ExeName)+'PlayClient.ocx')));
RegFunc:=GetProcAddress(OcxHand,'DllRegisterServer');
if RegFunc<>0 then
// showmessage('error');
//Application.MessageBox (Pchar('注冊ocx失敗,請手工注冊ocx.命令行如下:開始菜單---運行,輸入regsvr32 '+(ExtractFilePath(Application.ExeName)+'PlayClient.ocx')),'提示',MB_OK);
// Form3:=TForm3.Create(Application);;
// Form3.Show;
Finally
FreeLibrary(ocxhand);
end;
///
Application.Initialize;
//Form2:=TForm2.Create(Application);;
//Form2.Show;
//Form2.Update;
// Application.Title := MYAPPNAME;
Application.Title := 'VLAN錄音記錄監督臺';
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.Run;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -