Author Topic: WinLIFT  (Read 44635 times)

0 Members and 1 Guest are viewing this topic.

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
WinLIFT (Matrix-skin)
« Reply #45 on: March 10, 2010, 07:31:12 PM »


...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline John Thompson

  • Newbie
  • *
  • Posts: 41
Re: WinLIFT
« Reply #46 on: March 11, 2010, 06:59:15 AM »
These designs are amazing!  I was curious about the menu.  It appears the popup menu for File and Edit align the dropdown menu's right sides with the File and Edit menu options.  Is it possible to change this to left aligned?

Also, can WinLift work on a custom drawn listview (where the background color, foreground color, and possibly font are changed)?

Thanks!

-John

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
Re: WinLIFT
« Reply #47 on: March 11, 2010, 08:59:28 AM »
Quote
It appears the popup menu for File and Edit align the dropdown menu's right sides with the File and Edit menu options.  Is it possible to change this to left aligned?
No, it is not align on the right side, it is just that i must kept a part on the left to draw the icons or check boxes when used. Also the size of the menu is using the RECT value returned by the menu-owner-drawn api, while a themed menu doesn't use them but the XP style menu instead. See the attached screen shot.

Note: I could uses exactly the same size than for a themed menu, but this is just a matter of personnal preference, perhaps an extra SKS parameter.

Quote
Also, can WinLift work on a custom drawn listview (where the background color, foreground color, and possibly font are changed)?
If you want to custom draw the listview yourself, then use the "skSkinDisable" API to disable skinning of the specified control. I could export the "skGetSysColor" API to let you retrieve the skin color theme.

And be aware that all the WinLIFT's drawing API have been rewritten to be compatible with the DWM DirectDraw surface, thus they are not using anymore GDI, but full ARGB color.

To still use GDI in your own drawing, then you must turn off DWM compatibility in this SKS file parameter:
"DWM_AERO,             0"              ' 4.70, 0 = OFF, 1 = ON (Use VISTA-SEVEN Aero composited mode)
or use a skin-theme that is XP compatible (like those shown on my web-site).

If you want to fully customize the aspect of your window, you can design your own skin and create the appropriate SKS file.
And of course you can also ask me to design a specific one just for you.

...

« Last Edit: March 11, 2010, 10:30:35 AM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
WinLIFT (Buttons - version 4.72)
« Reply #48 on: March 12, 2010, 06:18:15 PM »
The first post of this thread has been updated with version 4.72, and it is provided with a new project named "Buttons.exe".

The new demo shows you how to use the WinLIFT built-in button(s) API, altogether with the WinLIFT anchor mode.

WinLIFT's button(s) must be used AFTER the skin has been selected like this:

Code: [Select]
FUNCTION PBMAIN () AS LONG
  LOCAL hDlg AS DWORD, hCtrl AS LONG, sResource AS STRING
 
  DIALOG NEW PIXELS, 0, "Buttons",,, 480, 360, %WS_OVERLAPPEDWINDOW, 0 TO hDlg

  IF skInitEngine("Sony.sks", "") THEN
     CALL skSkinWindow(hDlg, "Dock|Undock|Minimize|Maximize|Restore|Close")

     sResource = EXE.Path$ + "Resource\"

     hCtrl = skButtonImage(hDlg, sResource + "BTN_Left.png", 216-57, 300+12, %IDC_BTN_LEFT, 5)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)

     hCtrl = skButtonImage(hDlg, sResource + "BTN_Play.png", 216, 300, %IDC_BTN_PLAY, 5)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)

     hCtrl = skButtonImage(hDlg, sResource + "BTN_Right.png", 216+49, 300+12, %IDC_BTN_RIGHT, 5)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)


     hCtrl = skPushButtonImage(hDlg, sResource + "Check_32.png", "%BS_LEFT", 20, 20, 140, 50, %IDC_BTN_CHECK, %BS_LEFT)  
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)

     hCtrl = skPushButtonImage(hDlg, sResource + "Delete_32.png", "%BS_CENTER", 20 + 140 + 8, 20, 140, 50, %IDC_BTN_CHECK, %BS_CENTER)  
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)

     hCtrl = skPushButtonImage(hDlg, sResource + "Recycle_32.png", "%BS_RIGHT", 20 + (140 + 8) * 2, 20, 140, 50, %IDC_BTN_CHECK, %BS_RIGHT)  
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)


     hCtrl = skPushButtonImage(hDlg, sResource + "Print_32.png", "%BS_TOP", 20, 20 + 70, 140, 50, %IDC_BTN_PRINT, %BS_TOP)  
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)

     hCtrl = skPushButtonImage(hDlg, "", "WITHOUT IMAGE", 20 + 140 + 8, 20 + 70, 140, 50, %IDC_BTN_TEXT, %BS_CENTER)  
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)

     hCtrl = skPushButtonImage(hDlg, sResource + "Save_32.png", "%BS_BOTTOM", 20 + (140 + 8) * 2, 20 + 70, 140, 50, %IDC_BTN_SAVE, %BS_BOTTOM)  
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)

     hCtrl = skButtonImage(hDlg, sResource + "32bit_80.png", 20, 264, %IDC_BTN_32BIT, 5)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM)

     hCtrl = skButtonImage(hDlg, sResource + "64bit_80.png", 380, 264, %IDC_BTN_64BIT, 5)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM_RIGHT)

  END IF

  DIALOG SHOW MODAL hDlg CALL DlgProc

