'+--------------------------------------------------------------------------+
'|                                                                          |
'|                                WinLIFT.INC                               |
'|                                                                          |
'|             WinLIFT simplified API constants and declarations.           |
'|                                                                          |
'|                               Version 7.00                               |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                                                                          |
'|                         Author Patrice TERRIER                           |
'|            8 Domaine de Rochagnon. 38800 Champagnier  FRANCE             |
'|                       http://www.zapsolution.com                         |
'|                    E-mail: pterrier@zapsolution.com                      |
'|                                                                          |
'|                 copyright (c) 2003-2022 Patrice TERRIER                  |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                  Project started on : 02-24-2003                         |
'|                        Last revised : 01-03-2024                         |
'+--------------------------------------------------------------------------+

' Init the WinLIFT SkinEngine
  declare function skInitEngine LIB "WinLIFT32.dll" alias "skInitEngine" ( _
  zSkinFile as wstringz, _             ' The name of the .SKS file theme to use.
  zUserKey as wstringz _               ' Private user key.
  ) as long

' The main function to skin a window
  declare function skSkinWindow LIB "WinLIFT32.dll" alias "skSkinWindow" ( _
  byval hWnd as long, _              ' Handle of the popup window you want to skin.
  zSysButTip as wstringz _             ' The text of tooltip that will be shown when the mouse hover the system buttons.
  ) as long

' Disable skinning of a specific control
  declare function skSkinDisable LIB "WinLIFT32.dll" alias "skSkinDisable" ( _
  byval hCtrl as long _              ' Handle of the child control to disable.
  ) as long

' Enable skinning of a specific control (use it only after a previous call to skSkinDisable)
  declare function skSkinEnable LIB "WinLIFT32.dll" alias "skSkinEnable" ( _
  byval hCtrl as long _              ' Handle of the child control to enable (must be followed by a skSkinWindowUpdate).
  ) as long

' Returns the "Skin" author name and copyright.
  declare function skAuthor LIB "WinLIFT32.dll" alias "skAuthor" () as STRING

  %WM_SKGETMENUICON           = &H400 + &H7F  ' &H400 = %WM_USER, &H7F  = %WM_GETICON
                                              ' wParam = menu ID, lParam = %NULL

' Anchor child controls
  declare function skSetAnchorCtrl LIB "WinLIFT32.dll" alias "skSetAnchorCtrl" ( _
  byval hCtrl as long, _             ' Handle of the child control to anchor.
  byval AnchorMode as long _         ' See the constant list below.
  ) as long

' Anchor constants
  %ANCHOR_NONE                = 0
  %ANCHOR_LEFT                = %ANCHOR_NONE
  %ANCHOR_WIDTH               = 1
  %ANCHOR_RIGHT               = 2
  %ANCHOR_CENTER_HORZ         = 3
  %ANCHOR_HEIGHT              = 4
  %ANCHOR_HEIGHT_WIDTH        = 5
  %ANCHOR_HEIGHT_RIGHT        = 6
  %ANCHOR_BOTTOM              = 7
  %ANCHOR_BOTTOM_WIDTH        = 8
  %ANCHOR_BOTTOM_RIGHT        = 9
  %ANCHOR_CENTER_HORZ_BOTTOM  = 10
  %ANCHOR_CENTER_VERT         = 11
  %ANCHOR_CENTER_VERT_RIGHT   = 12
  %ANCHOR_CENTER              = 13

'****************************************************************************
'*                THESE MUST BE USED WITH WINLIFT's MENU                    *
'****************************************************************************
' Replace the standard DrawMenuBar API, must be used with WinLIFT's menu
  declare sub skRedrawMenuBar LIB "WinLIFT32.dll" alias "skRedrawMenuBar" ( _
  byval hWinliftMenu as long _       ' The WinLIFT menu handle.
  )

' Note: WinLIFT's menu are not standard menu, thus do not use the standard API GetMenu
' to retrieve a menu handle but the specific skGetMenu below.
' Instead of using skGetMenu you can also save the menu handle in a global variable and then
' use this global variable in lieu of the GetMenu API.
  declare function skGetMenu LIB "WinLIFT32.dll" alias "skGetMenu" ( _
  byval hWinliftMenu as long _       ' The internal WinLIFT menu handle.
  ) as long                          ' RETURN: the Windows menu handle.

