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

📄 skinunit.pas

📁 delphi皮肤控件,很好的.我正在使用当中
💻 PAS
字号:
{$DEFINE CRACK}
//{$IFDEF CRACK}
//{$UNDEF CRACK}
//{$ENDIF}

// 程序原代码和创意由网友 "CoolSlob" <coolslob@163.com> 提供,在此特别感谢
// the program code and idea had provide by  "CoolSlob" <coolslob@163.com>, so thanks a lot

unit SkinUnit;

interface
Uses Classes,SkinCaption;

  Procedure LoadFormRes(SkinName : ShortString);stdcall;
  Procedure SetSkinFile(Value : ShortString);stdcall;export;
  procedure InitSkin(FHandle : THandle);stdcall;export;
  procedure UnLoadAll;stdcall;export;
  procedure SetActive(Value : Boolean); Stdcall;export;
  procedure Add3rdControl(Value : ShortString); stdcall; export;

var
  FSkinCaption: TSkinCaption;

implementation

Procedure LoadFormRes(SkinName : ShortString);stdcall;
var
  SkinRes: TResourceStream;
Begin
  SkinRes := TResourceStream.Create(hInstance, SkinName, PChar('SKIN'));
  try
    if FSkinCaption <> nil then FSkinCaption.DLL_LoadSkinRes(SkinRes);
  finally
    SkinRes.Free;
  end;
End;

Procedure SetSkinFile(Value : ShortString);stdcall;
begin
  LoadFormRes(Value);

  //or use another function but skin file not skin res -> FSkinCaption.DLL_SetSkinFile(Value);

  {$IFDEF CRACK}
     if FSkinCaption <> nil then FSkinCaption.Active := True;
  {$ENDIF}
end;

procedure InitSkin(FHandle : THandle);stdcall;
begin
  if FSkinCaption <> nil then exit;

  if FSkinCaption = nil then  FSkinCaption := TSkinCaption.Create(nil);

  FSkinCaption.DLL_InitSkin(FHandle);
end;

procedure UnLoadAll;stdcall;
begin
  {$IFDEF CRACK}
     if FSkinCaption <> nil then FSkinCaption.Active := False;
  {$ENDIF}

  if FSkinCaption <> nil then FSkinCaption.DLL_UnLoadSkin;
end;

procedure SetActive(Value : Boolean); Stdcall;
begin
  if FSkinCaption <> nil then FSkinCaption.DLL_SetActive(Value);
End;

procedure Add3rdControl(Value : ShortString); stdcall; export;
begin
  if FSkinCaption <> nil then FSkinCaption.DLL_Add3rdControl(Value);
end;

initialization
  FSkinCaption := nil;
finalization
  if FSkinCaption <> nil then FSkinCaption.free;
end.

⌨️ 快捷键说明

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