END FUNCTION

...



« Last Edit: March 13, 2010, 06:54:20 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
WinLIFT (version 4.73 + Clock Widget)
« Reply #49 on: March 13, 2010, 07:01:13 PM »
The first post of this thread has been updated with version 4.73

The "Buttons.exe" project has been  reworked to include more buttons, and the new Clock Widget.

Here is how to use the new features:

Code: [Select]
FUNCTION PBMAIN () AS LONG
  LOCAL hDlg AS DWORD, hCtrl AS LONG, sResource AS STRING
 
  DIALOG NEW PIXELS, 0, "Buttons",,, 480, 360, %WS_OVERLAPPEDWINDOW, 0 TO hDlg

  IF skInitEngine("Sony.sks", "") THEN
     CALL skSkinWindow(hDlg, "Dock|Undock|Minimize|Maximize|Restore|Close")

     sResource = EXE.Path$ + "Resource\"

     hCtrl = skButtonImage(hDlg, sResource + "BTN_Left.png", 216-57, 300+12, %IDC_BTN_LEFT, 5)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)

     hCtrl = skButtonImage(hDlg, sResource + "BTN_Play.png", 216, 300, %IDC_BTN_PLAY, 5)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)

     hCtrl = skButtonImage(hDlg, sResource + "BTN_Right.png", 216+49, 300+12, %IDC_BTN_RIGHT, 5)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)


     hCtrl = skPushButtonImage(hDlg, sResource + "Check_32.png", "%BS_LEFT", 20, 20, 140, 50, %IDC_BTN_CHECK, %BS_LEFT) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)

     hCtrl = skPushButtonImage(hDlg, sResource + "Delete_32.png", "%BS_CENTER", 20 + 140 + 8, 20, 140, 50, %IDC_BTN_CHECK, %BS_CENTER) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)

     hCtrl = skPushButtonImage(hDlg, sResource + "Recycle_32.png", "%BS_RIGHT", 20 + (140 + 8) * 2, 20, 140, 50, %IDC_BTN_CHECK, %BS_RIGHT) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)


     hCtrl = skPushButtonImage(hDlg, sResource + "Print_32.png", "%BS_TOP", 20, 20 + 70, 140, 50, %IDC_BTN_PRINT, %BS_TOP) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)

     hCtrl = skPushButtonImage(hDlg, "", "WITHOUT IMAGE", 20 + 140 + 8, 20 + 70, 140, 50, %IDC_BTN_TEXT, %BS_CENTER) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)

     hCtrl = skPushButtonImage(hDlg, sResource + "Save_32.png", "%BS_BOTTOM", 20 + (140 + 8) * 2, 20 + 70, 140, 50, %IDC_BTN_SAVE, %BS_BOTTOM) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)

     hCtrl = skPushButtonImage(hDlg, sResource + "00_32.png", "", 40 + (40 * 0), 20 + 140, 38, 38, %IDC_BTN_00, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
     hCtrl = skPushButtonImage(hDlg, sResource + "01_32.png", "", 40 + (40 * 1), 20 + 140, 38, 38, %IDC_BTN_01, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
     hCtrl = skPushButtonImage(hDlg, sResource + "02_32.png", "", 40 + (40 * 2), 20 + 140, 38, 38, %IDC_BTN_02, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
     hCtrl = skPushButtonImage(hDlg, sResource + "03_32.png", "", 40 + (40 * 3), 20 + 140, 38, 38, %IDC_BTN_03, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
     hCtrl = skPushButtonImage(hDlg, sResource + "04_32.png", "", 40 + (40 * 4), 20 + 140, 38, 38, %IDC_BTN_04, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
     hCtrl = skPushButtonImage(hDlg, sResource + "05_32.png", "", 40 + (40 * 5), 20 + 140, 38, 38, %IDC_BTN_05, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
     hCtrl = skPushButtonImage(hDlg, sResource + "06_32.png", "", 40 + (40 * 6), 20 + 140, 38, 38, %IDC_BTN_06, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
     hCtrl = skPushButtonImage(hDlg, sResource + "07_32.png", "", 40 + (40 * 7), 20 + 140, 38, 38, %IDC_BTN_07, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
     hCtrl = skPushButtonImage(hDlg, sResource + "08_32.png", "", 40 + (40 * 8), 20 + 140, 38, 38, %IDC_BTN_08, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
     hCtrl = skPushButtonImage(hDlg, sResource + "09_32.png", "", 40 + (40 * 9), 20 + 140, 38, 38, %IDC_BTN_09, 0) 
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)


'    // 4.73 WinLIFT clock
'    hCtrl = skClockCtrl(hDlg, sResource + "Clock_06_92.png", 14, 258, 0, 0, %IDC_CLOCK, &HFFCBCBCB, &H7F9F9F9F, 0)
'    hCtrl = skClockCtrl(hDlg, sResource + "Clock_02_92.png", 14, 258, 0, 0, %IDC_CLOCK, &H7FCB0000, &H7F8F8F8F, 0)
'    hCtrl = skClockCtrl(hDlg, sResource + "Clock_03_92.png", 14, 258, 0, 0, %IDC_CLOCK, &H7FCB0000, &H7F8F8F8F, 0)
     hCtrl = skClockCtrl(hDlg, sResource + "Clock_01_92.png", 14, 258, 0, 0, %IDC_CLOCK, &H7FCB0000, &H7F8F8F8F, 0)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM)

'    hCtrl = skButtonImage(hDlg, sResource + "32bit_80.png", 20, 264, %IDC_BTN_32BIT, 5)
'    CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM)

     hCtrl = skButtonImage(hDlg, sResource + "64bit_80.png", 380, 264, %IDC_BTN_64BIT, 5)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM_RIGHT)

  END IF

  DIALOG SHOW MODAL hDlg CALL DlgProc

END FUNCTION


And the result is



Note: You can edit the source code to try different Clock Widget background.

...



Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
Re: WinLIFT
« Reply #50 on: March 14, 2010, 03:16:05 PM »
Attached are two extra clock widget backgrounds (very nice).

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
Zooming (WinLIFT/GDImage project for VISTA/SEVEN)
« Reply #51 on: March 16, 2010, 06:51:59 PM »
Attached to this post you will find the Zooming project + WinLIFT version 4.74.

There are two images, using variable opacity, in the "Resource" subfolder to play with.

Better to play the demo hover a dark background, to see the halo and all the transparency effects.

This demo embeds a GDImage zoom graphic control, to use the exclusive composited Crystal mode, rather than AERO blur. But you can still change the background.

This project was done to see how far i could go with WinLIFT and the DWM technology.



...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
WinLIFT (version 4.78 skSkinWindowUpdate)
« Reply #52 on: March 21, 2010, 03:44:46 PM »
Quote
Hi Patrice,
that I have thought of that, all creating, not show it. And then the View tab if it is needed. But would it for love Dynamic. Need it that is for my CD database. For example, if a cover for a CD in the database because it is intended to show a tab with an image control. But I can wait there is no hurry for me. 'm Sure you make it!
Regards Peter  

Peter,

WinLIFT version 4.78 is attached to this post.

I have reworked the new API skSkinWindowUpdate below, to let it work with the example your posted in the "tabcontrolmore.bas" project.

Code: [Select]
'// 4.77 Use this when new controls are added AFTER the initial skinning of the main window.
  DECLARE SUB skSkinWindowUpdate LIB "WinLIFT.dll" ALIAS "skSkinWindowUpdate" ( _
  BYVAL hWnd AS LONG, _              ' The main window handle.
  BYVAL RedrawFlag AS LONG _         ' Redraw boolean flag.
  )

Note: hWnd must be the handle of the main window.

...
« Last Edit: March 22, 2010, 11:36:58 AM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
WinLIFT (version 4.79)
« Reply #53 on: March 22, 2010, 11:36:19 AM »
The first post of this thread has been updated to version 4.79.

New: The gauge.bas demo has been added to the ZIP file.
Fix: Using %WM_SETTEXT on a hidden control, doesn't show it anymore.

...  
« Last Edit: March 22, 2010, 02:20:36 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
WinLIFT (skinning common dialog)
« Reply #54 on: March 26, 2010, 02:13:40 PM »
I have been asked if WinLIFT could be used to skin a Windows common dialog.

I did try with the common OpenFile dialog, and here is the result:



It is not 100% perfect, because i can't take control over the scrollbars, and the Folder ListView is not skinned because its is an encapsulation of the SHELLDLL_DefView.

To do this, you need to hook the common dialog, using the lpfnHook member of the OPENFILENAME structure.

Then you must handle %CDN_INITDONE in the %WM_NOTIFY callback to retrieve the handle of the common dialog and skin it on the fly. If everything went fine, you should got the same result than in the above screen shot.

If interrested i could post a new version of the Gauge project, showing the skinning of the GDImage custom OpenFile, the one that has been captured to create the screen shot.

...


« Last Edit: March 26, 2010, 02:16:51 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
WinLIFT (version 4.82)
« Reply #55 on: March 28, 2010, 11:06:50 AM »
The first post of this thread has been updated with WinLIFT version 4.82

Many changes (mostly not visible) have been made to this version, especialy to make WinLIFT and GDImage full compatible.

The Gauge project has been reworked to use a fixed watermark logo overlay in the GDImage control.
And the GDImage OpenFileDialog is now skinned on the fly, to show you that it is possible to apply the WinLIFT theme to a common dialog.

You are encouraged to update to this version, and play again with the Gauge project.



Here is the generic code to skin a common OpenFileDialog:
Code: [Select]
' Dialog hook procedure, for centering the dialog and apply skin on the fly.
FUNCTION zDlgHookProc(BYVAL hWnd AS LONG, BYVAL Msg AS LONG, BYVAL wParam AS LONG, BYVAL lParam AS LONG) AS LONG

    LOCAL rw AS RECT, rc AS RECT, ofnPtr AS OFNOTIFY PTR, zTxt AS ASCIIZ * %MAX_PATH
    LOCAL lp AS POINTAPI
    LOCAL hDLL, hPROC, nCenterDlg, hFound, hParent, hSysListView AS DWORD

    STATIC hWndPreview, SquareSize AS LONG

    SELECT CASE LONG Msg

    CASE %WM_NOTIFY

         ofnPtr = lParam
         SELECT CASE LONG @ofnPtr.hdr.Code

         CASE %CDN_INITDONE

              hParent = GetParent(hWnd)

              CALL ShowWindow(hParent, %SW_HIDE)

              hSysListView = GetDlgItem(hParent, %lst1)

              CALL GetWindowRect(hSysListView, rw)
              lp.X = rw.nLeft: lp.Y = rw.nTop: CALL ScreenToClient(hParent, lp) ' 11-03-2003
              yPos& = lp.Y
              SquareSize = rw.nBottom - rw.nTop
              IF GetSystemMetrics(%SM_CXSCREEN) < 801 THEN
                 SquareSize = MIN&(150, SquareSize)
              END IF

              CALL GetClientRect(hParent, rc)       ' Get dialog pos. and size
              xPos& = rc.nRight                      ' New width

              Style& = %WS_CHILD OR %WS_VISIBLE ' OR %WS_BORDER
              StyleEx& = %WS_EX_STATICEDGE
              hWndPreview = CreateWindowEx(StyleEx&, $GDImageClassName, _
                                 "", _               ' Optional full path name to picture
                                 Style&, _
                                 xPos&, yPos&, SquareSize, SquareSize, _
                                 hParent, _
                                 %NULL, _
                                 zInstance,_
                                 BYVAL 0)                 ' creation parameters
              CALL ZI_SetProperty(hWndPreview, %ZI_GradientTop, GetSysColor(%COLOR_BTNSHADOW))
              CALL ZI_SetProperty(hWndPreview, %ZI_GradientBottom, GetSysColor(%COLOR_BTNSHADOW))
              CALL ZI_SetProperty(hWndPreview, %ZI_FitToWindow, %ZI_QualityDefault)

            ' Set new size and center dialog in program window
              CALL GetWindowRect(GetParent(hParent), rc)     ' Get program pos. and size
              W& = rc.nRight  - rc.nLeft
              H& = rc.nBottom - rc.nTop
              x& = rc.nLeft + (W& \ 2)                        ' Relative Center x&
              y& = rc.nTop  + (H& \ 2)                        ' Relative Center y&


              CALL GetWindowRect(hParent, rc)                ' Get dialog pos. and size
              W& = rc.nRight  - rc.nLeft + SquareSize + 7    ' New width
              H& = rc.nBottom - rc.nTop                       ' Same height
              x& = x& - (W& \ 2)                              ' Centered in program
              y& = y& - (H& \ 2)

              CALL SetWindowPos(hParent, hParent, x&, y&, W&, H&, %SWP_NOZORDER) ' Resize and center

'             // Skin the dialog on the fly.
              CALL skSkinWindow(hParent, "Dock|Undock|Minimize|Maximize|Restore|Close")
              CALL ShowWindow(hParent, %SW_SHOW)

              FUNCTION = 1: EXIT FUNCTION

         CASE %CDN_SELCHANGE ' Triggered when the selection changes in the file listbox
              picFileName$ = SPACE$(%MAX_PATH)
              df& = Sendmessage(@ofnPtr.hdr.hwndFrom, %CDM_GETFILEPATH, LEN(picFileName$), STRPTR(picFileName$))
              IF df& > 0 THEN
                 picFileName$ = LEFT$(picFileName$, df& - 1)
                 So& = INSTR(-1, picFileName$, $Dot)
                 IF So& THEN
                    ImgType$ = UCASE$(MID$(picFileName$, So&)) + $Dot
                    ImageType& = INSTR($GDIPLUSEXT, ImgType$)
                    IF ImageType& THEN

                       NewImage& = zLoadImageFromFile((picFileName$), bmW&, bmH&, 0)
                       IF zSetGdipImageHandle(hWndPreview, NewImage&) THEN CALL ZI_UpdateWindow(hWndPreview, %TRUE)

                    END IF
                 END IF
'
              END IF
              picFileName$ = ""

         CASE %CDN_TYPECHANGE
            ' Standard Save dialog blindly adds new extension, this changes it properly instead
              IF @ofnPtr.@lpOFN.nFilterIndex < 5 THEN             ' ignore last one, *.*
                 hftCombo& = GetDlgItem(GetParent(hWnd), %cmb1)  ' handle, File type combo
                 IF zOsVersion < 500 THEN ID& = %edt1 ELSE ID& = %cmb13
                 hftEdit&  = GetDlgItem(GetParent(hWnd), ID&)    ' handle, File name text field
                 CALL GetWindowText(hftEdit&, zTxt, SIZEOF(zTxt)) ' get name in text field
                 IF LEN(zTxt) THEN                                ' if we have something
                    lRes& = INSTR(-1, zTxt, $Dot)                 ' look for prefix (file type part)
                    IF lRes& THEN zTxt = LEFT$(zTxt, lRes& - 1)   ' if success, remove prefix
                    SELECT CASE LONG @ofnPtr.@lpOFN.nFilterIndex  ' compare selection against combo list
                    CASE 1: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 1)) ' ".png"                  ' and add matching prefix
                    CASE 2: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 2)) ' ".jpg"
                    CASE 3: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 3)) ' ".bmp"
                    CASE 4: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 4)) ' ".tif"
                    CASE 5: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 5)) ' ".gif"
                    CASE 6: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 6)) ' ".zmi"
                    END SELECT
                    CALL SetWindowText(hftEdit&, zTxt)            ' set corrected name to text field
                END IF
             END IF
         END SELECT

    CASE %WM_DESTROY ' Destroy what we have created to avoid nasty memory leaks

    END SELECT