' Retrieve the handle of the WinLIFT's menu container
  declare function skMenuContainer LIB "WinLIFT32.dll" alias "skMenuContainer" (byval hWnd&) as long
'****************************************************************************
'*                           END OF SKINNED MENU                            *
'****************************************************************************

  declare function skCreateDW LIB "WinLIFT32.dll" alias "skCreateDW" (byval hParent as long) as long
  declare sub      skDestroyDW LIB "WinLIFT32.dll" alias "skDestroyDW" (byref hDW as long)

  declare function skDialogAlert LIB "WinLIFT32.dll" alias "skDialogAlert" ( _
  zCaption as wstringz, _              ' Text of the caption.
  zMessage as wstringz, _              ' Text of the message.
  zButton as wstringz _                ' Text of the button (will be "Ok" if empty).
  ) as long                          ' RETURN: nothing.
  declare function skDialogError LIB "WinLIFT32.dll" alias "skDialogError" ( _
  zCaption as wstringz, _              ' Text of the caption.
  zMessage as wstringz, _              ' Text of the message.
  zButton as wstringz _                ' Text of the button (will be "Ok" if empty).
  ) as long                          ' RETURN: nothing.
  declare function skDialogInfo lib "WinLIFT32.dll" alias "skDialogInfo" ( _
  zCaption as wstringz, _              ' Text of the caption.
  zMessage as wstringz, _              ' Text of the message.
  zButton as wstringz _                ' Text of the button (will be "Ok" if empty).
  ) as long                          ' RETURN: nothing.
  declare function skDialogYesNo LIB "WinLIFT32.dll" alias "skDialogYesNo" ( _
  zCaption as wstringz, _              ' Text of the caption.
  zMessage as wstringz, _              ' Text of the message.
  zButton as wstringz _                ' "@Yes|No", the "@" char means put the focus on this button.
  ) as long                          ' RETURN: TRUE for Yes, FALSE for No.
  declare function skDialogInput LIB "WinLIFT32.dll" alias "skDialogInput" ( _
  zCaption as wstringz, _              ' Text of the caption.
  zMessage as wstringz, _              ' Text of the input message.
  zButton as wstringz _                ' Text of the button (will be "Ok" if empty).
  ) as STRING                        ' RETURN: the text entered by the user.

  declare function skVersion LIB "WinLIFT32.dll" alias "skVersion" () as STRING

  declare function skCaptionFont LIB "WinLIFT32.dll" alias "skCaptionFont" () as long
  declare function skFont LIB "WinLIFT32.dll" alias "skFont" () as long
  declare function skFontBold LIB "WinLIFT32.dll" alias "skFontBold" () as long
  declare function skFontDlg LIB "WinLIFT32.dll" alias "skFontDlg" () as long

  declare function skButtonImage LIB "WinLIFT32.dll" alias "skButtonImage" ( _
  byval hOwner as dword, _           ' Handle of the window parent owner.
  zFullpathImageName as wstringz, _  ' Full path name to the button image.
  byval x as long, _                 ' X location of the button.
  byval y as long, _                 ' Y location of the button.
  byval ButID as long, _             ' Unique ID of the button.
  byval StateMax as long _           ' Number of state of the button image.
  ) as dword

  declare function skBorder LIB "WinLIFT32.dll" alias "skBorder" ( _
  byval hParentCtrl as dword, _      ' Handle of the child control being used as parent.
  byval x as long, _                 ' X location of the border.
  byval y as long, _                 ' Y location of the border.
  byval xW as long, _                ' Width of the border.
  byval yH as long, _                ' Height of the border.
  byval BorderID as long, _          ' Unique ID of the border control.
  byval UseBorderSize as long _      ' The pen size to draw the border.
  ) as dword

' // Tooltip.
  declare function skCreateToolTip LIB "WinLIFT32.dll" alias "skCreateToolTip" ( _
  byval hCtrl as dword, _            ' Handle of the child control.
  zText as wstringz _                ' The text to display.
  ) as long
  declare sub skSetToolTipText LIB "WinLIFT32.dll" alias "skSetToolTipText" ( _
  byval hCtrl as dword, _            ' Handle of the child control.
  zText as wstringz _                ' The new text.
  )
  declare function skGetToolTipText LIB "WinLIFT32.dll" alias "skGetToolTipText" ( _
  byval hCtrl as dword _             ' Handle of the child control.
  ) as string                        ' RETURN: the current text.

