Author Topic: How does it work  (Read 1111 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1979
    • zapsolution
How does it work
« on: June 13, 2023, 03:24:25 pm »
About WinLIFT

Is a mature Skin engine library (DLL) that exists since the end of the last century.
It is available in 32 or 64-bit.
The 32-bit version is ANSI based, while the 64-bit version is UNICODE based.

Quote
I strongly believe that, from the user's point of view, your application's appearance is the biggest single factor that can make the difference between your product and that of your competitors.

This is where WinLIFT comes in, it helps you to make the difference...

Patrice Terrier

The purpose of WinLIFT is to skin an existing application on the fly, as long as it uses the native Windows controls.
It can work in full composited mode, because it is DWM compatible.


Skin Style Sheet(SKS)

A "Skin Style Sheet" (file name extension .SKS)  works like a XML manifest or a Cascading Style Sheet for HTML files.
It defines the overall aspect of the skin theme being used to skin an application on the fly.

The ".sks" file should be always located within the same folder than the EXE using it.

A ".sks" file must be provided together with a dedicated folder holding the graphic components used to create the theme.
And the best place to put the dedicated theme folder is also within the same folder than the EXE using it.

You can use either PNG graphics to create a theme of your own, or the WinLIFT's SKI proprietary format, when you get an existing skin pack.

Here is an example of SKS file:
Code: [Select]
'AUTHOR section -------------------------------------------------------------
"AUTHOR,|Skin design: <Patrice Terrier> E-mail: pterrier@zapsolution.com"

'"BACKGROUNDPATH,      C:\Users\Public\Pictures\Sample Pictures

'BITMAP section -------------------------------------------------------------
"CTLBACK,             @PATH@Busi\CTLBACK.jpg"
"MENUBAR,             @PATH@Busi\MENUBAR.png"
"MENUBACK,            @PATH@Busi\MENUBAK.png"
"BUTTON,              @PATH@Busi\BUTTON.png"
"CAPTIONL,            @PATH@Busi\CAPTIONL.png"
"CAPTIONM,            @PATH@Busi\CAPTIONM.png"
"CAPTIONR,            @PATH@Busi\CAPTIONR.png"
"SIDEL,               @PATH@Busi\SIDEL.png"
"SIDER,               @PATH@Busi\SIDER.png"
"RADIOBUT,            @PATH@Busi\RADIOBUT.png"
"CHECKBUT,            @PATH@Busi\CHECKBUT.png"
"CAPLED,              @PATH@Busi\BTN_Led.png"
"PROGRESS,            @PATH@Busi\PROGRESS.png"
"CPOPUPR,             @PATH@Busi\CPOPUPR.png"
"BOTTOML,             @PATH@Busi\BOTTOML.png"
"BOTTOMM,             @PATH@Busi\BOTTOMM.png"
"BOTTOMR,             @PATH@Busi\BOTTOMR.png"

"SYSCLOSE,            @PATH@Busi\BTN_Close.png"
"SYSRESTORE,          @PATH@Busi\BTN_Restore.png"
"SYSMINIMIZE,         @PATH@Busi\BTN_Minimize.png"
"SYSMAXIMIZE,         @PATH@Busi\BTN_Maximize.png"

"TABBUTTON,           @PATH@Busi\TABBUTTON.png" ' 4.01
"HORZBAR,             @PATH@Busi\HORZBAR.png"   ' 4.20
"VERTBAR,             @PATH@Busi\VERTBAR.png"   ' 4.20
"SBPICTO,             @PATH@Busi\SBPICTO.png"   ' 4.20 ScrollBar picto
"DRAGWIN,             @PATH@Busi\DRAGWIN.png"   ' 4.17

"BTNTRACK,            @PATH@Busi\BTNTRACK.png"  ' 4.26 TrackBar thumb button
"MENUNAV,             @PATH@Busi\MENUNAV.png"   ' 4.35

"ICON_PROG,           @PATH@Busi\ICON.png"      ' 4.38
"ICON_ALERT,          @PATH@Busi\ICON_Alert.png"' 4.38
"ICON_ERROR,          @PATH@Busi\ICON_Error.png"' 4.38
"ICON_INFO,           @PATH@Busi\ICON_Info.png" ' 4.38
"ICON_INPUT,          @PATH@Busi\ICON_Input.png"' 4.38
"DLG_ALERT,           @PATH@Busi\DLG_Alert.png" ' 4.38
"DLG_INPUT,           @PATH@Busi\DLG_Input.png" ' 4.38
"DLG_INFO,            @PATH@Busi\DLG_Info.png"  ' 4.38

'SIZE & COORDINATES section -------------------------------------------------
"CYSTATUS,            18"          ' SIZE: height of status bar. Std = 18
"CXSIZE,              18"          ' SIZE: X size of system buttons. Std = 18
"CYSIZE,              18"          ' SIZE: Y size of system button. Std = 18

"CXSYSBUT,            17"          ' Sys buttons X offset from right side.
"CYSYSBUT,            10"          ' Sys buttons Y offset from top side.

"CXCAPTEXT,           52"          ' Caption text X offset from left side
"CYCAPTEXT,           12"          ' SIZE: Y pos of caption text

"CXSYSLED,            40"          ' Led X offset from right side.
"CYSYSLED,            40"          ' Led Y offset from top side.

"XBUT3DBORDER,        04"          ' Horizontal non stretched button border
"YBUT3DBORDER,        04"          ' Vertical non stretched button border

"CXSYSICON,           18"          ' SIZE: X pos of system icon.
"CYSYSICON,           09"          ' SIZE: Y pos of system icon.
"ICONSIZE,            30"          ' The icon size.

"PAINT_BORDER,        1"           ' 0 = %PAINT_TILING_MODE, 1 = %PAINT_STRETCH_MODE
"PAINT_BACKGROUND,    1"           ' 0 = %PAINT_TILING_MODE, 1 = %PAINT_STRETCH_MODE

"CYCAPTION,          48"           ' 0 = Use size of CAPTIONM bitmap
"CXFRAMELEFT,         0"           ' 0 = Use size of SIDEL bitmap
"CXFRAMERIGHT,        0"           ' 0 = Use size of SIDER bitmap
"CYFRAMEBOTTOM,       0"           ' 0 = Use size of BOTTOM bitmap

"OUTER_GLOW,          1"           ' 0 = OFF, 1 = ON (Caption + PushButton)
"SKIN_ICON,           1"           ' 0 = OFF, 1 = ON (Display skin icon on caption instead of default)

'COLOR section --------------------------------------------------------------
"CAPTIONTEXT,         255,240,240,240" ' RGB active caption text color.
"INACTIVECAPTIONTEXT, 255,128,128,128" ' RGB inactive caption text color.
"ACTIVECAPTION,       255,224,223,227" ' RGB active caption background color.
"INACTIVECAPTION,     255,235,235,235" ' RGB inactive caption background color.
"BTNTEXT,             255,230,230,230" ' RGB font color to use in button.
"POPMENUTEXT,         255,255,255,255" ' RGB PopMenu and Status text color.
"POPMENUHILITE,       255,48,48,48"    ' RGB PopMenu 3D color.
"WINDOWTEXT,          255,230,230,230" ' RGB default main window text color.
"HILITEBACK,          255,209,209,209" ' RGB active item background in control.
"HILITETEXT,          255,64,64,64"    ' RGB active item text in control.
"ACTIVMENU,           255,250,250,250" ' RGB active menu bar text color.
"INACTIVMENU,         255,133,138,133" ' RGB inactive menu bar text color.
"MENUBARHILITE,       255,250,250,250" ' 4.35 RGB menu bar hilite.
"GRAYEDCOLOR,         255,128,128,128" ' 4.53 for grayed text control.

"3DLEFTTOP,           255,58,58,58"    ' RGB skDrawRect3D left top color.
"3DRIGHTBOTTOM,       255,126,126,126" ' RGB skDrawRect3D right bottom color.

"CARETCOLOR,          255,128,0,0"     ' 4.36+ RGB caret color.
"EDITCOLORTEXT,       255,220,220,220" ' 4.01+ RGB Edit text color.
"EDITCOLORBACK,       255,048,048,048" ' 4.01+ RGB Edit background color.
"EDITCOLORRECTUP,     255,092,092,092" ' 4.01+ RGB Edit frame top/left color.
"EDITCOLORRECTDOWN,   255,092,092,092" ' 4.01+ RGB Edit frame bottom/right color.
"MENUBORDERFRAME,     255,32,32,32"    ' 4.01+ RGB Menu frame border color.

"TBTRACKCOLOR,        255,160,160,160" ' 4.26 Track bar hilight color
"TBPOSCOLOR,          255,0,74,201"    ' 4.26 Track bar progress color

"SHADOW,              255,32,32,32"    ' RGB shadow item translucent color. 128,128,128
"TRANSLUCENCY,        70"              ' Shadow translucency.

"MENUTRANSLUCENCY,    90"              ' Menu translucency percentage

"USEFONT,             Segoe UI Emoji"  ' Font to use Trebuchet MS

"DWM_AERO,             0"              ' 4.70, 0 = OFF, 1 = ON (Use VISTA-SEVEN Aero composited mode)
"DWM_LEFT,            00"              ' 4.70, DWM left border size.
"DWM_TOP,             00"              ' 4.70, DWM top border size.
"DWM_RIGHT,           00"              ' 4.70, DWM right border size.
"DWM_BOTTOM,          00"              ' 4.70, DWM bottom border size.
"AEROCOLOR,           000,000,000,000" ' 4.70, ARGB color to paint behind transparent background.
"BLURCOLOR,           000,000,000,000" ' 4.74, ARGB BLUR color.

"TIPCOLORTEXT,        255,255,255,255" ' 5.00+ TIP text color.
"TIPCOLORBACK,        255,128,128,128" ' 5.00+ TIP background color.

"SPLIT_VERT,          @PATH@Busi\SplitV.png"  ' 7.00
"SPLIT_HORZ,          @PATH@Busi\SplitH.png"  ' 7.00

Skin Theme

Each theme is based on a set of graphic components, that are used to skin the controls, and the non-client area of the window.

Each part of the non-client area must match a specific graphic component as shown in the example bellow.
And the name of each graphic component must be specified in the matching "SKS" file.



Note: The magenta color, RGB(255,0,255), is used to create the window region on the fly.

WinLIFT is 100% compatible with the GDImage graphic library
They have been designed to work together, and they perform mutual code detection.
« Last Edit: January 15, 2024, 06:29:24 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1979
    • zapsolution
Header for the VS2022 experimental version 6.00
« Reply #1 on: September 03, 2023, 10:58:22 am »
Here is the header to use with Version 7.00

Code: [Select]
#include <windows.h>

#define C_IMPORT extern "C" __declspec(dllimport)

const int ANCHOR_NONE                = -1;
const int ANCHOR_LEFT                = 0;//ANCHOR_NONE;
const int ANCHOR_WIDTH               = 1;
const int ANCHOR_RIGHT               = 2;
const int ANCHOR_CENTER_HORZ         = 3;
const int ANCHOR_HEIGHT              = 4;
const int ANCHOR_HEIGHT_WIDTH        = 5;
const int ANCHOR_HEIGHT_RIGHT        = 6;
const int ANCHOR_BOTTOM              = 7;
const int ANCHOR_BOTTOM_WIDTH        = 8;
const int ANCHOR_BOTTOM_RIGHT        = 9;
const int ANCHOR_CENTER_HORZ_BOTTOM  = 10;
const int ANCHOR_CENTER_VERT         = 11;
const int ANCHOR_CENTER_VERT_RIGHT   = 12;
const int ANCHOR_CENTER              = 13;
const int ANCHOR_LAST                = ANCHOR_CENTER;

const int SK_METRICFIRST      = 0;
const int SK_CYCAPTION        = SK_METRICFIRST;
const int SK_CYMENU           = 1;
const int SK_CYSTATUS         = 2;
const int SK_CXFRAMELEFT      = 3;
const int SK_CXFRAMERIGHT     = 4;
const int SK_CYFRAMETOP       = SK_CYCAPTION;
const int SK_CYFRAMEBOTTOM    = 5;
const int SK_CXSIZE           = 6;
const int SK_CYSIZE           = 7;
const int SK_CXSYSBUT         = 8;
const int SK_CYSYSBUT         = 9;
const int SK_CXCAPTEXT        = 10;
const int SK_CYCAPTEXT        = 11;
const int SK_XBUT3DBORDER     = 12;
const int SK_YBUT3DBORDER     = 13;
const int SK_CXSYSICON        = 14;
const int SK_CYSYSICON        = 15;
const int SK_CXSYSLED         = 16;
const int SK_CYSYSLED         = 17;
const int SK_TRANSLUCENCY     = 18;
const int SK_MENUTRANSLUCENCY = 19;
const int SK_PAINT_BORDER     = 20;
const int SK_PAINT_BACKGROUND = 21;
const int SK_ICONSIZE         = 22;
const int SK_OUTER_GLOW       = 23;
const int SK_SKIN_ICON        = 24;
const int SK_DWM_AERO         = 25;
const int SK_DWM_LEFT         = 26;
const int SK_DWM_TOP          = 27;
const int SK_DWM_RIGHT        = 28;
const int SK_DWM_BOTTOM       = 29;
const int SKMETRIC_UB         = 30;

C_IMPORT HWND     skPopupOwner (IN HWND hWnd);
C_IMPORT HFONT    skCaptionFont ();
C_IMPORT HFONT    skFont ();
C_IMPORT HFONT    skFontBold ();
C_IMPORT HFONT    skFontDlg ();
C_IMPORT LONG_PTR skCaptionFontPlus ();
C_IMPORT LONG_PTR skFontPlus ();
C_IMPORT LONG_PTR skFontBoldPlus ();
C_IMPORT LONG_PTR skFontDlgPlus ();
C_IMPORT void     skSkinDisable (IN HWND hWnd);
C_IMPORT void     skSetZorder (IN HWND hWnd, IN HWND UseOrder);
C_IMPORT HDC      skGetHdcMemBmp (IN HWND hOwner);
C_IMPORT DWORD    skARGB (IN BYTE A, IN BYTE R, IN BYTE G, IN BYTE B);
C_IMPORT void     ComputeAspect (IN long xPic, IN long yPic, IN long xCell, IN long yCell, OUT long &xP, OUT long &yP, OUT long &xS, OUT long &yS);
C_IMPORT void     skChildOffset (IN HWND hWnd, OUT long &ofX, OUT long &ofY);
C_IMPORT void     skSetLabelFont (IN HWND hCtrl, IN WCHAR* zFontName, IN WORD nFontSize, IN long ARGBcolor, IN WORD nFontStyle, IN BOOL redraw);
C_IMPORT WCHAR*   skVersion ();
C_IMPORT long     skSetAnchorCtrl (IN HWND hWnd, IN long AnchorMode);
C_IMPORT long     skUsingDWM ();
C_IMPORT WCHAR*   skSkinFolder ();
C_IMPORT HWND     skButImage (IN HWND hOwner, OUT HBITMAP hBitmap, IN long xLeft, IN long yLeft, IN long ButID);
C_IMPORT WCHAR*   skAuthor ();
C_IMPORT HWND     skBorder (IN HWND hWnd, IN long x, IN long y, IN long xW, IN long yH, IN long nID, IN long nBorder);
C_IMPORT void     skSkinChildCtrl (IN HWND hWnd, IN long RedrawFlag);
C_IMPORT void     skSkinEnable (IN HWND hWnd);
C_IMPORT void     skRedrawMenuBar(IN HWND hWnd);
C_IMPORT HMENU    skGetMenu (IN HWND hWnd);
C_IMPORT HWND     skMenuContainer (IN HWND hWnd);
C_IMPORT void     skSkinWindowUpdate (IN HWND hWnd, IN long RedrawFlag);
C_IMPORT long     skSkinWindow (IN HWND hWnd, WCHAR* zSysButTip);
C_IMPORT HWND     skCreateDW (IN HWND hParent);
C_IMPORT void     skDestroyDW (OUT HWND &hDW);
C_IMPORT long     skDialogAlert (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT long     skDialogError (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT long     skDialogInfo (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT long     skDialogYesNo (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT WCHAR*   skDialogInput (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT HWND     skButtonImage (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN long x, IN long y, IN long ButID, IN long StateMax);
C_IMPORT HWND     skPushButtonImage (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN WCHAR* zLabel, IN long x, IN long y, IN long xW, IN long yH, IN long ButID, IN long Alignment);
C_IMPORT void     skSetToolTipText (IN HWND hObj, IN WCHAR* zText);
C_IMPORT WCHAR*   skGetToolTipText (IN HWND hObj);
C_IMPORT HWND     skCreateToolTip (IN HWND hObj, IN WCHAR* zText);
C_IMPORT void     skRemoveToolTip (IN HWND hObj);
C_IMPORT HWND     skClockCtrl (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN long x, IN long y, IN long w, IN long h, IN long nID, IN long ARGB1, IN long ARGB2, IN long GMT);
C_IMPORT long     skComputeAngleFromPoint(IN HWND hWnd, IN long mX, IN long mY);
C_IMPORT void     skGaugeSetMinMax (IN HWND hCtrl, IN long nMin, IN long nMax);
C_IMPORT void     skGaugeGetMinMax (IN HWND hCtrl, OUT long &nMin, OUT long &nMax);
C_IMPORT void     skGaugeSetPos (IN HWND hCtrl, IN long nPos, IN long RedrawFlag);
C_IMPORT long     skGaugeGetPos (IN HWND hCtrl);
C_IMPORT HWND     skKnobGauge (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN long x, IN long y, IN long w, IN long h, IN long ButID, IN long MinValue, IN long MaxValue, IN long UsePos, IN long StateMax);
C_IMPORT HWND     skStaticImage (IN HWND hOwner, WCHAR* zFullpathImageName, IN long x, IN long y, IN long w, IN long h, IN long nID);
//C_IMPORT HWND     skGetDWMregion (IN HWND hWnd);
C_IMPORT long     skGetSystemMetrics (IN long nMeasure);
C_IMPORT HBITMAP  skSkiToDib (IN WCHAR* szFile, OUT long &nReserved);
C_IMPORT long     skTerminateProcess (IN WCHAR* szModule);
C_IMPORT void     skPaintBrushBitmap (IN HDC hDC, IN long x, IN long y, IN long nWidth, IN long nHeight, IN DWORD ARGBcolor);
C_IMPORT HWND     skTrackbar (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN long x, IN long y, IN long tW, IN long tH, IN long ButID, IN long tMin, IN long tMax, IN long tVal, IN long ARGBcolor);
C_IMPORT long     skGetTrackValue(IN HWND hWnd);
C_IMPORT void     skSetTrackValue(IN HWND hWnd, IN long tVal);
C_IMPORT void     skSetLabelColor (IN HWND hCtrl, IN long ARGBcolor);
C_IMPORT long     skDoNotSkinPopupMenu (IN long nOnOff, IN long RW);

C_IMPORT void     skMaximize(IN HWND hWnd); // 06-25-2015
C_IMPORT void     skRestore(IN HWND hWnd);  // 06-25-2015
C_IMPORT void     skRestoreCaption(IN HWND hWnd, IN BOOL nBool);  // 01-01-2017

C_IMPORT void     skSetTrackRange(IN HWND hWnd, IN long tMin, IN long tMax); // 09-09-2017
C_IMPORT void     skGetTrackRange(IN HWND hWnd, OUT long &tMin, OUT long &tMax); // 09-09-2017
C_IMPORT long     skGetSysColor(IN long nC); // 09-09-2017
C_IMPORT HWND     skLabel(IN HWND hOwner, IN WCHAR* zFullpathBackground, IN WCHAR* zLabel, IN long x, IN long y, IN long xW, IN long yH, IN long ButID, IN long Alignment); // 09-12-2017
C_IMPORT LONG_PTR skGetLabelFont(IN HWND hCtrl); // 2017-09-13

C_IMPORT HBITMAP  SkGetSbVertBitmap();
C_IMPORT HBITMAP  SkGetSbHorzBitmap();
C_IMPORT HBITMAP  SkGetSbPictoBitmap();
C_IMPORT void     skPaintButton(IN HDC hDC, IN long nB, IN HBITMAP hBmp, IN long nX, IN long nY, IN long xWidth, IN long yHeight);
C_IMPORT void     DrawPicto(IN HDC hDC, IN long nB, IN long nX, IN long nY, IN long xWidth, IN long yHeight);
C_IMPORT void     skSetSystemMetrics(IN long nMeasure, IN long UseValue);

C_IMPORT void     skRedrawNcArea(IN HWND hWnd);

// 08-31-2023 Version 6.00
C_IMPORT long     skMinTrackSizeX(HWND hWnd);
C_IMPORT long     skMinTrackSizeY(HWND hWnd);
C_IMPORT long     skInitEngine (IN WCHAR* zSkinFile, IN WCHAR* zUserKey);
C_IMPORT long     skUseThisBackground(IN HWND hWnd, IN WCHAR* zItem);
C_IMPORT void     skGetClientSize(IN HWND hWnd, OUT long &xClient, OUT long &yClient, OUT long &ClientWidth, OUT long &ClientHeight);

const int AT_TOP         = 1;
const int AT_LEFT        = 2;
const int AT_RIGHT       = 4;
const int AT_BOTTOM      = 8;
const int AT_TOPLEFT     = 3;
const int AT_TOPRIGHT    = 5;
const int AT_BOTTOMLEFT  = 10;
const int AT_BOTTOMRIGHT = 12;
const int AT_ALL         = 15;

const int DOCK_TOP       = 256;
const int DOCK_LEFT      = 512;
const int DOCK_RIGHT     = 1024;
const int DOCK_BOTTOM    = 2048;
const int DOCK_FILL      = 3840;

const int CANCELMODE     = -1;
const int ANCHORMODE     = 32;
const int HOMOTHETIC     = 64;

C_IMPORT BOOL     skAnchorInit(HWND hWnd);
//C_IMPORT BOOL     skHomotheticResize(HWND hWnd, BOOL bRepaint);
C_IMPORT BOOL     skAnchorResize(HWND hWnd, BOOL bRepaint);
C_IMPORT BOOL     skAnchorID(HWND hWnd, UINT uID, UINT uFlag);
C_IMPORT BOOL     skAnchorRemoveAll(HWND hWnd);
C_IMPORT long     skUseAnchorMode(HWND hWnd, IN long UseMode);
C_IMPORT void     skSetListViewImage(WCHAR* FullPathName, long ReadWriteFlag);
C_IMPORT void     skSetToolBarImage(WCHAR* FullPathName, long ReadWriteFlag);
C_IMPORT void     skGetWindowSize(IN HWND hWnd, OUT long &x, OUT long &y, OUT long &WindowWidth, OUT long &WindowHeight);
C_IMPORT BOOL     skSkinChange(IN WCHAR* zSkinFile);
« Last Edit: January 15, 2024, 06:32:48 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)