jorgematheus
Programmer
- Nov 23, 2001
- 5
Hi
I'm trying to get the Disk Serial number from FPW 2.6a
using WInd West Tch approach using declare32, but not
succeed.
Can someone help out here.
Here is the 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
lproot="c:\"
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
dos=callfn(uno,"GetVolumeInformation","win32api.dll","ppiiiipi"
? DOS
tres=regfn("Call32","@C@CI@I@I@I@CIL","L","CALL32.DLL"
? TRES
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 advace
I'm trying to get the Disk Serial number from FPW 2.6a
using WInd West Tch approach using declare32, but not
succeed.
Can someone help out here.
Here is the 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
lproot="c:\"
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
dos=callfn(uno,"GetVolumeInformation","win32api.dll","ppiiiipi"
? DOS
tres=regfn("Call32","@C@CI@I@I@I@CIL","L","CALL32.DLL"
? TRES
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 advace