FWH 1801: Application Icons

FWH 1801: Application Icons

Postby nageswaragunupudi » Sun Feb 18, 2018 6:46 am

It is now extremely easy to extract the application icon of any file on the disk. The default image reading function of FWH read image from an image file and application icon from non-image files.

Simple test:
Code: Select all  Expand view  RUN
#include "fivewin.ch"

function Main()

   local oWnd

   DEFINE WINDOW oWnd
   ACTIVATE WINDOW oWnd ;
      ON PAINT oWnd:DrawImage( "c:\mydocs\eva.pptx(256x256)" )

return nil
 


Image

Sample-2
Code: Select all  Expand view  RUN
#include "fivewin.ch"

function Main()

   local cPath := "c:\mydocs\"
   local aDir  := DIRECTORY( cPath + "
*.*" )

   AEval( aDir, { |a| a[ 2 ] := cPath + a[ 1 ] } )

   XBROWSER aDir COLUMNS 2,1 SETUP ( ;
      oBrw:aCols[ 1 ]:cDataType     := "
F", ;
      oBrw:aCols[ 1 ]:nDataBmpAlign := AL_CENTER, ;
      oBrw:aCols[ 1 ]:nWidth        := 40, ;
      oBrw:nRowHeight               := 40  )

return nil


Image

Sample-3
Code: Select all  Expand view  RUN
#include "fivewin.ch"

function Main()

   local oDlg, oFont, oBrw, oImage
   local cPath := "c:\mydocs\"
   local aDir  := DIRECTORY( cPath + "
*.*" )

   DEFINE FONT oFont NAME "
TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 540,400 PIXEL TRUEPIXEL FONT oFont

   @  20, 20 XBROWSE oBrw SIZE 170,-20 PIXEL OF oDlg ;
      DATASOURCE aDir COLUMNS 1 HEADERS "
File" ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      :nStretchCol   := 1
      :bChange       := { || oImage:Refresh() }
      //
      :CreateFromCode()
   END

   @  72,200 XIMAGE oImage SOURCE { || cPath + oBrw:aRow[ 1 ] + "
(256X256)" } ;
      SIZE 256,256 OF oDlg

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests