Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get Disk Serial Number in fpw26
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
How to get Disk Serial Number in fpw26
Miscellaneous
Thread ID:
00586409
Message ID:
00586409
Views:
60
Hi
i'm trying to get Disk Serial No in FPW26 usin WIndows API GetVolumenInformation
and using West Wind Tech declare32 approach. BUt not succeed.

Can someone help me with this code
***rutina para averiguar serie de disco duro
SET CONFIRM OFF
SET BELL ON
SET ECHO OFF
SET DELE ON
SET TALK OFF
SET SAFETY OFF
SET HEADING OFF
SET DELIMITER OFF
SET DEVICE TO SCREEN
SET ESCAPE Off
SET CENTURY ON
SET DATE TO BRITISH
SET INTENSITY ON
SET BLINK ON
SET SYSMENU to
SET STATUS BAR OFF
*
*pantalla principal
*_screen.windowstate=2
*_screen.closable=.t.
*_screen.caption="GetVolInfo"

*local inret, icstring, lpvolname,nvolsize,lpvolnumber,;
*lpmaxcomp, lpflags,lpfsname,nfssize,lproot

*if empty(lproot)
lproot="c:\"
*endif
lpvolname=space(256)
nvolsize=256
lpvolnumber=0
lpmaxcomp=256
lpflags=0
lpfsname=space(256)
nfssize=256
set library to "c:\WINDOWS\foxtools" additive
uno = regfn("Declare32","CCC","L","CALL32.DLL")
? UNO
WAIT "PAUSA 1"
dos=callfn(uno,"GetVolumeInformation","winapi32.dll","ppiiiipi")
? DOS
WAIT "PAUSA 2"
tres=regfn("Call32","@C@CI@I@I@I@I@CL","L","CALL32.DLL")
? TRES
WAIT "PAUSA 3"
CUAT = callfn(tres,@lproot,@lpvolname,nvolsize,@lpvolnumber,@lpmaxcomp,@lpflags,@lpfsname,@nfssize,dos)

*declare integer GetVolumeInformation in win32api as getvolinfo;
*string @lproot,;
*string @lpvolname,;
*integer nvolsize,;
*integer @lpvolnumber,;
*integer @lpmaxcomp,;
*integer @lpflags,;
*string @lpfsname,;
*integer nfssize

*inret=getvolinfo(@lproot,@lpvolname,nvolsize,@lpvolnumber,@lpmaxcomp,@lpflags,@lpfsname,nfssize)

if CUAT>0
lcstring="drive name:"+alltrim(lproot)+chr(13)+;
"vol name:"+left(alltrim(lpvolname),len(alltrim(lpvolname))-1)+chr(13)+;
"max#/chars in vol name:"+alltrim(str(nvolsize))+chr(13)+;
"vol serial#:"+alltrim(str(lpvolnumber))+chr(13)+;
"max #/chars in dir/file names:"+alltrim(str(lpmaxcomp))+chr(13)+;
"file sys flags:"+alltrim(str(lpflags))+chr(13)+;
"file sys type:"+ left(alltrim(lpfsname),len(alltrim(lpfsname))-1)+chr(13)+;
"file size name:"+alltrim(str(nfssize))
else
lcstring="no sepudo ver informacion"
endif
*=messagebox(lcstring,"Informacion del volumen")
? "drive name:"+alltrim(lproot)
? "vol name:"+left(alltrim(lpvolname),len(alltrim(lpvolname))-1)
? "max#/chars in vol name:"+alltrim(str(nvolsize))
? "vol serial#:"+alltrim(str(lpvolnumber))
? "max #/chars in dir/file names:"+alltrim(str(lpmaxcomp))
? "file sys flags:"+alltrim(str(lpflags))
? "file sys type:"+ left(alltrim(lpfsname),len(alltrim(lpfsname))-1)
? "file size name:"+alltrim(str(nfssize))
wait window "pausa"

return
Thank in advance
Jorge Matheus
Next
Reply
Map
View

Click here to load this message in the networking platform