杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2674|回复: 0

ISSkin 使用技巧,WinXP 下的窗口阴影

[复制链接]
发表于 2015-2-6 13:05:58 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
是否觉得在使用 ISSkin 的时候感觉窗口太过平板,尤其对于那些窗口边缘和窗口内部颜色一致的皮肤尤其是这样,继续使用 Sakura 皮肤作为讲解,下图就是安装程序的截图,是否觉得就像一张纸一样,缺乏立体感呢?

s1.gif

作为 Vista 以上的 Windows 版本,我们都能够看见窗口的阴影,但是在 WinXP 里面却看不见,但是我们能看见的只有 Windows 提示的阴影.所以以下就是使用了 WinXP 的提示阴影效果,达至看上去窗口有一些立体的感觉.

s2.gif
  1. ; 脚本编写: restools

  2. [Setup]
  3. AppName=ISSkin Example
  4. AppVersion=1.0
  5. DefaultDirName={pf}ISSkin
  6. SolidCompression=true
  7. WizardImageFile=SakuraWizard.bmp
  8. WizardSmallImageFile=SakuraSmall.bmp
  9. OutputDir=.
  10. OutputBaseFilename=ISSkinSakura

  11. [Files]
  12. ; Add the ISSkin DLL used for skinning Inno Setup installations.
  13. Source: ISSkin.dll; DestDir: {app}; Flags: dontcopy

  14. ; Add the Visual Style resource contains resources used for skinning,
  15. ; you can also use Microsoft Visual Styles (*.msstyles) resources.
  16. Source: Sakura.cjstyles; DestDir: {tmp}; Flags: dontcopy

  17. [Code]
  18. // Importing LoadSkin API from ISSkin.DLL
  19. procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
  20. external 'LoadSkin@files:isskin.dll stdcall';

  21. // Importing UnloadSkin API from ISSkin.DLL
  22. procedure UnloadSkin();
  23. external 'UnloadSkin@files:isskin.dll stdcall';

  24. // Importing ShowWindow Windows API from User32.DLL
  25. function ShowWindow(hWnd: Integer; uType: Integer): Integer;
  26. external 'ShowWindow@user32.dll stdcall';

  27. function GetClassLong(Wnd: HWnd; Index: Integer): Longint;
  28. external 'GetClassLongA@user32.dll stdcall';
  29. function SetClassLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint;
  30. external 'SetClassLongA@user32.dll stdcall';

  31. function InitializeSetup(): Boolean;
  32. begin
  33.   ExtractTemporaryFile('Sakura.cjstyles');
  34.   LoadSkin(ExpandConstant('{tmp}Sakura.cjstyles'), '');
  35.   Result := True;
  36. end;

  37. procedure DeinitializeSetup();
  38. begin
  39.   // Hide Window before unloading skin so user does not get
  40.   // a glimse of an unskinned window before it is closed.
  41.   ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  42.   UnloadSkin();
  43. end;

  44. function CheckWin32Version(AMajor: Integer; AMinor: Integer): Boolean;
  45. var
  46.   WinVer: TWindowsVersion;
  47. begin
  48.   GetWindowsVersionEx(WinVer);
  49.   Result := (WinVer.Major > AMajor) or
  50.             ((WinVer.Major = AMajor) and
  51.              (WinVer.Minor >= AMinor));
  52. end;

  53. procedure InitializeWizard();
  54. begin
  55.   WizardForm.WizardBitmapImage.Height := WizardForm.WelcomePage.Height;
  56.   if CheckWin32Version(5, 1) and (not CheckWin32Version(6, 0)) then
  57.     SetClassLong(WizardForm.Handle, -26, GetClassLong(WizardForm.Handle, -26) + $20000);
  58. end;
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-10 04:41 , Processed in 0.127778 second(s), 25 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表