Results 1 to 2 of 2

Thread: PowerBASIC - WinLIFT Skin Engine + animated bitmap

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Location
    Blue planet
    Posts
    15

    PowerBASIC - WinLIFT Skin Engine + animated bitmap

    'This is a PowerBASIC example (http://www.powerbasic.com)
    '
    'However it could be easily translated to either C, Delphi or VB.
    'because it uses only native Windows SDK API syntax code.
    '
    'source code + exe could be downloaded from there:
    'http://www.zapsolution.com/preview/skinwin.zip
    '(size of the ZIP file: 137115 bytes)
    '(size of SKINWIN.EXE 10240 bytes)
    '(size of SKINENGINE.DLL + SKSDKAPI.DLL 79822 + 22528 bytes)
    'No runtime required.
    '
    ' ---------------------------------------------------------------------------------
    '
    'There are more than 40 skins available for the WinLIFT SkinEngine
    'You can learn more about the engine from this url:
    'http://www.zapsolution.com/winlift/index.htm
    '
    'The main WinLIFT demo including the GDI+ helper is available from:
    'http://www.zapsolution.com/preview/WinLIFT.exe
    '
    '
    'You just require one single line of code to skin a window!
    'Ret& = skSkinMainWindow(hWnd&, CaptionTip$)
    '
    '
    VB Code:
    1. '+--------------------------------------------------------------------------+
    2. '|                                                                          |
    3. '|                                SkinWIN                                   |
    4. '|                                                                          |
    5. '|                 Windows SDK programming style template.                  |
    6. '|                                                                          |
    7. '|                           WinLIFT SkinEngine                             |
    8. '|                                                                          |
    9. '|                              Version 3.00                                |
    10. '|                                                                          |
    11. '+--------------------------------------------------------------------------+
    12. '|                                                                          |
    13. '|                         Author Patrice TERRIER                           |
    14. '|            8 Domaine de Rochagnon. 38800 Champagnier  FRANCE             |
    15. '|                       [url]http://www.zapsolution.com[/url]                         |
    16. '|                    E-mail: [email][email protected][/email]                      |
    17. '|                                                                          |
    18. '|                   copyright (c) 2003 Patrice TERRIER                     |
    19. '|                                                                          |
    20. '+--------------------------------------------------------------------------+
    21. '|                  Project started on : 02-24-2003                         |
    22. '|                        Last revised : 02-24-2003                         |
    23. '+--------------------------------------------------------------------------+
    24.  
    25. #COMPILE EXE "skinwin.exe"
    26. #INCLUDE "win32api.inc"
    27.  
    28. '/////////////////////////////////////////////////////////////////////////////////////
    29. DECLARE FUNCTION skAnimate LIB "SKENGINE.DLL" ALIAS "SKANIMATE" (BYVAL hParent&, BYVAL hBitmap&, BYVAL x&, BYVAL y&) AS LONG
    30. DECLARE FUNCTION skLoadImage LIB "SKENGINE.DLL" ALIAS "SKLOADIMAGE" (BYVAL BmpFile$) AS LONG
    31. DECLARE FUNCTION skSkinMainWindow LIB "skSDKapi.dll" ALIAS "skSkinMainWindow" (BYVAL hWnd&, OPTIONAL BYVAL SysButTip$) AS LONG
    32. '/////////////////////////////////////////////////////////////////////////////////////
    33.  
    34. FUNCTION WndProc(BYVAL hWnd& , BYVAL Msg&, BYVAL wParam&, BYVAL lParam&) AS LONG
    35.  
    36.     LOCAL rc AS RECT
    37.     LOCAL ps AS PAINTSTRUCT
    38.  
    39.     SELECT CASE Msg&
    40.     CASE %WM_DESTROY
    41.          CALL PostQuitMessage(0)
    42.     END SELECT
    43.  
    44.     FUNCTION = DefWindowProc(hWnd&, Msg&, wParam&, lParam&)
    45.  
    46. END FUNCTION
    47.  
    48. FUNCTION WinMain (BYVAL hInstance     AS LONG, _
    49.                   BYVAL hPrevInstance AS LONG, _
    50.                   BYVAL lpCmdLine     AS ASCIIZ PTR, _
    51.                   BYVAL iCmdShow      AS LONG) AS LONG
    52.  
    53.     LOCAL msg         AS tagMSG
    54.     LOCAL wc          AS WNDCLASSEX
    55.     LOCAL szClassName AS ASCIIZ * 128
    56.     szClassName = "SkinWin"
    57.  
    58.     IF ISFALSE(hPrevInstance&) THEN
    59.        wc.cbSize        = SIZEOF(wc)
    60.        wc.style         = %CS_HREDRAW OR %CS_VREDRAW
    61.        wc.lpfnWndProc   = CODEPTR(WndProc)
    62.        wc.cbClsExtra    = 0
    63.        wc.cbWndExtra    = 0
    64.        wc.hInstance     = hInstance&
    65.        wc.hIcon         = LoadIcon(%NULL, BYVAL %IDI_APPLICATION)
    66.        wc.hCursor       = LoadCursor(%NULL, BYVAL %IDC_ARROW)
    67.        wc.hbrBackground = GetStockObject(%BLACK_BRUSH)
    68.        wc.lpszMenuName  = %NULL
    69.        wc.lpszClassName = VARPTR(szClassName)
    70.        wc.hIconSm       = LoadIcon(%NULL, BYVAL %IDI_APPLICATION)
    71.        CALL RegisterClassEx(wc)
    72.     END IF
    73.     hWnd& = CreateWindowEx(0, _
    74.                            szClassName, _          ' window class name
    75.                            "WinLIFT [url]http://www.zapsolution.com[/url]", _ ' window caption
    76.                            %WS_OVERLAPPEDWINDOW, _ ' window style
    77.                            %CW_USEDEFAULT, _       ' initial x position
    78.                            %CW_USEDEFAULT, _       ' initial y position
    79.                            %CW_USEDEFAULT, _       ' initial x size
    80.                            %CW_USEDEFAULT, _       ' initial y size
    81.                            %NULL, _                ' parent window handle
    82.                            %NULL, _                ' window menu handle
    83.                            hInstance&, _           ' program instance handle
    84.                            BYVAL %NULL)            ' creation parameters
    85.     IF hWnd& THEN                              
    86.  
    87. '///////////////////////////////////////////////////////////////////////
    88.        CaptionTip$ = "Dock|Undock|Minimize|Maximize|Restore|Close"
    89.        [COLOR=red]Ret& = skSkinMainWindow(hWnd&, CaptionTip$)[/COLOR]
    90.      ' Ret& = %FALSE means unable to skin the window  
    91.      ' Ret& = %TRUE skinning has been done  
    92.  
    93.        CALL skAnimate(hWnd&, skLoadImage("HEART.BMP"), 20, 50)  
    94.  
    95. '///////////////////////////////////////////////////////////////////////
    96.  
    97.        CALL ShowWindow(hWnd&, %SW_SHOW)
    98.        CALL UpdateWindow(hWnd&)
    99.  
    100.        DO WHILE GetMessage(msg, %NULL, 0, 0)
    101.           TranslateMessage msg
    102.           DispatchMessage msg
    103.        LOOP
    104.  
    105.        FUNCTION = msg.wParam
    106.     END IF
    107.  
    108. END FUNCTION
    109. '
    Patrice Terrier

    [email protected]
    http://www.zapsolution.com
    Toolkit: WinLIFT (Skin Engine), GDI+ helper (Graphic package), dvBTree (Index manager)
    Multimedia: ZAP Image Solution, ZAP Media Browser, ZAP Slide Show, ZAP Audio Player, ZAP Picture Browser.
    ArtWork on demand.

  2. #2

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Location
    Blue planet
    Posts
    15
    I just updated the SkinWin.ZIP demo with new WinLIFT controls
    and a new skin for the fun.

    The new controls are:

    VB Code:
    1. CALL [b]skButtonPush[/b](hWnd&, "My push button", 0, 100, 20, 120, 20, 1)
    2.  
    3. CALL [b]skButtonRadio[/b](hWnd&, "My radio button 1", 0, 100, 50, 140, 20, 2)
    4. CALL skButtonRadio(hWnd&, "My radio button 2", 0, 100, 70, 140, 20, 2)
    5.        
    6. CALL [b]skButtonCheck[/b](hWnd&, "My check button", 0, 100, 100, 140, 20, 3)

    See the header section of the provided source code for declaration prototype

    Here is the link to download the new file:
    http://www.zapsolution.com/preview/skinwin.zip
    Patrice Terrier

    [email protected]
    http://www.zapsolution.com
    Toolkit: WinLIFT (Skin Engine), GDI+ helper (Graphic package), dvBTree (Index manager)
    Multimedia: ZAP Image Solution, ZAP Media Browser, ZAP Slide Show, ZAP Audio Player, ZAP Picture Browser.
    ArtWork on demand.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width