⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 berlinpie.dpr

📁 Delphi实效编程百例的随书源代码 这是其中的操作系统部分
💻 DPR
字号:
PROGRAM BerlinPie;
{$D SCRNSAVE BerlinPie}

uses
  MMSystem,
  Classes,
  Controls,
  SysUtils,
  Windows,
  Messages,
  Graphics,
  Forms,
  UPie,
  Config in 'CONFIG.PAS' {DialogConfig},
  Globals in 'Globals.pas',
  UBerlinSCR in 'UBerlinSCR.pas' {FormSpecSCR};

{$R *.RES}
{$E SCR}		// Extension
{$R StrTable.RES}	// In dieser Datei steht der in der Systemsteuerung angezeigte Name
{$R Sounds.RES}		// die Kl鋘ge

VAR
  hSemaphore		: THandle;
  sstrArg1, sstrArg2	: SHORTString;
  hMod   		: THandle;
  strSysDir      	: String;
  iNewLen      		: Integer;
  functionPwd  		: function (a : PChar; ParentHandle : THandle; b, c : Integer): Integer; stdcall;
  hPrevWnd		: HWnd;
  aRect			: TRect;
  iScrWidth, iScrHeight : Integer;
  aCanvas    		: TCanvas;
  aRegEntries		: TBerlinUhrRegEntries;
  aSettings		: TBerlinUhrColors;
  aBerlinUhr		: TBerlinUhr;

(*++++++++++++++++++++++++++++++++++*)
BEGIN
hSemaphore := CreateSemaphore( nil, 0, 1, 'BerlinPieSCRSemaphore' );
IF ((hSemaphore <> 0) and (GetLastError = ERROR_ALREADY_EXISTS)) THEN
  BEGIN
  AppendText(' halted (ERROR_ALREADY_EXISTS)' );
  CloseHandle(hSemaphore);
  Halt;
  END;

sstrArg1 := UpperCase(ParamStr(1));
sstrArg2 := UpperCase(ParamStr(2));

IF (Copy(sstrArg1,1,2) = '/A') OR (Copy(sstrArg1,1,2) = '-A') OR
   (Copy(sstrArg1,1,1) = 'A') THEN
  aSSMode := ssSetPwd;

IF (Copy(sstrArg1,1,2) = '/P') OR (Copy(sstrArg1,1,2) = '-P') OR
   (Copy(sstrArg1,1,1) = 'P') THEN
  aSSMode := ssPreview;

IF (Copy(sstrArg1,1,2) = '/C') OR (Copy(sstrArg1,1,2) = '-C') OR
   (Copy(sstrArg1,1,1) = 'C') OR (sstrArg1 = '') THEN
  aSSMode := ssConfig;

IF aSSMode = ssSetPwd THEN
  BEGIN
  SetLength(strSysDir,MAX_PATH);
  iNewLen := GetSystemDirectory(PChar(strSysDir),MAX_PATH);
  SetLength( strSysDir, iNewLen);
  IF (Length( strSysDir ) > 0) and (strSysDir[Length(strSysDir)] <> '\') THEN
    strSysDir := strSysDir+'\';
  hMod := LoadLibrary(PChar(strSysDir+'MPR.DLL'));
  IF hMod <> 0 THEN
    BEGIN
    functionPwd := GetProcAddress( hMod,'PwdChangePasswordA');
    IF Assigned( functionPwd ) THEN
      functionPwd('SCRSAVE',StrToInt(sstrArg2),0,0);
    FreeLibrary(hMod);
    END;
  AppendText(' halted (ssSetPWD)' );
  Halt;
  END;

Application.Initialize;
Application.Title := 'BerlinPieSCR - 

⌨️ 快捷键说明

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