END FUNCTION

FUNCTION zOpenFileDialog (BYVAL hWnd AS DWORD, _           ' parent window
                          BYVAL sCaption AS STRING, _      ' caption
                          BYREF sFilespec AS STRING, _     ' filename
                          BYVAL sInitialDir AS STRING, _   ' start directory
                          BYVAL sFilter AS STRING, _       ' filename filter
                          BYVAL sDefExtension AS STRING, _ ' default extension
                          BYREF dFlags AS DWORD ) AS LONG   ' flags

    LOCAL ix AS LONG, Ofn AS OPENFILENAME
    LOCAL zFileTitle  AS ASCIIZ * %MAX_PATH

    REPLACE $zLim WITH $NUL IN sFilter

    IF LEN(sInitialDir) = 0 THEN sInitialDir = CURDIR$

    ix = INSTR(sFileSpec, $NUL)
    IF ix THEN
        sFileSpec = LEFT$(sFileSpec, ix) + SPACE$(8192 - ix)
    ELSE
        sFileSpec = sFileSpec + $NUL + SPACE$(8192 - (LEN(sFileSpec) + 1))
    END IF

    ofn.lStructSize       = SIZEOF(ofn)
    ofn.hWndOwner         = hWnd
    ofn.lpstrFilter       = STRPTR(sFilter)
    ofn.lpstrFile         = STRPTR(sFilespec)
    ofn.nMaxFile          = LEN(sFilespec)
    ofn.lpstrFileTitle    = VARPTR(zFileTitle)
    ofn.nMaxFileTitle     = SIZEOF(zFileTitle)
    ofn.lpstrInitialDir   = STRPTR(sInitialDir)
    IF LEN(sCaption) THEN
       ofn.lpstrTitle     = STRPTR(sCaption)
    END IF
    ofn.Flags             = dFlags
    ofn.lpfnHook          = CODEPTR(zDlgHookProc)
    ofn.lpstrDefExt       = STRPTR(sDefExtension)

    'Note: following Select Case table must be adjusted to match used Filter string
    '      (also remember to do the same in zDlgHookProc procedure..)
    UperExt$ = UCASE$(sDefExtension)
    IF UperExt$     = PARSE$(cfgStr$(40), 1) THEN
                      ofn.nFilterIndex = 1 ' PNG nFilterIndex decides Filytype combo's listitem
    ELSEIF UperExt$ = PARSE$(cfgStr$(40), 2) THEN
                      ofn.nFilterIndex = 2 ' JPG
    ELSEIF UperExt$ = PARSE$(cfgStr$(40), 3) THEN
                      ofn.nFilterIndex = 3 ' BMP
    ELSEIF UperExt$ = PARSE$(cfgStr$(40), 4) THEN
                      ofn.nFilterIndex = 4 ' TIF
    ELSE
                      ofn.nFilterIndex = 8 ' *.*
    END IF

    FUNCTION = GetOpenFilename(ofn)

    dFlags   = ofn.Flags