' // Create a button from a 5-state image.
  declare function skPushButtonImage LIB "WinLIFT32.dll" alias "skPushButtonImage" ( _
  byval hOwner as dword, _           ' Handle of the window parent owner.
  zFullpathImageName as wstringz, _  ' Full path name to the image shown on button.
  zLabel as wstringz, _              ' The text label of the button.
  byval x as long, _                 ' X location of the button.
  byval y as long, _                 ' Y location of the button.
  byval W as long, _                 ' Width of the button.
  byval H as long, _                 ' Height of the button.
  byval UseID as long, _             ' Unique ID of the button.
  byval nAlignment as long _         ' Button style alignment (%BS_LEFT, %BS_RIGHT, %BS_CENTER, %BS_TOP, %BS_BOTTOM).
  ) as long

' //Return the skin folder full path, completed with a trailing back slash.
  declare function skSkinFolder LIB "WinLIFT32.dll" alias "skSkinFolder" () as STRING


' // 4.73 Animated clock control
  declare function skClockCtrl LIB "WinLIFT32.dll" alias "skClockCtrl" ( _
  byval hOwner as dword, _           ' Handle of the window parent owner.
  zFullpathImageName as wstringz, _  ' Full path name to the clock image background.
  byval x as long, _                 ' X location of the clock control.
  byval y as long, _                 ' Y location of the clock control.
  byval W as long, _                 ' Width of the clock control.
  byval H as long, _                 ' Height of the clock control.
  byval ButID as long, _             ' Unique ID of the clock control.
  byval ARGB1 as long, _             ' The color to draw the Hour/Minute hands.
  byval ARGB2 as long, _             ' The color to draw the second hands.
  OPTIONAL byval GMToffset as long _ ' The GMT offset to be used.
  ) as long
  %DISABLE_TIMER = 99 '// Use this value in the optional GMToffset parameter to disable local timer in case of animated background

' // 4.75 To skin a child control on the fly, must be used AFTER the initial call to skInitEngine.
  declare sub skSkinChildCtrl LIB "WinLIFT32.dll" alias "skSkinChildCtrl" ( _
  byval hCtrl as dword, _            ' The handle of the child control.
  byval RedrawFlag as long _         ' Redraw boolean flag.
  )

'// 4.77 Use this when new controls are added AFTER the initial skinning of the main window.
  declare sub skSkinWindowUpdate LIB "WinLIFT32.dll" alias "skSkinWindowUpdate" ( _
  byval hWnd as dword, _             ' The main window handle.
  byval RedrawFlag as long _         ' Redraw boolean flag.
  )

' // 4.76 Create a Knob gauge control.
  declare function skKnobGauge LIB "WinLIFT32.dll" alias "skKnobGauge" ( _
  byval hOwner as dword, _           ' Handle of the window parent owner.
  zFullpathImageName as wstringz, _  ' Full path name to the gauge image.
  byval x as long, _                 ' X location of the gauge control.
  byval y as long, _                 ' Y location of the gauge control.
  byval W as long, _                 ' Width of the gauge control.
  byval H as long, _                 ' Height of the gauge control.
  byval ButID as long, _             ' Unique ID of the gauge control.
  byval MinValue as long, _          ' MAXIMUM range value (the exclusion zone is between the MINIMUM and MAXIMUM range).
  byval MaxValue as long, _          ' MAXIMUM range value (the exclusion zone is between the MINIMUM and MAXIMUM range).
  byval UsePos as long, _            ' 0 or initial angle value in degree to use.
  byval Reserved as long _           ' Must be NULL.
  ) as long
'// 4.76 Assign the Min/Max gauge value.
  declare sub skGaugeSetMinMax LIB "WinLIFT32.dll" alias "skGaugeSetMinMax" ( _
  byval hCtrl as dword, _            ' The control handle.
  byval nMin as long, _              ' Minimum value (for knob this must be a rotation angle in the range 0-359).
  byval nMax as long _               ' Maximum value (for knob this must be a rotation angle in the range 0-359).
  )
