Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Progress bar caption
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Progress bar caption
Divers
Thread ID:
01220884
Message ID:
01220884
Vues:
74
The function below is progress bar to copy file in windows

It the funcion below, anybody knows how to modify the caption
of the windows of the progress bar ?
************************************************************
FUNCTION FileOpWithProgressbar
#INCLUDE SHFileOperation.h

LPARAMETERS tcSource, tcDestination, tcAction, tlUserCanceled
LOCAL lcSourceString, lcDestString, nStringBase, lcFileOpStruct, lnFlag, lnStringBase
LOCAL loHeap, lcAction, lnRetCode, llCanceled, laActionList[1]

DECLARE INTEGER SHFileOperation IN SHELL32.DLL STRING @ LPSHFILEOPSTRUCT
SET PROCEDURE TO CLSHEAP ADDITIVE
loHeap = CREATEOBJ('Heap')

lcAction = UPPER(IIF( Empty( tcAction) Or VarType(tcAction) <> "C", "COPY", tcAction))
* Convert Action name into function parameter
ALINES(laActionList, "MOVE,COPY,DELETE,RENAME", ",")
lnAction = ASCAN(laActionList, lcAction)
IF lnAction = 0
	* Unknown action
	RETURN Null
ENDIF

lcSourceString = tcSource + CHR(0) + CHR(0)
lcDestString   = tcDestination + CHR(0) + CHR(0)
lnStringBase   = loHeap.AllocBlob(lcSourceString+lcDestString)

lnFlag = FOF_NOCONFIRMATION + FOF_NOCONFIRMMKDIR + FOF_NOERRORUI


lcFileOpStruct  = NumToLONG(_screen.hWnd) + ;
                NumToLONG(lnAction) + ;
                NumToLONG(lnStringBase) + ;
                NumToLONG(lnStringBase + LEN(lcSourceString)) + ;
                NumToWORD(lnFlag) + ;
                NumToLONG(0) + NumToLONG(0) + NumToLONG(0)

lnRetCode = SHFileOperation(@lcFileOpStruct) 

* Did user canceled operation?
tlUserCanceled= ( SUBSTR(lcFileOpStruct, 19, 4) <> NumToLONG(0) )

RETURN (lnRetCode = 0)

***********************************
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform