debugmsg.dpr

来自「我自己用的Delphi函数单元 具体说明见打包文件的HELP目录下面」· DPR 代码 · 共 39 行

DPR
39
字号
program DebugMsg;

uses
  Windows,
  Forms,
  Terminal in 'Terminal.pas' {DebugMsgForm},
  about in 'about.pas' {AboutForm},
  constant in 'constant.pas',
  Detail in 'Detail.pas' {DetailForm};

var
    hMutex:THandle;
    UniqueKey: String ='DEBUG MESSAGE TERMINAL 1.0';

{$R *.RES}

begin
    MessageId := RegisterWindowMessage(PChar(UniqueKey));
    hMutex:=CreateMutex( nil,TRUE, PChar(UniqueKey));
    if (hMutex<>0) and (GetLastError=ERROR_ALREADY_EXISTS) then
    begin
        CloseHandle(hMutex);
        hMutex:=0;
        SendMessage(HWND_BROADCAST,MessageId,Application.Handle,0);
    end
    else
    begin
        Application.Initialize;
        Application.Title := '调试终端';
        Application.ShowMainForm:=False;
        Application.CreateForm(TDebugMsgForm, DebugMsgForm);
  Application.CreateForm(TAboutForm, AboutForm);
  Application.CreateForm(TDetailForm, DetailForm);
  Application.Run;
    end;
    if hMutex<>0 then CloseHandle(hMutex);
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?