home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / m / m051 / 1.img / MSDETECT.IN_ / MSDETECT.IN
Encoding:
Text File  |  1992-05-15  |  8.3 KB  |  240 lines

  1. '**************************************************************************
  2. '*************************  Setup Detect API's  ***************************
  3. '**************************************************************************
  4. ''Removed unused functions - FREM 03/04/92
  5.  
  6. ''detect
  7.  
  8. DECLARE FUNCTION CbGetEnvVariableValue LIB "msdetstf.dll" (szEnvVar$, szBuf$, cbBuf%) AS INTEGER
  9. DECLARE FUNCTION CbGetVersionOfFile LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  10. DECLARE FUNCTION LGetVersionNthField LIB "msdetstf.dll" (szVersion$, nField%) AS LONG
  11. DECLARE FUNCTION LcbGetSizeOfFile LIB "msdetstf.dll" (szFile$) AS LONG
  12. DECLARE FUNCTION FGetValidDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  13. DECLARE FUNCTION FGetLocalHardDrivesList LIB "msdetstf.dll" (szSymbol$) AS INTEGER
  14. DECLARE FUNCTION LcbTotalDrive LIB "msdetstf.dll" (nDrive%) AS LONG
  15. DECLARE FUNCTION LcbFreeDrive LIB "msdetstf.dll" (nDrive%) AS LONG
  16. DECLARE FUNCTION FIsLocalHardDrive LIB "msdetstf.dll" (nDrive%) AS INTEGER
  17. DECLARE FUNCTION FDirExists LIB "msdetstf.dll" (szDir$) AS INTEGER
  18. DECLARE FUNCTION FDoesFileExist LIB "msdetstf.dll" (szFileName$, mode%) AS INTEGER
  19. DECLARE FUNCTION CbGetDateOfFile LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  20. DECLARE FUNCTION FDoesIniSectionExist LIB "msdetstf.dll" (szFile$, szSect$) AS INTEGER
  21. DECLARE FUNCTION FDoesIniKeyExist LIB "msdetstf.dll" (szFile$, szSect$, szKey$) AS INTEGER
  22. DECLARE FUNCTION CbGetIniKeyString LIB "msdetstf.dll" (szFile$, szSect$, szKey$, szBuf$, cbBuf%) AS INTEGER
  23. DECLARE FUNCTION WGetDOSMajorVersion LIB "msdetstf.dll" AS INTEGER
  24. DECLARE FUNCTION WGetDOSMinorVersion LIB "msdetstf.dll" AS INTEGER
  25. DECLARE FUNCTION WGetNumWinApps LIB "msdetstf.dll" AS INTEGER
  26. DECLARE FUNCTION FHasMonochromeDisplay LIB "msdetstf.dll" AS INTEGER
  27. DECLARE FUNCTION FHasMouseInstalled LIB "msdetstf.dll" AS INTEGER
  28. DECLARE FUNCTION GetTypeFaceNameFromTTF LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  29. DECLARE FUNCTION GetExistingFOTFileForTTF LIB "msdetstf.dll" (szFile$, szBuf$, cbBuf%) AS INTEGER
  30.  
  31.  
  32. '*************************************************************************
  33. '****************  Detect Basic Wrapper Declarations  ********************
  34. '*************************************************************************
  35.  
  36.  
  37. '' detect
  38.  
  39. DECLARE SUB GetLocalHardDrivesList (szSymbol$)
  40. DECLARE FUNCTION GetTotalSpaceForDrive (szDrive$) AS LONG
  41. DECLARE FUNCTION GetFreeSpaceForDrive (szDrive$) AS LONG
  42.  
  43. DECLARE FUNCTION DoesFileExist (szFile$, mode%) AS INTEGER
  44. DECLARE FUNCTION GetDateOfFile (szFile$) AS STRING
  45. DECLARE FUNCTION GetSizeOfFile (szFile$) AS LONG
  46. DECLARE FUNCTION DoesDirExist (szDir$) AS INTEGER
  47.  
  48. DECLARE FUNCTION DoesIniSectionExist (szFile$, szSect$) AS INTEGER
  49. DECLARE FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) AS INTEGER
  50. DECLARE FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) AS STRING
  51.  
  52. DECLARE FUNCTION HasMonochromeDisplay AS INTEGER
  53. DECLARE FUNCTION HasMouseInstalled AS INTEGER
  54.  
  55. DECLARE FUNCTION GetEnvVariableValue (szEnvVar$) AS STRING
  56.  
  57.  
  58. '*************************************************************************
  59. FUNCTION GetEnvVariableValue (szEnvVar$) STATIC  AS STRING
  60. '$ifdef DEBUG
  61.     if szEnvVar$ = "" then
  62.         BadArgErr 1, "GetEnvVariableValue", szEnvVar$
  63.     end if
  64. '$endif ''DEBUG
  65.     cb% = 1024
  66.     szBuf$ = STRING$(cb%, 32)
  67.     cbRet% = CbGetEnvVariableValue(szEnvVar$, szBuf$, cb%)
  68.     GetEnvVariableValue = szBuf$
  69. '$ifdef DEBUG
  70.     IF cbRet% >= cb% THEN
  71.         StfApiErr saeOvfl, "GetEnvVariableValue", szEnvVar$
  72.         ERROR STFERR
  73.     END IF
  74. '$endif ''DEBUG
  75.     szBuf$ = ""
  76. END FUNCTION
  77.  
  78.  
  79. '*************************************************************************
  80. FUNCTION GetTotalSpaceForDrive (szDrive$) STATIC  AS LONG
  81. '$ifdef DEBUG
  82.     if FValidDrive(szDrive$) = 0 then
  83.         BadArgErr 1, "GetTotalSpaceForDrive", szDrive$
  84.     end if
  85. '$endif ''DEBUG
  86.     GetTotalSpaceForDrive = LcbTotalDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  87. END FUNCTION
  88.  
  89.  
  90. '*************************************************************************
  91. FUNCTION GetFreeSpaceForDrive (szDrive$) STATIC  AS LONG
  92. '$ifdef DEBUG
  93.     if FValidDrive(szDrive$) = 0 then
  94.         BadArgErr 1, "GetFreeSpaceForDrive", szDrive$
  95.     end if
  96. '$endif ''DEBUG
  97.     GetFreeSpaceForDrive = LcbFreeDrive(ASC(UCASE$(szDrive$)) - ASC("A") + 1)
  98. END FUNCTION
  99.  
  100.  
  101. '*************************************************************************
  102. SUB GetLocalHardDrivesList (szSymbol$) STATIC
  103. '$ifdef DEBUG
  104.     if szSymbol$ = "" then
  105.         BadArgErr 1, "GetLocalHardDrivesList", szSymbol$
  106.     end if
  107. '$endif ''DEBUG
  108.     if FGetLocalHardDrivesList(szSymbol$) = 0 then
  109. '$ifdef DEBUG
  110.         StfApiErr saeFail, "GetLocalHardDrivesList", szSymbol$
  111. '$endif ''DEBUG
  112.         ERROR STFERR
  113.     end if
  114. END SUB
  115.  
  116.  
  117. '*************************************************************************
  118. FUNCTION DoesFileExist (szFileName$, mode%) STATIC  AS INTEGER
  119. '$ifdef DEBUG
  120.     if FValidFATPath(szFileName$) = 0 then
  121.         BadArgErr 1, "DoesFileExist", szFileName$+", "+STR$(mode%)
  122.     end if
  123. '$endif ''DEBUG
  124.     DoesFileExist = FDoesFileExist(szFileName$, mode%)
  125. END FUNCTION
  126.  
  127.  
  128. '*************************************************************************
  129. FUNCTION GetDateOfFile (szFile$) STATIC  AS STRING
  130. '$ifdef DEBUG
  131.     if FValidFATPath(szFile$) = 0 then
  132.         BadArgErr 1, "GetDateOfFile", szFile$
  133.     end if
  134. '$endif ''DEBUG
  135.     cb% = 20
  136.     szBuf$ = STRING$(cb%, 32)
  137.     cbRet% = CbGetDateOfFile(szFile$, szBuf$, cb%)
  138.     GetDateOfFile = szBuf$
  139. '$ifdef DEBUG
  140.     IF cbRet% >= cb% THEN
  141.         StfApiErr saeOvfl, "GetDateOfFile", szFile$
  142.         ERROR STFERR
  143.     END IF
  144. '$endif ''DEBUG
  145.     szBuf$ = ""
  146. END FUNCTION
  147.  
  148.  
  149. '*************************************************************************
  150. FUNCTION GetSizeOfFile (szFile$) STATIC  AS LONG
  151. '$ifdef DEBUG
  152.     if FValidFATPath(szFile$) = 0 then
  153.         BadArgErr 1, "GetSizeOfFile", szFile$
  154.     end if
  155. '$endif ''DEBUG
  156.     GetSizeOfFile = LcbGetSizeOfFile(szFile$)
  157. END FUNCTION
  158.  
  159.  
  160. '*************************************************************************
  161. FUNCTION HasMonochromeDisplay STATIC  AS INTEGER
  162.     HasMonochromeDisplay = FHasMonochromeDisplay
  163. END FUNCTION
  164.  
  165.  
  166. '*************************************************************************
  167. FUNCTION HasMouseInstalled STATIC  AS INTEGER
  168.     HasMouseInstalled = FHasMouseInstalled
  169. END FUNCTION
  170.  
  171.  
  172. '*************************************************************************
  173. FUNCTION DoesDirExist (szDir$) STATIC  AS INTEGER
  174. '$ifdef DEBUG
  175.     if FValidFATDir(szDir$) = 0 then
  176.         BadArgErr 1, "DoesDirExist", szDir$
  177.     end if
  178. '$endif ''DEBUG
  179.     DoesDirExist = FDirExists(szDir$)
  180. END FUNCTION
  181.  
  182.  
  183. '*************************************************************************
  184. FUNCTION DoesIniSectionExist (szFile$, szSect$) STATIC  AS INTEGER
  185. '$ifdef DEBUG
  186.     if FValidIniFile(szFile$) = 0 then
  187.         BadArgErr 1, "DoesIniSectionExist", szFile$+", "+szSect$
  188.     end if
  189. '$endif ''DEBUG
  190.     DoesIniSectionExist = FDoesIniSectionExist(szFile$, szSect$)
  191. END FUNCTION
  192.  
  193.  
  194. '*************************************************************************
  195. FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) STATIC  AS INTEGER
  196. '$ifdef DEBUG
  197.     if FValidIniFile(szFile$) = 0 then
  198.         n% = 1
  199.     elseif szKey$ = "" then
  200.         n% = 3
  201.     else
  202.         n% = 0
  203.     end if
  204.     if n% > 0 then
  205.         BadArgErr n%, "DoesIniKeyExist", szFile$+", "+szSect$+", "+szKey$
  206.     end if
  207. '$endif ''DEBUG
  208.  
  209.     DoesIniKeyExist = FDoesIniKeyExist(szFile$, szSect$, szKey$)
  210. END FUNCTION
  211.  
  212.  
  213. '*************************************************************************
  214. FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) STATIC  AS STRING
  215. '$ifdef DEBUG
  216.     if FValidIniFile(szFile$) = 0 then
  217.         n% = 1
  218.     elseif szKey$ = "" then
  219.         n% = 3
  220.     else
  221.         n% = 0
  222.     end if
  223.     if n% > 0 then
  224.         BadArgErr n%, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
  225.     end if
  226. '$endif ''DEBUG
  227.  
  228.     cb% = 512
  229.     szBuf$ = STRING$(cb%, 32)
  230.     cbRet% = CbGetIniKeyString(szFile$, szSect$, szKey$, szBuf$, cb%)
  231.     GetIniKeyString = szBuf$
  232. '$ifdef DEBUG
  233.     IF cbRet% >= cb% THEN
  234.         StfApiErr saeOvfl, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
  235.         ERROR STFERR
  236.     END IF
  237. '$endif ''DEBUG
  238.     szBuf$ = ""
  239. END FUNCTION
  240.