'// 4.76 Retrieve the Min/Max gauge value.
  declare sub skGaugeGetMinMax LIB "WinLIFT32.dll" alias "skGaugeGetMinMax" ( _
  byval hCtrl as dword, _            ' The control handle.
  byref nMin as long, _              ' Minimum value (for knob this is a rotation angle in the range 0-359).
  byref nMax as long _               ' Maximum value (for knob this is a rotation angle in the range 0-359).
  )
'// 4.76 Set the gauge value.
  declare sub skGaugeSetPos LIB "WinLIFT32.dll" alias "skGaugeSetPos" ( _
  byval hCtrl as dword, _            ' The control handle.
  byval nPos as long, _              ' The pos value to set (must be an angle in the range 0-359 for Knob control).
  byval RedrawFlag as long _         ' Redraw boolean flag.
  )
'// 4.76 Get the gauge value.
  declare function skGaugeGetPos LIB "WinLIFT32.dll" alias "skGaugeGetPos" ( _
  byval hCtrl as dword _             ' The control handle.
  ) as long

'// 4.80 Create a full ARGB color (with alpha channel).
  declare function skARGB LIB "WinLIFT32.dll" alias "skARGB" ( _
  byval A as byte, _                 ' Alpha channel in the range 0-255 (0 full transparency, 255 full opaque mode).
  byval R as byte, _                 ' Red channel in the range 0-255.
  byval G as byte, _                 ' Green channel in the range 0-255.
  byval B as byte _                  ' Blue channel in the range 0-255.
  ) as long

  %FontStyleRegular = 0
  %FontStyleBold = 1
  %FontStyleItalic = 2
  %FontStyleBoldItalic = 3
  %FontStyleUnderline = 4
  %FontStyleStrikeout = 8
'// 4.80 This API is to be used only with STATIC and BUTTON controls exclusively!
  declare sub skSetLabelFont LIB "WinLIFT32.dll" alias "skSetLabelFont" (byval hCtrl as dword, zFontName as wstringz, byval nFontSize as word, byval ARGBcolor as long, byval nFontStyle as word, byval redraw as long)
  declare function skStaticImage LIB "WinLIFT32.dll" alias "skStaticImage" (byval hOwner as dword, zFullpathImageName as wstringz, byval x as long, byval y as long, byval w as long, byval h as long, byval nID as long) as dword
  declare sub skSetZorder LIB "WinLIFT32.dll" alias "skSetZorder" (byval hCtrl as dword, byval UseOrder as long)

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

  declare function skGetSystemMetrics LIB "WinLIFT32.dll" alias "skGetSystemMetrics" ( _
  byval nMeasure as long _           ' The measure to retrieve.
  ) as long

'// 4.87
  declare function skGetDWMregion LIB "WinLIFT32.dll" alias "skGetDWMregion" ( _
  byval hOwner as dword _            ' Handle of the window parent owner.
  ) as long

'// 4.89 Main window minimum horizontal track size
  declare function MinTrackSizeX LIB "WinLIFT32.dll" alias "MinTrackSizeX"( _
  byval SizeX as long _              ' Width
  ) as long

'// 4.89 Main window minimum vertical track size
  declare function MinTrackSizeY LIB "WinLIFT32.dll" alias "MinTrackSizeY"( _
  byval SizeY as long _              ' Height
  ) as long

  declare function skDoNotSkinPopupMenu lib "WinLIFT32.dll" alias "skDoNotSkinPopupMenu" ( _
  byval nOnOff as long, _
  byval RW as long _
  ) as long

  declare function zGetButImageBackProperty lib "WinLIFT32.dll" alias "zGetButImageBackProperty" ( _
  byval hWnd as dword _
  ) as dword

  declare function skSkiToDib lib "WinLIFT32.dll" alias "skSkiToDib" ( _
  sBufIn as wstringz, _
  byref nReserved as long _
  ) as dword

  declare sub skMaximize lib "WinLIFT32.dll" alias "skMaximize" (byval hWnd as dword)
  declare sub skRestore lib "WinLIFT32.dll" alias "skRestore" (byval hWnd as dword)