END FUNCTION



...
« Last Edit: March 28, 2010, 11:15:13 AM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
WinLIFT (FF3 project)
« Reply #56 on: April 02, 2010, 10:01:53 AM »
I have posted a new "Panorama 360" project on the FireFly forum.

See attached screen shot.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
WinLIFT (version 4.85)
« Reply #57 on: April 04, 2010, 02:45:15 PM »
The first post of this thread has been updated to WinLIFT version 4.85

New API:

Code: [Select]
 DECLARE FUNCTION skStaticImage LIB "WinLIFT.dll" ALIAS "skStaticImage" ( _
  BYVAL hOwner AS LONG, _            ' Handle of the window parent owner.
  zFullpathImageName AS ASCIIZ, _    ' Full path name to the static image.
  BYVAL x AS LONG, _                 ' X location of the static image control.
  BYVAL y AS LONG, _                 ' Y location of the static image control.
  BYVAL W AS LONG, _                 ' Width of the static image control.
  BYVAL H AS LONG, _                 ' Height of the static image control.
  BYVAL nID AS LONG _                ' Unique ID of the static image control.
  ) AS LONG
Code: [Select]
 DECLARE SUB skSetZorder LIB "WinLIFT.dll" ALIAS "skSetZorder" ( _
  BYVAL hCtrl AS LONG, _             ' Handle of the child control.
  BYVAL UseOrder AS LONG _           ' %HWND_ constant or another child control handle.
  )



The "Buttons.bas" project has been updated, to show you how to use them, see below:

Code: [Select]
'    // Version 4.85
     hCtrl = skStaticImage(hDlg, sResource + "Aero.png", 10, 10, 460, 208, %IDC_FRAME)
     CALL skSetZorder(hCtrl, %HWND_BOTTOM)
     CALL skSetAnchorCtrl(hCtrl, %ANCHOR_HEIGHT_WIDTH)
'    // Version 4.85
     hCtrl = skStaticImage(hDlg, sResource + "makeuplips.png", -20, -70, 200, 134, %IDC_LIPS)
     CALL skSetZorder(hCtrl, %HWND_TOP)

...
« Last Edit: April 04, 2010, 02:48:37 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2402
  • Gender: Male
    • www.zapsolution.com
New WinLIFT CHM help file.
« Reply #58 on: November 18, 2010, 11:53:10 AM »
The new WinLIFT CHM help zip file has been attached to the first post of this thread



...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 351
  • Gender: Male
Re: WinLIFT
« Reply #59 on: November 18, 2010, 09:23:56 PM »
Hi Patrice,
Thanks for the help file! Good idea! ;D
Regards Peter