home *** CD-ROM | disk | FTP | other *** search
/ Instant Calendar / SOFTKEY.iso / disk1 / msdetect.inc < prev    next >
Text File  |  1994-01-27  |  3KB  |  67 lines

  1. DECLARE FUNCTION CbGetVersionOfFile LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  2. DECLARE FUNCTION LGetVersionNthField LIB "msdetstf.dll" (szVersion$, nField%) AS LONG
  3. DECLARE FUNCTION LcbFreeDrive LIB "msdetstf.dll" (nDrive%) AS LONG
  4. DECLARE FUNCTION FDirExists LIB "msdetstf.dll" (szDir$) AS INTEGER
  5. DECLARE FUNCTION FDoesFileExist LIB "msdetstf.dll" (szFileName$, mode%) AS INTEGER
  6. DECLARE FUNCTION CbGetIniKeyString LIB "msdetstf.dll" (szFile$, szSect$, szKey$, szBuf$, cbBuf%) AS INTEGER
  7. DECLARE FUNCTION CbFindFileInTree LIB "msdetstf.dll" (szFile$, szDir$, szBuf$, cbBuf%) AS INTEGER
  8. DECLARE FUNCTION GetFreeSpaceForDrive (szDrive$) AS LONG
  9. DECLARE FUNCTION DoesFileExist (szFile$, mode%) AS INTEGER
  10. DECLARE FUNCTION FindFileInTree (szFile$, szDir$) AS STRING
  11. DECLARE FUNCTION DoesDirExist (szDir$) AS INTEGER
  12. DECLARE FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) AS STRING
  13. DECLARE FUNCTION GetVersionOfFile (szFile$) AS STRING
  14. DECLARE FUNCTION GetVersionNthField (szVersion$, nField%) AS LONG
  15.  
  16. '' 101 FUNCTION GetTotalSpaceForDrive (szDrive$) STATIC  AS LONG
  17. '' 101 GetTotalSpaceForDrive = LcbTotalDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  18. '' 101 END FUNCTION
  19.  
  20. FUNCTION GetFreeSpaceForDrive (szDrive$) STATIC  AS LONG
  21. GetFreeSpaceForDrive = LcbFreeDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  22. END FUNCTION
  23.  
  24. FUNCTION DoesFileExist (szFileName$, mode%) STATIC  AS INTEGER
  25. DoesFileExist = FDoesFileExist(szFileName$, mode%)
  26. END FUNCTION
  27.  
  28.  
  29. FUNCTION FindFileInTree (szFile$, szDir$) STATIC  AS STRING
  30. cb% = 512
  31. szBuf$ = STRING$(cb%, 32)
  32. cbRet% = CbFindFileInTree(szFile$, szDir$, szBuf$, cb%)
  33. FindFileInTree = szBuf$
  34. szBuf$ = ""
  35. END FUNCTION
  36.  
  37. FUNCTION DoesDirExist (szDir$) STATIC AS INTEGER
  38. DoesDirExist = FDirExists(szDir$)
  39. END FUNCTION
  40.  
  41. FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) STATIC  AS STRING
  42. cb% = 512
  43. szBuf$ = STRING$(cb%, 32)
  44. cbRet% = CbGetIniKeyString(szFile$, szSect$, szKey$, szBuf$, cb%)
  45. GetIniKeyString = szBuf$
  46. szBuf$ = ""
  47. END FUNCTION
  48.  
  49. '*************************************************************************
  50. FUNCTION GetVersionOfFile (szFile$) STATIC  AS STRING
  51. cb% = 30
  52. szBuf$ = STRING$(cb%, 32)
  53. cbRet% = CbGetVersionOfFile(szFile$, szBuf$, cb%)
  54. GetVersionOfFile = szBuf$
  55. szBuf$ = ""
  56. END FUNCTION
  57.  
  58. '*************************************************************************
  59. FUNCTION GetVersionNthField (szVersion$, nField%) STATIC  AS LONG
  60. '$ifdef DEBUG
  61. if (nField% < 1) OR (nField% > 4) then
  62.   BadArgErr 2, "GetVersionNthField", szVersion$+", "+STR$(nField%)
  63. end if
  64. '$endif ''DEBUG
  65. GetVersionNthField = LGetVersionNthField(szVersion$, nField%)
  66. END FUNCTION
  67.