' Version 7.00

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

  %DOCK_TOP       = 256
  %DOCK_LEFT      = 512
  %DOCK_RIGHT     = 1024
  %DOCK_BOTTOM    = 2048
  %DOCK_FILL      = 3840

  %CANCELMODE     = -1
  %ANCHORMODE     = 32
  %HOMOTHETIC     = 64

  declare sub skRestoreCaption lib "WinLIFT32.dll" alias "skRestoreCaption"(byval hWnd as dword, byval nBool as long)
  declare sub skSetTrackRange lib "WinLIFT32.dll" alias "skSetTrackRange"(byval hWnd as dword, byval tMin as long, byval tMax as long)
  declare sub skGettrackrange lib "WinLIFT32.dll" alias "skGettrackrange"(byval hWnd as dword, byref tMin as long, byref tMax as long)
  declare function skGetSysColor lib "WinLIFT32.dll" alias "skGetSysColor"(byval nC as long) as long
  declare function skLabel lib "WinLIFT32.dll" alias "skLabel"(byval hOwner as dword, zFullpathBackground as wstringz, zLabel as wstringz, _
                                                               byval x as long, byval y as long, byval xW as long, byval yH as long, byval ButID as long, byval Alignment as long) as dword
  declare function skGetLabelFont lib "WinLIFT32.dll" alias "skGetLabelFont"(byval hCtrl as dword) as dword
  declare function skGetSbVertBitmap lib "WinLIFT32.dll" alias "skGetSbVertBitmap"() as dword
  declare function skGetSbHorzBitmap lib "WinLIFT32.dll" alias "skGetSbHorzBitmap"() as dword
  declare function skGetSbPictoBitmap lib "WinLIFT32.dll" alias "skGetSbPictoBitmap"() as dword
  declare sub skPaintButton lib "WinLIFT32.dll" alias "skPaintButton"(byval hDC as dword, byval nB as long, byval hBmp as dword, byval nX as long, byval nY as long, byval xWidth as long, byval yHeight as long)
  declare sub DrawPicto lib "WinLIFT32.dll" alias "DrawPicto"(byval hDC as dword, byval nB as long, byval nX as long, byval nY as long, byval xWidth as long, byval yHeight as long)
  declare sub skSetSystemMetrics lib "WinLIFT32.dll" alias "skSetSystemMetrics"(byval nMeasure as long, byval UseValue as long)
  declare sub skRedrawNcArea lib "WinLIFT32.dll" alias "skRedrawNcArea"(byval hWnd as dword)
  declare function skMinTrackSizeX lib "WinLIFT32.dll" alias "skMinTrackSizeX"(byval hWnd as dword) as long
  declare function skMinTrackSizeY lib "WinLIFT32.dll" alias "skMinTrackSizeY"(byval hWnd as dword) as long
  declare function skUseThisBackground lib "WinLIFT32.dll" alias "skUseThisBackground"(byval hWnd as dword, zItem as wstringz) as long
  declare sub skGetClientSize lib "WinLIFT32.dll" alias "skGetClientSize"(byval hWnd as dword, byref xClient as long, byref yClient as long, byref ClientWidth as long, byref ClientHeight as long)
  declare function skAnchorInit lib "WinLIFT32.dll" alias "skAnchorInit"(byval hWnd as dword) as long
  declare function skHomotheticResize lib "WinLIFT32.dll" alias "skHomotheticResize"(byval hWnd as dword, byval bRepaint as long) as long
  declare function skAnchorResize lib "WinLIFT32.dll" alias "skAnchorResize"(byval hWnd as dword, byval bRepaint as long) as long
  declare function skAnchorID lib "WinLIFT32.dll" alias "skAnchorID"(byval hWnd as dword, byval uID as dword, byval uFlag as dword) as long
  declare function skAnchorRemoveAll lib "WinLIFT32.dll" alias "skAnchorRemoveAll"(byval hWnd as dword) as long
  declare function skUseAnchorMode lib "WinLIFT32.dll" alias "skUseAnchorMode"(byval hWnd as dword, byval UseMode as long) as long
  declare sub skSetListViewImage lib "WinLIFT32.dll" alias "skSetListViewImage"(FullPathName as wstringz, byval ReadWriteFlag as long)
  declare sub skSetToolBarImage lib "WinLIFT32.dll" alias "skSetToolBarImage"(FullPathName as wstringz, byval ReadWriteFlag as long)
  declare sub skGetWindowSize lib "WinLIFT32.dll" alias "skGetWindowSize"(byval hWnd as dword, byref x as long, byref y as long, byref WindowWidth as long, byref WindowHeight as long)
  declare function skSkinChange lib "WinLIFT32.dll" alias "skSkinChange"(zSkinFile as wstringz) as long
