WinLIFT

There are currently two main versions of WinLIFT:

  • The Simplified API version, intended to skin existing SDK/DDT applications with ease.
  • The Standard version, intended for SDK programmers who want to have ultimate control of the graphic interface.

Simplified API version
Our goal with the "WinLIFT Simplified API" is to make skinning of existing SDK / DDT application a breeze,
using just a single call with or without optional parameters.

The main function prototype to skin a window is:
skSkinWindow(hDlg AS LONG, OPTIONAL zSysButTip AS ASCIIZ, OPTIONAL BYVAL EffectType&)

The best place to use skSkinWindow is just before to enter the main message pump,
or better at the end of the %WM_INITDIALOG callback for DDT code,
or the %WM_CREATE message for SDK coding.

Several samples are provided together with the package, they are easy to follow, because they are just skinned version of standard PowerBASIC examples, like those you can download from the source code forum.

It is possible for advanced users to match both the "Simplified API" (based on subclassing),
and the native WinLIFT's API functions.

Standard version
The Skin Engine is made of two components:

1. The engine, named SKENGINE.DLL
2. The bitmaps resources, named WinLIFT.SKL

We first created our engine, to skin our "ZAP Image solution" multimedia package in 1998.
Then we thought that this technology could be useful for other programmers as well, and we started WinLIFT.

Our skin concept is to get rid of all limitations imposed by the CreateDialog API.
We want our window to have any caption size,
put our system buttons where we want,
have new system buttons if we need some,
use borders of any size,
have full control over popup menus, and the menu bar.
We want also to use nice buttons, and the background of our choice.

This would give to our apps this unique professionnal touch that would make the difference...

WinLIFT overhead is small, the engine DLL size is less than 203 Kb uncompressed (77 Kb compressed), and with a little experience you can produce SKL resources as small as 20000 or 30000 bytes.

WinLIFT uses its own skGetSystemMetrics API based on the size of the SKL components, it uses also its own skGetSystemColor API as defined by the artist who made the skin.

WinLIFT is able to skin application created either with the CreateWindowEx or the CreateDialog API (CreateDialog = DDT for PB/WIN users).


The WinLIFT main form uses a skGetMessage function that must be put in your main WndProc to perform skinning. This function filters the messages sent to your program by Windows and informs you whether a message has been processed or not by the skin engine.


Example:

FUNCTION WndProc&(BYVAL hWnd&, BYVAL Msg&, BYVAL wParam&, BYVAL lParam&) EXPORT
    LOCAL rc AS RECT
    LOCAL ps AS PAINTSTRUCT

  ' Let the "Skin Egine" do the hard work for us...
    Ret& = skGetMessage(hWnd&, Msg&, wParam&, lParam&)
  ' If Ret& <> 0 means job done, thus we can leave from here.
    IF Ret& THEN FUNCTION = Ret&: EXIT FUNCTION

    SELECT CASE Msg&
    CASE %WM_PAINT
        SELECT CASE hWnd&
        CASE hCTL&
             CALL GetClientRect(hCTL&, rc)
             hDC& = BeginPaint(hCTL&, ps)


           ' Use the skTileBlt to paint with the skin background
            
CALL skTileBlt(hDC&, 0, 0, rc.nRight, rc.nBottom, skCtlBack)
             CALL EndPaint(hCTL&, ps)
             FUNCTION = 1: EXIT FUNCTION
        END SELECT
        CASE %WM_SYSCOMMAND
             IF wParam& = %SC_CLOSE THEN
                CALL PostQuitMessage(0)
                FUNCTION = 1: EXIT FUNCTION
             END IF
        CASE %WM_COMMAND
        END SELECT
    END SELECT
    FUNCTION = DefWindowProc(hWnd&, Msg&, wParam&, lParam&)
END FUNCTION