home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SETUPKIT / SETUP1 / COMMON.BAS < prev    next >
Encoding:
BASIC Source File  |  1997-01-31  |  59.9 KB  |  1,766 lines

  1. Attribute VB_Name = "basCommon"
  2. Option Explicit
  3. Option Compare Text
  4.  
  5. '
  6. ' ╚½╛╓│ú╩²
  7. '
  8. Global Const gstrNULL$ = ""                             ' ┐╒╫╓╖√┤«
  9.  
  10. Global Const gstrSEP_DIR$ = "\"                         ' ─┐┬╝╖╓╕⌠╖√
  11. Public Const gstrSEP_REGKEY$ = "\"                      ' ╫ó▓ß╣╪╝ⁿ╫╓╖╓╕⌠╖√
  12. Global Const gstrSEP_DRIVE$ = ":"                       ' ╟²╢»╞≈╖╓╕⌠╖√,└²╚τ C:\
  13. Global Const gstrSEP_DIRALT$ = "/"                      ' ▒╕╙├─┐┬╝╖╓╕⌠╖√
  14. Global Const gstrSEP_EXT$ = "."                         ' ╬─╝■└⌐╒╣├√╖╓╕⌠╖√
  15. Public Const gstrSEP_PROGID = "."
  16. Public Const gstrSEP_FILE$ = "|"                        ' ╬─╝■├√┴╨▒φ╓╨╡─╖╓╕⌠╖√ú¼╒Γ╩╟╥≥╬¬╦ⁿ╘┌╬─╝■├√╓╨▓╗╩╟╥╗╕÷╙╨╨º╫╓╖√íú
  17. Public Const gstrSEP_LIST = "|"
  18. Public Const gstrSEP_URL$ = "://"                       ' ╘┌ URL ╡╪╓╖╓╨╜╙╘┌ HPPT ╓«║≤╡─╖╓╕⌠╖√
  19. Public Const gstrSEP_URLDIR$ = "/"                      ' ╘┌ URL ╡╪╓╖╓╨╗«╖╓─┐┬╝╡─╖╓╕⌠╖√íú
  20.  
  21. Global Const gstrUNC$ = "\\"                            ' UNC ╦╡├≈╖√ \\
  22. Global Const gstrCOLON$ = ":"
  23. Global Const gstrSwitchPrefix1 = "-"
  24. Global Const gstrSwitchPrefix2 = "/"
  25. Global Const gstrCOMMA$ = ","
  26. Global Const gstrDECIMAL$ = "."
  27. Global Const gstrQUOTE$ = """"
  28. Public Const gstrCCOMMENT$ = "//"                       ' C ╡╚╙∩╤╘╓╨╩╣╙├╡─╫ó╩═╦╡├≈╖√
  29. Public Const gstrASSIGN$ = "="
  30. Global Const gstrINI_PROTOCOL = "Protocol"
  31. Public Const gstrREMOTEAUTO = "RA"
  32. Public Const gstrDCOM = "DCOM"
  33.  
  34. Global Const gintMAX_SIZE% = 255                        ' ╫ε┤≤╗║│σ╟°┤≤╨í
  35. Global Const gintMAX_PATH_LEN% = 260                    ' ╦∙╘╩╨φ╡─╫ε┤≤┬╖╛╢│ñ╢╚ú¼░ⁿ└¿ NT (Intel) ║═ Win95 ╡─┬╖╛╢íó╬─╝■├√ú¼
  36.                                                         ' ║═├ⁿ┴ε╨╨▓╬╩²íú
  37. Global Const gintMAX_GROUPNAME_LEN% = 30                ' ╦∙╘╩╨φ╡─ NT 3.51 ╫Θ├√╡─╫ε┤≤│ñ╢╚íú
  38. Global Const gintMIN_BUTTONWIDTH% = 1200
  39. Global Const gsngBUTTON_BORDER! = 1.4
  40.  
  41. Global Const intDRIVE_REMOVABLE% = 2                    ' GetDriveType ╡─│ú╩²
  42. Global Const intDRIVE_FIXED% = 3
  43. Global Const intDRIVE_REMOTE% = 4
  44. Global Const intDRIVE_CDROM% = 5
  45. Global Const intDRIVE_RAMDISK% = 6
  46.  
  47. Global Const gintNOVERINFO% = 32767                     '▒Ω╓╛ú¼╓╕╩╛╬▐░µ▒╛╨┼╧ó
  48.  
  49. '╬─╝■├√│╞
  50. Global Const gstrFILE_SETUP$ = "SETUP.LST"              '░▓╫░╨┼╧ó╬─╝■╡─├√│╞
  51. Public Const gstrTEMP_DIR$ = "TEMP"
  52. Public Const gstrTMP_DIR$ = "TMP"
  53.  
  54. '╬─╝■╡─ Share └α╨═║Ω
  55. Global Const mstrPRIVATEFILE = ""
  56. Global Const mstrSHAREDFILE = "$(Shared)"
  57.  
  58. 'INI ╬─╝■╝ⁿ
  59. Global Const gstrINI_SETUP$ = "Setup"
  60. Global Const gstrINI_APPNAME$ = "Title"
  61. Global Const gstrINI_APPDIR$ = "DefaultDir"
  62. Global Const gstrINI_APPEXE$ = "AppExe"
  63. Public Const gstrINI_APPTOUNINSTALL = "AppToUninstall"
  64. Global Const gstrINI_APPPATH$ = "AppPath"
  65. Global Const gstrINI_FORCEUSEDEFDEST = "ForceUseDefDir"
  66. Global Const gstrINI_DEFGROUP$ = "DefProgramGroup"
  67.  
  68. Public Const gstrEXT_DEP$ = "DEP"
  69.  
  70. '░▓╫░╨┼╧ó╬─╝■║Ω
  71. Global Const gstrAPPDEST$ = "$(AppPath)"
  72. Global Const gstrWINDEST$ = "$(WinPath)"
  73. Global Const gstrWINSYSDEST$ = "$(WinSysPath)"
  74. Global Const gstrWINSYSDESTSYSFILE$ = "$(WinSysPathSysFile)"
  75. Global Const gstrPROGRAMFILES$ = "$(ProgramFiles)"
  76. Global Const gstrCOMMONFILES$ = "$(CommonFiles)"
  77. Global Const gstrCOMMONFILESSYS$ = "$(CommonFilesSys)"
  78. Global Const gstrDAODEST$ = "$(MSDAOPath)"
  79. Public Const gstrDONOTINSTALL$ = "$(DoNotInstall)"
  80.  
  81. '╩≤▒Ω╓╕╒δ│ú╩²
  82. Global Const gintMOUSE_DEFAULT% = 0
  83. Global Const gintMOUSE_HOURGLASS% = 11
  84.  
  85. 'MsgError() │ú╩²
  86. Global Const MSGERR_ERROR = 1
  87. Global Const MSGERR_WARNING = 2
  88.  
  89. 'MsgBox │ú╩²
  90. Global Const MB_OK = 0                                  '╜÷í░╚╖╢¿í▒░┤┼Ñ
  91. Global Const MB_OKCANCEL = 1                            'í░╚╖╢¿í▒║═í░╚í╧√í▒░┤┼Ñ
  92. Global Const MB_ABORTRETRYIGNORE = 2                    'í░╓╨╓╣í▒íóí░╓╪╩╘í▒íóí░║÷┬╘í▒░┤┼Ñ
  93. Global Const MB_YESNO = 4                               'í░╩╟í▒║═í░╖±í▒░┤┼Ñ
  94. Global Const MB_RETRYCANCEL = 5                         'í░╓╪╩╘í▒║═í░╚í╧√í▒░┤┼Ñ
  95. Global Const MB_ICONSTOP = 16                           '╤╧╓╪┤φ╬≤╧√╧ó
  96. Global Const MB_ICONQUESTION = 32                       '╛»╕µ╤»╬╩
  97. Global Const MB_ICONEXCLAMATION = 48                    '╛»╕µ╧√╧ó
  98. Global Const MB_ICONINFORMATION = 64                    '╨┼╧ó╧√╧ó
  99. Global Const MB_DEFBUTTON1 = 0                          '╡┌╥╗╕÷░┤┼Ñ╩╟╚▒╩í╡─
  100. Global Const MB_DEFBUTTON2 = 256                        '╡┌╢■╕÷░┤┼Ñ╩╟╚▒╩í╡─
  101. Global Const MB_DEFBUTTON3 = 512                        '╡┌╚²╕÷░┤┼Ñ╩╟╚▒╩í╡─
  102.  
  103. 'MsgBox ╖╡╗╪╓╡
  104. Global Const IDOK = 1                                   '░┤╧┬í░╚╖╢¿í▒░┤┼Ñ
  105. Global Const IDCANCEL = 2                               '░┤╧┬í░╚í╧√í▒░┤┼Ñ
  106. Global Const IDABORT = 3                                '░┤╧┬í░╓╨╓╣í▒░┤┼Ñ
  107. Global Const IDRETRY = 4                                '░┤╧┬í░╓╪╩╘í▒░┤┼Ñ
  108. Global Const IDIGNORE = 5                               '░┤╧┬í░║÷┬╘í▒░┤┼Ñ
  109. Global Const IDYES = 6                                  '░┤╧┬í░╩╟í▒░┤┼Ñ
  110. Global Const IDNO = 7                                   '░┤╧┬í░╖±í▒░┤┼Ñ
  111.  
  112. '
  113. '└α╨═╔∙├≈
  114. '
  115. Type OFSTRUCT
  116.     cBytes As Byte
  117.     fFixedDisk As Byte
  118.     nErrCode As Integer
  119.     nReserved1 As Integer
  120.     nReserved2 As Integer
  121.     szPathName As String * 256
  122. End Type
  123.  
  124. Type VERINFO                                            '░µ▒╛ FIXEDFILEINFO
  125.     strPad1 As Long                                     '│Σ╠ε╜ß╣╣╡─░µ▒╛
  126.     strPad2 As Long                                     '│Σ╠ε╜ß╣╣╡─▒Ω╓╛╫╓
  127.     nMSLo As Integer                                    '░µ▒╛║┼╡─╡═╬╗╫╓ MS DWord
  128.     nMSHi As Integer                                    '░µ▒╛║┼╡─╕▀╬╗╫╓ MS DWord
  129.     nLSLo As Integer                                    '░µ▒╛║┼╡─╡═╬╗╫╓ LS DWord
  130.     nLSHi As Integer                                    '░µ▒╛║┼╡─╕▀╬╗╫╓ LS DWord
  131.     strPad3(1 To 16) As Byte                            '╠°╣² VERINFO ╜ß╣╣╡─╥╗╨⌐╫╓╜┌ (16 ╫╓╜┌)
  132.     FileOS As Long                                      '╣╪╙┌▒╛╬─╝■├µ╧≥╡─▓┘╫≈╧╡═│╡─╨┼╧óíú
  133.     strPad4(1 To 16) As Byte                            '│Σ╠ε VERINFO ╜ß╣╣╡─╞Σ╦√▓┐╖╓ (16 ╫╓╜┌)
  134. End Type
  135.  
  136. Type PROTOCOL
  137.     strName As String
  138.     strFriendlyName As String
  139. End Type
  140.  
  141. Type OSVERSIONINFO '╙├╙┌ GetVersionEx API ╡≈╙├
  142.     dwOSVersionInfoSize As Long
  143.     dwMajorVersion As Long
  144.     dwMinorVersion As Long
  145.     dwBuildNumber As Long
  146.     dwPlatformId As Long
  147.     szCSDVersion As String * 128
  148. End Type
  149.  
  150. Global Const OF_EXIST& = &H4000&
  151. Global Const OF_SEARCH& = &H400&
  152. Global Const HFILE_ERROR% = -1
  153.  
  154. '
  155. '╚½╛╓▒Σ┴┐
  156. '
  157. Global LF$                                              '╡Ñ╨╨╢╧┐¬
  158. Global LS$                                              '╦½╨╨╢╧┐¬
  159. Public CRLF As String                                   ' ╗╪│╡/╗╗╨╨
  160. '
  161. ' ╙├╙┌░▓╛▓╡─║═ SMS ░▓╫░╡─╚½╛╓▒Σ┴┐
  162. '
  163. Public gfSilent As Boolean                              ' ╩╟╖±╒²╘┌╜°╨╨░▓╛▓╡─░▓╫░
  164. Public gstrSilentLog As String                          ' ╘┌░▓╛▓╡─░▓╫░╓╨╩Σ│÷╡─╬─╝■├√
  165. Public gfSMS As Boolean                                 ' ╩╟╖±╒²╘┌╜°╨╨ SMS ░▓╛▓╡─░▓╫░
  166. Public gstrMIFFile As String                            ' SMS ╡─╫┤╠¼╩Σ│÷╬─╝■
  167. Public gfSMSStatus As Boolean                           ' SMS ░▓╫░╡─╫┤╠¼
  168. Public gstrSMSDescription As String                     ' ╬¬ SMS ░▓╫░╢°╨┤╡╜ MIF ╬─╝■╡─├Φ╩÷╫╓╖√┤«
  169. Public gfNoUserInput As Boolean                         ' ╚τ╣√ gfSMS ╗≥ gfSilent ╬¬ True ╩▒╬¬ True
  170. Public gfDontLogSMS As Boolean                          ' ╠ß╣⌐▒╗╡╟┬╝╡╜ SMS ╡─ MsgFunc (└²╚τú¼╬¬╚╖╚╧╧√╧ó)
  171. Public Const MAX_SMS_DESCRIP = 255                      ' SMS ▓╗╘╩╨φ├Φ╩÷╫╓╖√┤«│¼╣² 255 ╕÷╫╓╖√íú
  172. '
  173. '┴╨│÷┐╔╙├╡─╨¡╥Θ
  174. '
  175. Global gProtocol() As PROTOCOL
  176. Global gcProtocols As Integer
  177. '
  178. ' ╨Φ╥¬ AXDist.exe ║═ wint351.exeíú
  179. ' ╒Γ╨⌐╩╟╫╘╜Γ╤╣╦⌡╡─┐╔╓┤╨╨╬─╝■ú¼░▓╫░╞Σ╦√▓╗╙╔ setup1 ░▓╫░╡─╬─╝■íú
  180. '
  181. Public gfAXDist As Boolean
  182. Public Const gstrFILE_AXDIST = "AXDIST.EXE"
  183. Public gstrAXDISTInstallPath As String
  184. Public gfAXDistChecked As Boolean
  185. Public gfWINt351 As Boolean
  186. Public Const gstrFILE_WINT351 = "WINt351.EXE"
  187. Public gstrWINt351InstallPath As String
  188. Public gfWINt351Checked As Boolean
  189. '
  190. '╬¬ 32 ╬╗░▓╫░╣ñ╛▀╡─ API/DLL ╔∙├≈
  191. '
  192. Declare Function DiskSpaceFree Lib "VB5STKIT.DLL" Alias "DISKSPACEFREE" () As Long
  193. Declare Function SetTime Lib "VB5STKIT.DLL" (ByVal strFileGetTime As String, ByVal strFileSetTime As String) As Integer
  194. Declare Function AllocUnit Lib "VB5STKIT.DLL" () As Long
  195. Declare Function GetWinPlatform Lib "VB5STKIT.DLL" () As Long
  196. Declare Function fNTWithShell Lib "VB5STKIT.DLL" () As Boolean
  197. Declare Function FSyncShell Lib "VB5STKIT.DLL" Alias "SyncShell" (ByVal strCmdLine As String, ByVal intCmdShow As Long) As Long
  198. Declare Function DLLSelfRegister Lib "VB5STKIT.DLL" (ByVal lpDllName As String) As Integer
  199. Declare Function GetClsidFromActXFile Lib "VB5STKIT.DLL" (ByVal pszFilename As String, ByVal pszProgID As String, ByVal pszClsid As String) As Long
  200. Declare Function RegisterTLB Lib "VB5STKIT.DLL" (ByVal lpTLBName As String) As Integer
  201. Declare Sub lmemcpy Lib "VB5STKIT.DLL" (strDest As Any, ByVal strSrc As Any, ByVal lBytes As Long)
  202. Declare Function OSfCreateShellGroup Lib "VB5STKIT.DLL" Alias "fCreateShellFolder" (ByVal lpstrDirName As String) As Long
  203. Declare Function OSfCreateShellLink Lib "VB5STKIT.DLL" Alias "fCreateShellLink" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArguments As String) As Long
  204. Declare Function OSfRemoveShellLink Lib "VB5STKIT.DLL" Alias "fRemoveShellLink" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String) As Long
  205. Private Declare Function OSGetLongPathName Lib "VB5STKIT.DLL" Alias "GetLongPathName" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
  206.  
  207. Declare Function OpenFile Lib "kernel32" (ByVal lpFilename As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long
  208. Declare Function GetFullPathName Lib "kernel32" Alias "GetFullPathNameA" (ByVal lpFilename As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal lpFilePart As String) As Long
  209. Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal lSize As Long, ByVal lpFilename As String) As Long
  210. Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As Any, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFilename As String) As Long
  211. Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFilename As String) As Long
  212. Declare Function GetPrivateProfileSectionNames Lib "kernel32" Alias "GetPrivateProfileSectionNamesA" (ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFilename As String) As Long
  213. Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
  214. Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
  215. Declare Function GetDriveType32 Lib "kernel32" Alias "GetDriveTypeA" (ByVal strWhichDrive As String) As Long
  216. Declare Function GetTempFilename32 Lib "kernel32" Alias "GetTempFileNameA" (ByVal strWhichDrive As String, ByVal lpPrefixString As String, ByVal wUnique As Integer, ByVal lpTempFilename As String) As Long
  217. Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
  218. Declare Function SendMessageString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
  219. Public Const LB_FINDSTRINGEXACT = &H1A2
  220. Public Const LB_ERR = (-1)
  221.  
  222. Declare Function VerInstallFile Lib "VERSION.DLL" Alias "VerInstallFileA" (ByVal Flags&, ByVal SrcName$, ByVal DestName$, ByVal SrcDir$, ByVal DestDir$, ByVal CurrDir As Any, ByVal TmpName$, lpTmpFileLen&) As Long
  223. Declare Function GetFileVersionInfoSize Lib "VERSION.DLL" Alias "GetFileVersionInfoSizeA" (ByVal strFilename As String, lVerHandle As Long) As Long
  224. Declare Function GetFileVersionInfo Lib "VERSION.DLL" Alias "GetFileVersionInfoA" (ByVal strFilename As String, ByVal lVerHandle As Long, ByVal lcbSize As Long, lpvData As Byte) As Long
  225. Declare Function VerQueryValue Lib "VERSION.DLL" Alias "VerQueryValueA" (lpvVerData As Byte, ByVal lpszSubBlock As String, lplpBuf As Long, lpcb As Long) As Long
  226. Private Declare Function OSGetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
  227. Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
  228.  
  229. '-----------------------------------------------------------
  230. ' ╫╙│╠╨≥: AddDirSep
  231. ' ╠φ╝╙╥╗╕÷╬▓╦µ╡──┐┬╝┬╖╛╢╖╓╕⌠╖√ (╖┤╨▒╕▄) ╡╜┬╖╛╢├√─⌐╢╦ú¼│²╖╟╥╤╛¡┤µ╘┌╖╓╕⌠╖√
  232. '
  233. ' ╚δ┐┌/│÷┐┌: [strPathName] - ╥¬╠φ╝╙╖╓╕⌠╖√╡─┬╖╛╢
  234. '-----------------------------------------------------------
  235. '
  236. Sub AddDirSep(strPathName As String)
  237.     If Right(Trim(strPathName), Len(gstrSEP_URLDIR)) <> gstrSEP_URLDIR And _
  238.        Right(Trim(strPathName), Len(gstrSEP_DIR)) <> gstrSEP_DIR Then
  239.         strPathName = RTrim$(strPathName) & gstrSEP_DIR
  240.     End If
  241. End Sub
  242. '-----------------------------------------------------------
  243. ' ╫╙│╠╨≥: AddURLDirSep
  244. ' ╠φ╝╙╥╗╕÷╬▓╦µ╡─ URL ┬╖╛╢╖╓╕⌠╖√ (╒²╨▒╕▄) ╡╜ URL ─⌐╢╦ú¼
  245. ' │²╖╟╥╤╛¡┤µ╘┌╖╓╕⌠╖√ (╗≥╖┤╨▒╕▄)
  246. '
  247. ' ╚δ┐┌/│÷┐┌: [strPathName] - ╥¬╠φ╝╙╖╓╕⌠╖√╡─┬╖╛╢
  248. '-----------------------------------------------------------
  249. '
  250. Sub AddURLDirSep(strPathName As String)
  251.     If Right(Trim(strPathName), Len(gstrSEP_URLDIR)) <> gstrSEP_URLDIR And _
  252.        Right(Trim(strPathName), Len(gstrSEP_DIR)) <> gstrSEP_DIR Then
  253.         strPathName = Trim(strPathName) & gstrSEP_URLDIR
  254.     End If
  255. End Sub
  256.  
  257. '-----------------------------------------------------------
  258. ' ║»╩²: FileExists
  259. ' ┼╨╢╧╩╟╖±┤µ╘┌╓╕╢¿╡─╬─╝■
  260. '
  261. ' ╚δ┐┌: [strPathName] - ╥¬╝∞▓Θ╡─╬─╝■
  262. '
  263. ' ╖╡╗╪: Trueú¼╚τ╣√╬─╝■┤µ╘┌ú╗╖±╘≥╬¬ False
  264. '-----------------------------------------------------------
  265. '
  266. Function FileExists(ByVal strPathName As String) As Integer
  267.     Dim intFileNum As Integer
  268.  
  269.     On Error Resume Next
  270.  
  271.     '
  272.     ' ╚τ╣√╥²╙├┴╦╫╓╖√┤«ú¼╔╛│²╥²╙├
  273.     '
  274.     strPathName = strUnQuoteString(strPathName)
  275.     '
  276.     '╔╛│²╦∙╙╨╬▓╦µ╡──┐┬╝╖╓╕⌠╖√
  277.     '
  278.     If Right$(strPathName, 1) = gstrSEP_DIR Then
  279.         strPathName = Left$(strPathName, Len(strPathName) - 1)
  280.     End If
  281.  
  282.     '
  283.     '╩╘═╝┤≥┐¬╬─╝■ú¼▒╛║»╩²╡─╖╡╗╪╓╡╬¬ False
  284.     '╚τ╣√┤≥┐¬╩▒│÷┤φú¼╖±╘≥╬¬ True
  285.     '
  286.     intFileNum = FreeFile
  287.     Open strPathName For Input As intFileNum
  288.  
  289.     FileExists = IIf(Err = 0, True, False)
  290.  
  291.     Close intFileNum
  292.  
  293.     Err = 0
  294. End Function
  295.  
  296. '-----------------------------------------------------------
  297. ' ║»╩²: DirExists
  298. '
  299. ' ┼╨╢╧╩╟╖±┤µ╘┌╓╕╢¿╡──┐┬╝├√íú
  300. ' ▒╛║»╩²╙├╙┌ (└²╚τ) ═¿╣²┤½╡▌╡─╚τ 'A:\'ú¼┼╨╢╧░▓╫░╚φ┼╠╩╟╖±╘┌╟²╢»╞≈╓╨íú
  301. '
  302. ' ╚δ┐┌: [strDirName] - ╥¬╝∞▓Θ╡──┐┬╝├√
  303. '
  304. ' ╖╡╗╪: Trueú¼╚τ╣√─┐┬╝┤µ╘┌ú╗╖±╘≥╬¬ False
  305. '-----------------------------------------------------------
  306. '
  307. Public Function DirExists(ByVal strDirName As String) As Integer
  308.     Const strWILDCARD$ = "*.*"
  309.  
  310.     Dim strDummy As String
  311.  
  312.     On Error Resume Next
  313.  
  314.     AddDirSep strDirName
  315.     strDummy = Dir$(strDirName & strWILDCARD, vbDirectory)
  316.     DirExists = Not (strDummy = gstrNULL)
  317.  
  318.     Err = 0
  319. End Function
  320.  
  321. '-----------------------------------------------------------
  322. ' ║»╩²: GetDriveType
  323. ' ═¿╣²╡≈╙├ Windows GetDriveType()ú¼┼╨╢╧┤┼┼╠╩╟╖±╣╠╢¿┼╠ú¼╩╟╖±┐╔╥╞╢»┼╠ú¼╡╚╡╚íú
  324. '-----------------------------------------------------------
  325. '
  326. Function GetDriveType(ByVal intDriveNum As Integer) As Integer
  327.     '
  328.     ' ▒╛║»╩²╘┌ Win16 ╓╨╨Φ╥¬▒φ╩╛╟²╢»╞≈║┼╡─╒√╩²ú¼╘┌ Win32 ╓╨╨Φ╥¬╫╓╖√┤«
  329.     '
  330.     Dim strDriveName As String
  331.     
  332.     strDriveName = Chr$(Asc("A") + intDriveNum) & gstrSEP_DRIVE & gstrSEP_DIR
  333.     GetDriveType = CInt(GetDriveType32(strDriveName))
  334. End Function
  335.  
  336. '-----------------------------------------------------------
  337. ' ║»╩²: ReadProtocols
  338. ' ┤╙╓╕╢¿╬─╝■╓╨╢┴╚í┐╔╚▌╨φ╡─╨¡╥Θíú
  339. '
  340. ' ╚δ┐┌: [strInputFilename] - INI ╬─╝■├√ú¼┤╙╓╨╢┴╚í╨¡╥Θ
  341. '       [strINISection] - INI ╜┌╡─├√│╞
  342. '-----------------------------------------------------------
  343. Function ReadProtocols(ByVal strInputFilename As String, ByVal strINISection As String) As Boolean
  344.     Dim intIdx As Integer
  345.     Dim fOk As Boolean
  346.     Dim strInfo As String
  347.     Dim intOffset As Integer
  348.     
  349.     intIdx = 0
  350.     fOk = True
  351.     Erase gProtocol
  352.     gcProtocols = 0
  353.     
  354.     Do
  355.         strInfo = ReadIniFile(strInputFilename, strINISection, gstrINI_PROTOCOL & Format$(intIdx + 1))
  356.         If strInfo <> gstrNULL Then
  357.             intOffset = InStr(strInfo, gstrCOMMA)
  358.             If intOffset > 0 Then
  359.                 '"│≤┬¬" ├√╜½╩╫╧╚│÷╧╓
  360.                 ReDim Preserve gProtocol(intIdx + 1)
  361.                 gcProtocols = intIdx + 1
  362.                 gProtocol(intIdx + 1).strName = Left$(strInfo, intOffset - 1)
  363.                 
  364.                 '... ╜╙╫┼╩╟í░╙╤║├í▒├√
  365.                 gProtocol(intIdx + 1).strFriendlyName = Mid$(strInfo, intOffset + 1)
  366.                 If (gProtocol(intIdx + 1).strName = "") Or (gProtocol(intIdx + 1).strFriendlyName = "") Then
  367.                     fOk = False
  368.                 End If
  369.             Else
  370.                 fOk = False
  371.             End If
  372.  
  373.             If Not fOk Then
  374.                 Exit Do
  375.             Else
  376.                 intIdx = intIdx + 1
  377.             End If
  378.         End If
  379.     Loop While strInfo <> gstrNULL
  380.     
  381.     ReadProtocols = fOk
  382. End Function
  383.  
  384. '-----------------------------------------------------------
  385. ' ║»╩²: ResolveResString
  386. ' ╢┴╚í╫╩╘┤▓ó╙├╕°╢¿╓╡╠µ╗╗╕°╢¿║Ω
  387. '
  388. ' └²╚τú¼╕°╢¿╥╗╕÷╫╩╘┤║┼ 14:
  389. '    "╬▐╖¿╢┴╚í╟²╢»╞≈ |2 ╓╨╡─ '|1'"
  390. '   ╡≈╙├ ResolveResString(14, "|1", "TXTFILE.TXT", "|2", "A:")
  391. '   ╜½╖╡╗╪╫╓╖√┤« "╬▐╖¿╢┴╚í╟²╢»╞≈ A:╓╨╡─ 'TXTFILE.TXT'╬─╝■"
  392. '
  393. ' ╚δ┐┌: [resID] - ╫╩╘┤▒Ω╩╢╖√
  394. '       [varReplacements] - │╔╢╘╡─║Ω/╠µ╗╗╓╡
  395. '-----------------------------------------------------------
  396. '
  397. Public Function ResolveResString(ByVal resID As Integer, ParamArray varReplacements() As Variant) As String
  398.     Dim intMacro As Integer
  399.     Dim strResString As String
  400.     
  401.     strResString = LoadResString(resID)
  402.     
  403.     ' For each ╤¡╗╖╢┴╚δ│╔╢╘╡─║Ω/╓╡...
  404.     For intMacro = LBound(varReplacements) To UBound(varReplacements) Step 2
  405.         Dim strMacro As String
  406.         Dim strValue As String
  407.         
  408.         strMacro = varReplacements(intMacro)
  409.         On Error GoTo MismatchedPairs
  410.         strValue = varReplacements(intMacro + 1)
  411.         On Error GoTo 0
  412.         
  413.         ' ╦∙╙╨│÷╧╓╡─ strMacro ╠µ╗╗╬¬ strValue
  414.         Dim intPos As Integer
  415.         Do
  416.             intPos = InStr(strResString, strMacro)
  417.             If intPos > 0 Then
  418.                 strResString = Left$(strResString, intPos - 1) & strValue & Right$(strResString, Len(strResString) - Len(strMacro) - intPos + 1)
  419.             End If
  420.         Loop Until intPos = 0
  421.     Next intMacro
  422.     
  423.     ResolveResString = strResString
  424.     
  425.     Exit Function
  426.     
  427. MismatchedPairs:
  428.     Resume Next
  429. End Function
  430. '-----------------------------------------------------------
  431. ' ╫╙│╠╨≥: GetLicInfoFromVBL
  432. ' ╖╓╬÷ VBL ╬─╝■├√▓ó│Θ╚í╫ó▓ß▒φ╡─╨φ┐╔╓ñ║┼╝░╨φ┐╔╓ñ╨┼╧óíú
  433. '
  434. ' ╚δ┐┌: [strVBLFile] - ▒╪╨δ╩╟╙╨╨º╡─ VBLíú
  435. '
  436. ' │÷┐┌: [strLicKey] - ╨┤╨φ┐╔╓ñ╨┼╧ó╡─╫ó▓ß▒φ╣╪╝ⁿ╫╓íú
  437. '                     ╕├╣╪╝ⁿ╫╓╜½▒╗╠φ╝╙╡╜ HKEY_CLASSES_ROOT\Licenses ╓╨íú╒Γ╩╟╓╕─╧íú
  438. ' │÷┐┌: [strLicVal] - ╨φ┐╔╓ñ╨┼╧óíú═¿│ú╥╘╛▀╙╨╥■║¼╫╓╖√╡─╫╓╖√┤«╡─╨╬╩╜│÷╧╓íú
  439. '-----------------------------------------------------------
  440. '
  441. Public Sub GetLicInfoFromVBL(strVBLFile As String, strLicKey As String, strLicVal As String)
  442.     Dim fn As Integer
  443.     Const strREGEDIT = "REGEDIT"
  444.     Const strLICKEYBASE = "HKEY_CLASSES_ROOT\Licenses\"
  445.     Dim strTemp As String
  446.     Dim posEqual As Integer
  447.     Dim fLicFound As Boolean
  448.     
  449.     fn = FreeFile
  450.     Open strVBLFile For Input Access Read Lock Read Write As #fn
  451.     '
  452.     ' ╢┴╬─╝■ú¼╓▒╡╜╒╥╡╜╥╗╨╨ strLICKEYBASE ╥╘┐¬╩╝íú
  453.     '
  454.     fLicFound = False
  455.     Do While Not EOF(fn)
  456.         Line Input #fn, strTemp
  457.         strTemp = Trim(strTemp)
  458.         If Left$(strTemp, Len(strLICKEYBASE)) = strLICKEYBASE Then
  459.             '
  460.             ' ╥╤╛¡╗±╡├╦∙╨Φ╨╨íú
  461.             '
  462.             fLicFound = True
  463.             Exit Do
  464.         End If
  465.     Loop
  466.  
  467.     Close fn
  468.     
  469.     If fLicFound Then
  470.         '
  471.         ' ╖╓╬÷╕├╨╨╓╨╡─╩²╛▌ú¼╖╓└δ╣╪╝ⁿ╫╓╙δ╨φ┐╔╓ñ╨┼╧óíú
  472.         ' ╕├╨╨╕±╩╜╚τ╧┬ú║
  473.         ' "HKEY_CLASSES_ROOT\Licenses\<lickey> = <licval>"
  474.         '
  475.         posEqual = InStr(strTemp, gstrASSIGN)
  476.         If posEqual > 0 Then
  477.             strLicKey = Mid$(Trim(Left$(strTemp, posEqual - 1)), Len(strLICKEYBASE) + 1)
  478.             strLicVal = Trim(Mid$(strTemp, posEqual + 1))
  479.         End If
  480.     Else
  481.         strLicKey = gstrNULL
  482.         strLicVal = gstrNULL
  483.     End If
  484. End Sub
  485.  
  486.  '-----------------------------------------------------------
  487.  ' ║»╩² GetLongPathName
  488.  '
  489.  ' ╝∞╦≈╥╗╕÷┐╔─▄░ⁿ║¼╢╠╡─╫╙─┐┬╝║═╬─╝■├√╡─┬╖╛╢╡─│ñ┬╖╛╢├√░µ▒╛
  490.  '-----------------------------------------------------------
  491.  '
  492.  Function GetLongPathName(ByVal strShortPath As String) As String
  493.     Const cchBuffer = 300
  494.     Dim strLongPath As String
  495.     Dim lResult As Long
  496.     
  497.     On Error GoTo 0
  498.     
  499.     strLongPath = String(cchBuffer, Chr$(0))
  500.     lResult = OSGetLongPathName(strShortPath, strLongPath, cchBuffer)
  501.     If lResult = 0 Then
  502.         Error 53 ' ╬─╝■╬┤╒╥╡╜
  503.     Else
  504.         GetLongPathName = StripTerminator(strLongPath)
  505.     End If
  506.  End Function
  507.  
  508.  '-----------------------------------------------------------
  509.  ' ║»╩² GetShortPathName
  510.  '
  511.  ' ╝∞╦≈╥╗╕÷┐╔─▄░ⁿ║¼│ñ╡─╫╙─┐┬╝║═╬─╝■├√╡─┬╖╛╢╡─╢╠┬╖╛╢├√░µ▒╛
  512.  '-----------------------------------------------------------
  513.  '
  514.  Function GetShortPathName(ByVal strLongPath As String) As String
  515.      Const cchBuffer = 300
  516.      Dim strShortPath As String
  517.      Dim lResult As Long
  518.  
  519.      On Error GoTo 0
  520.      strShortPath = String(cchBuffer, Chr$(0))
  521.      lResult = OSGetShortPathName(strLongPath, strShortPath, cchBuffer)
  522.      If lResult = 0 Then
  523.          Error 53 ' ╬─╝■╬┤╒╥╡╜
  524.      Else
  525.          GetShortPathName = StripTerminator(strShortPath)
  526.      End If
  527.  End Function
  528.  
  529. '-----------------------------------------------------------
  530. ' ║»╩²: GetTempFilename
  531. ' ╬¬╓╕╢¿╡─╟²╢»╞≈║═╬─╝■├√╟░╫║╗±╚í╥╗╕÷┴┘╩▒╬─╝■├√
  532. ' ▓╬╩²:
  533. '   strDestPath - ┤┤╜¿┴┘╩▒╬─╝■╡─╬╗╓├íú╚τ╣√╩╟┐╒╫╓╖√┤«ú¼╜½╩╣╙├╙╔╗╖╛│▒Σ┴┐ tmp ╗≥ temp ╓╕╢¿╡─╬╗╓├íú
  534. '   lpPrefixString - ╫╓╖√┤«╡─╟░╚²╕÷╫╓╖√╜½╫≈╬¬┴┘╩▒╬─╝■├√╡─╥╗▓┐╖╓╖╡╗╪íú
  535. '   wUnique - ╔Φ╬¬ 0ú¼┤┤╜¿╬¿╥╗╡─╬─╝■├√íú╥▓┐╔╥╘╔Φ╬¬╒√╩²ú¼╘┌╒Γ╓╓╟Θ┐÷╧┬ú¼╖╡╗╪ tmp ╬─╝■├√ú¼
  536. '             ╒Γ╕÷╒√╩²╫≈╬¬╬─╝■├√╡─╥╗▓┐╖╓íú
  537. '   lpTempFilename - ┴┘╩▒╬─╝■├√╫≈╬¬▒Σ┴┐╖╡╗╪íú
  538. ' ╖╡╗╪:
  539. '   Trueú¼╚τ╣√╡≈╙├│╔╣ªú╗╖±╘≥╬¬ false
  540. '-----------------------------------------------------------
  541. '
  542. Function GetTempFilename(ByVal strDestPath As String, ByVal lpPrefixString As String, ByVal wUnique As Integer, lpTempFilename As String) As Boolean
  543.     If strDestPath = gstrNULL Then
  544.         '
  545.         ' ├╗╙╨╓╕╢¿─┐▒Ωú¼╩╣╙├ temp ─┐┬╝íú
  546.         '
  547.         strDestPath = String(gintMAX_PATH_LEN, vbNullChar)
  548.         If GetTempPath(gintMAX_PATH_LEN, strDestPath) = 0 Then
  549.             GetTempFilename = False
  550.             Exit Function
  551.         End If
  552.     End If
  553.     lpTempFilename = String(gintMAX_PATH_LEN, vbNullChar)
  554.     GetTempFilename = GetTempFilename32(strDestPath, lpPrefixString, wUnique, lpTempFilename) > 0
  555.     lpTempFilename = StripTerminator(lpTempFilename)
  556. End Function
  557. '-----------------------------------------------------------
  558. ' ║»╩²: GetDefMsgBoxButton
  559. ' ╜Γ┬δ┤½╡▌╡╜ MsgBox ║»╩²╡─▒Ω╓╛ú¼╛÷╢¿╚▒╩í░┤┼Ñ╩╟╩▓├┤íú╙├╙┌░▓╛▓╡─░▓╫░íú
  560. '
  561. ' ╚δ┐┌: [intFlags] - ┤½╡▌╡╜ MsgBox ╡─▒Ω╓╛
  562. '
  563. ' ╖╡╗╪: VB ╕°░┤┼Ñ╢¿╥σ║┼
  564. '               vbOK        1   ░┤╧┬í░╚╖╢¿í▒░┤┼Ñíú
  565. '               vbCancel    2   ░┤╧┬í░╚í╧√í▒░┤┼Ñíú
  566. '               vbAbort     3   ░┤╧┬í░╓╨╓╣í▒░┤┼Ñíú
  567. '               vbRetry     4   ░┤╧┬í░╓╪╩╘í▒░┤┼Ñíú
  568. '               vbIgnore    5   ░┤╧┬í░║÷┬╘í▒░┤┼Ñíú
  569. '               vbYes       6   ░┤╧┬í░╩╟í▒░┤┼Ñíú
  570. '               vbNo        7   ░┤╧┬í░╖±í▒░┤┼Ñíú
  571. '-----------------------------------------------------------
  572. '
  573. Function GetDefMsgBoxButton(intFlags) As Integer
  574.     '
  575.     ' ╩╫╧╚┼╨╢╧╧√╧ó┐≥╓╨╚▒╩í░┤┼Ñ╡─╨≥║┼íú
  576.     '
  577.     Dim intButtonNum As Integer
  578.     Dim intDefButton As Integer
  579.     
  580.     If (intFlags And vbDefaultButton2) = vbDefaultButton2 Then
  581.         intButtonNum = 2
  582.     ElseIf (intFlags And vbDefaultButton3) = vbDefaultButton3 Then
  583.         intButtonNum = 3
  584.     Else
  585.         intButtonNum = 1
  586.     End If
  587.     '
  588.     ' ┼╨╢╧╒²╘┌┤ª└φ╡─╧√╧ó┐≥└α╨═▓ó╖╡╗╪╚▒╩í░┤┼Ñíú
  589.     '
  590.     If (intFlags And vbRetryCancel) = vbRetryCancel Then
  591.         intDefButton = IIf(intButtonNum = 1, vbRetry, vbCancel)
  592.     ElseIf (intFlags And vbYesNoCancel) = vbYesNoCancel Then
  593.         Select Case intButtonNum
  594.             Case 1
  595.                 intDefButton = vbYes
  596.             Case 2
  597.                 intDefButton = vbNo
  598.             Case 3
  599.                 intDefButton = vbCancel
  600.             '╜ß╩° Case
  601.         End Select
  602.     ElseIf (intFlags And vbOKCancel) = vbOKCancel Then
  603.         intDefButton = IIf(intButtonNum = 1, vbOK, vbCancel)
  604.     ElseIf (intFlags And vbAbortRetryIgnore) = vbAbortRetryIgnore Then
  605.         Select Case intButtonNum
  606.             Case 1
  607.                 intDefButton = vbAbort
  608.             Case 2
  609.                 intDefButton = vbRetry
  610.             Case 3
  611.                 intDefButton = vbIgnore
  612.             '╜ß╩° Case
  613.         End Select
  614.     ElseIf (intFlags And vbYesNo) = vbYesNo Then
  615.         intDefButton = IIf(intButtonNum = 1, vbYes, vbNo)
  616.     Else
  617.         intDefButton = vbOK
  618.     End If
  619.     
  620.     GetDefMsgBoxButton = intDefButton
  621.     
  622. End Function
  623. '-----------------------------------------------------------
  624. ' ║»╩²: GetDiskSpaceFree
  625. ' ╗±╚í╓╕╢¿╟²╢»╞≈╡─╩ú╙α┤┼┼╠┐╒╝Σíú
  626. '
  627. ' ╚δ┐┌: [strDrive] - ╨Φ╝∞▓Θ┤┼┼╠┐╒╝Σ╡─╟²╢»╞≈
  628. '
  629. ' ╖╡╗╪: ╩ú╙α┤┼┼╠┐╒╝Σ┴┐ú¼│÷┤φ╘≥╖╡╗╪ -1
  630. '-----------------------------------------------------------
  631. '
  632. Function GetDiskSpaceFree(ByVal strDrive As String) As Long
  633.     Dim strCurDrive As String
  634.     Dim lDiskFree As Long
  635.  
  636.     On Error Resume Next
  637.  
  638.     '
  639.     '▒ú┤µ╡▒╟░╟²╢»╞≈
  640.     '
  641.     strCurDrive = Left$(CurDir$, 2)
  642.  
  643.     '
  644.     '╒√└φ╟²╢»╞≈╕±╩╜ú¼╩╣╓«╓╗░ⁿ└¿╥╗╕÷▒φ╩╛╡─╟²╢»╞≈╫╓─╕║═╥╗╕÷├░║┼
  645.     '
  646.     If InStr(strDrive, gstrSEP_DRIVE) = 0 Or Len(strDrive) > 2 Then
  647.         strDrive = Left$(strDrive, 1) & gstrSEP_DRIVE
  648.     End If
  649.  
  650.     '
  651.     '╟╨╗╗╡╜╨Φ╝∞▓Θ┤┼┼╠┐╒╝Σ╡─╟²╢»╞≈íú
  652.     'API ║»╩² DiskSpaceFree() ╓╗╣ñ╫≈╙┌╡▒╟░╟²╢»╞≈íú
  653.     '
  654.     ChDrive strDrive
  655.  
  656.     '
  657.     '╚τ╣√▓╗─▄╟╨╗╗╡╜╦∙╨Φ╡─╟²╢»╞≈ú¼╘≥╬¬│÷┤φú¼╖±╘≥╖╡╗╪╩ú╙α┤┼┼╠┐╒╝Σ┴┐
  658.     '
  659.     If Err <> 0 Or (strDrive <> Left$(CurDir$, 2)) Then
  660.         lDiskFree = -1
  661.     Else
  662.         lDiskFree = DiskSpaceFree()
  663.         If Err <> 0 Then    '╚τ╣√╒╥▓╗╡╜░▓╫░╣ñ╛▀░ⁿ╡─ DLL
  664.             lDiskFree = -1
  665.         End If
  666.     End If
  667.  
  668.     If lDiskFree = -1 Then
  669.         MsgError Error$ & LS$ & ResolveResString(resDISKSPCERR) & strDrive, MB_ICONEXCLAMATION, gstrTitle
  670.     End If
  671.  
  672.     GetDiskSpaceFree = lDiskFree
  673.  
  674.     '
  675.     '╜½╡▒╟░╟²╢»╞≈╔Φ╗╪╘¡╩╝╡─ú¼╟σ│²
  676.     '
  677.     ChDrive strCurDrive
  678.  
  679.     Err = 0
  680. End Function
  681.  
  682. '-----------------------------------------------------------
  683. ' ║»╩²: GetUNCShareName
  684. '
  685. ' ╕°╢¿ UNC ├√│╞ú¼╖╡╗╪─┐┬╝╡─▒φ╩╛╗·╞≈├√║═╣▓╧φ├√╡─╫ε╫≤▒▀╡─▓┐╖╓íú
  686. ' └²╚τú¼╕°╢¿ "\\SCHWEIZ\PUBLIC\APPS\LISTING.TXT"ú¼╖╡╗╪╫╓╖√┤«"\\SCHWEIZ\PUBLIC"
  687. '
  688. ' ╚τ╣√┬╖╛╢├√╙╨╨ºú¼╖╡╗╪▒φ╩╛╗·╞≈├√║═╣▓╧φ├√╡─╫╓╖√┤«ú¼╖±╘≥╖╡╗╪ NULL
  689. '-----------------------------------------------------------
  690. '
  691. Function GetUNCShareName(ByVal strFN As String) As Variant
  692.     GetUNCShareName = Null
  693.     If IsUNCName(strFN) Then
  694.         Dim iFirstSeparator As Integer
  695.         iFirstSeparator = InStr(3, strFN, gstrSEP_DIR)
  696.         If iFirstSeparator > 0 Then
  697.             Dim iSecondSeparator As Integer
  698.             iSecondSeparator = InStr(iFirstSeparator + 1, strFN, gstrSEP_DIR)
  699.             If iSecondSeparator > 0 Then
  700.                 GetUNCShareName = Left$(strFN, iSecondSeparator - 1)
  701.             Else
  702.                 GetUNCShareName = strFN
  703.             End If
  704.         End If
  705.     End If
  706. End Function
  707.  
  708. '-----------------------------------------------------------
  709. ' ║»╩²: GetWindowsSysDir
  710. '
  711. ' ╡≈╙├ windows API ║»╩²╗±╚í windows\SYSTEM ─┐┬╝▓ó▒ú╓ñ┤µ╘┌╥╗╕÷╬▓╦µ╡──┐┬╝╖╓╕⌠╖√
  712. '
  713. ' ╖╡╗╪: windows\SYSTEM ─┐┬╝
  714. '-----------------------------------------------------------
  715. '
  716. Function GetWindowsSysDir() As String
  717.     Dim strBuf As String
  718.  
  719.     strBuf = Space$(gintMAX_SIZE)
  720.  
  721.     '
  722.     '╗±╚í system ─┐┬╝▓ó╡≈╒√╗║│σ╟°╡╜╖╡╗╪╡─╚╖╩╡│ñ╢╚ú¼╚τ╣√├╗╙╨╖╡╗╪─┐┬╝╖╓╕⌠╖√(\)ú¼╝╙╥╗╕÷
  723.     '
  724.     If GetSystemDirectory(strBuf, gintMAX_SIZE) > 0 Then
  725.         strBuf = StripTerminator(strBuf)
  726.         AddDirSep strBuf
  727.         
  728.         GetWindowsSysDir = strBuf
  729.     Else
  730.         GetWindowsSysDir = gstrNULL
  731.     End If
  732. End Function
  733. '-----------------------------------------------------------
  734. ' ╫╙│╠╨≥: TreatAsWin95
  735. '
  736. ' ╖╡╗╪ Trueú¼╚τ╣√╘╦╨╨╙┌ Windows 95 ╗≥╒Γ╥╗░µ▒╛╡─ NTú¼
  737. ' ║├╧≤╦ⁿ╩╟╬¬╫ó▓ß▒φíó╙ª╙├│╠╨≥╡╟┬╝╥╘╝░╔╛│²─┐╡─╡─ Windows 95íú
  738. '-----------------------------------------------------------
  739. '
  740. Function TreatAsWin95() As Boolean
  741.     If IsWindows95() Then
  742.         TreatAsWin95 = True
  743.     ElseIf fNTWithShell() Then
  744.         TreatAsWin95 = True
  745.     Else
  746.         TreatAsWin95 = False
  747.     End If
  748. End Function
  749. '-----------------------------------------------------------
  750. ' ║»╩²: IsDepFile
  751. '
  752. ' ╚τ╣√┤½╡▌╡╜╒Γ╕÷╫╙│╠╨≥╡─╬─╝■╩╟┤╙╩⌠╬─╝■ (*.dep)ú¼╖╡╗╪ trueíú
  753. ' ╫÷│÷╒Γ╓╓┼╨╢╧╗∙╙┌╚╖╚╧╬─╝■└⌐╒╣├√╩╟ .dep ╥╘╝░╦ⁿ╦∙░ⁿ║¼╡─░µ▒╛╨┼╧óíú
  754. '-----------------------------------------------------------
  755. '
  756. Function fIsDepFile(strFilename As String) As Boolean
  757.     Const strEXT_DEP = "DEP"
  758.     
  759.     fIsDepFile = False
  760.     
  761.     If UCase(Extension(strFilename)) = strEXT_DEP Then
  762.         If GetFileVersion(strFilename) <> gstrNULL Then
  763.             fIsDepFile = True
  764.         End If
  765.     End If
  766. End Function
  767.  
  768. '-----------------------------------------------------------
  769. ' ║»╩²: IsWin32
  770. '
  771. ' ╚τ╣√│╠╨≥╘╦╨╨╙┌ Win32 (╝┤╚╬║╬ 32 ╬╗▓┘╫≈╧╡═│)ú¼╖╡╗╪ true
  772. '-----------------------------------------------------------
  773. '
  774. Function IsWin32() As Boolean
  775.     IsWin32 = (IsWindows95() Or IsWindowsNT())
  776. End Function
  777.  
  778. '-----------------------------------------------------------
  779. ' ║»╩²: IsWindows95
  780. '
  781. ' ╚τ╣√│╠╨≥╘╦╨╨╙┌ Windows 95 ╗≥║≤╨°░µ▒╛ú¼╖╡╗╪ true
  782. '-----------------------------------------------------------
  783. '
  784. Function IsWindows95() As Boolean
  785.     Const dwMask95 = &H2&
  786.     If GetWinPlatform() And dwMask95 Then
  787.         IsWindows95 = True
  788.     Else
  789.         IsWindows95 = False
  790.     End If
  791. End Function
  792.  
  793. '-----------------------------------------------------------
  794. ' ║»╩²: IsWindowsNT
  795. '
  796. ' ╚τ╣√│╠╨≥╘╦╨╨╙┌ Windows NTú¼╖╡╗╪ true
  797. '-----------------------------------------------------------
  798. '
  799. Function IsWindowsNT() As Boolean
  800.     Const dwMaskNT = &H1&
  801.     If GetWinPlatform() And dwMaskNT Then
  802.         IsWindowsNT = True
  803.     Else
  804.         IsWindowsNT = False
  805.     End If
  806. End Function
  807.  
  808. '-----------------------------------------------------------
  809. ' ║»╩²: IsWindowsNT4WithoutSP2
  810. '
  811. ' ┼╨╢╧╩╟╖±╙├╗º╘╦╨╨╙┌ Windows NT 4.0ú¼╡½├╗╙╨ Service Pack 2 (SP2)íú
  812. ' ╚τ╣√╘╦╨╨╙┌╞Σ╦√╚╬║╬╞╜╠¿ú¼╖╡╗╪ Falseíú
  813. '
  814. ' ╚δ┐┌: [╬▐]
  815. '
  816. ' ╖╡╗╪: Trueú¼╚τ╣√╓╗╘╦╨╨╙┌ Windows NT 4.0 ╢°├╗╙╨░▓╫░ Service Pack 2íú
  817. '-----------------------------------------------------------
  818. '
  819. Function IsWindowsNT4WithoutSP2() As Boolean
  820.     IsWindowsNT4WithoutSP2 = False
  821.     
  822.     If Not IsWindowsNT() Then
  823.         Exit Function
  824.     End If
  825.     
  826.     Dim osvi As OSVERSIONINFO
  827.     Dim strCSDVersion As String
  828.     osvi.dwOSVersionInfoSize = Len(osvi)
  829.     If GetVersionEx(osvi) = 0 Then
  830.         Exit Function
  831.     End If
  832.     strCSDVersion = StripTerminator(osvi.szCSDVersion)
  833.     
  834.     '╩╟ Windows NT 4.0 ┬≡ú┐
  835.     Const NT4MajorVersion = 4
  836.     Const NT4MinorVersion = 0
  837.     If (osvi.dwMajorVersion <> NT4MajorVersion) Or (osvi.dwMinorVersion <> NT4MinorVersion) Then
  838.         '▓╗ú¼╖╡╗╪ Falseíú
  839.         Exit Function
  840.     End If
  841.     
  842.     '╚τ╣√├╗╙╨░▓╫░ service packú¼╗≥░▓╫░┴╦ service Pack 1ú¼╖╡╗╪ Trueíú
  843.     Const strSP1 = "SERVICE PACK 1"
  844.     If strCSDVersion = "" Then
  845.         IsWindowsNT4WithoutSP2 = True '├╗╙╨░▓╫░ service pack
  846.     ElseIf strCSDVersion = strSP1 Then
  847.         IsWindowsNT4WithoutSP2 = True '╓╗░▓╫░┴╦ SP1
  848.     End If
  849. End Function
  850.  
  851. '-----------------------------------------------------------
  852. ' ║»╩²: IsUNCName
  853. '
  854. ' ┼╨╢╧╓╕╢¿╡─┬╖╛╢├√╩╟╖±╩╟ UNC ├√íú
  855. ' UNC (═¿╙├╡─├ⁿ├√╘╝╢¿) ├√═¿│ú╙├╙┌╓╕╢¿╗·╞≈╫╩╘┤ú¼╚τ╘╢│╠═°┬τ╣▓╧φíó├ⁿ├√╣▄╡└╡╚íú
  856. ' ╥╗╕÷ UNC ├√╡─└²╫╙╩╟ "\\SERVER\SHARE\FILENAME.EXT"íú
  857. '
  858. ' ╚δ┐┌: [strPathName] - ╥¬╝∞▓Θ╡─┬╖╛╢├√
  859. '
  860. ' ╖╡╗╪: Trueú¼╚τ╣√┬╖╛╢├√╩╟ UNC ├√ú¼╖±╘≥╬¬ False
  861. '-----------------------------------------------------------
  862. '
  863. Function IsUNCName(ByVal strPathName As String) As Integer
  864.     Const strUNCNAME$ = "\\//\"        '╦∙╥╘┐╔╥╘╝∞▓Θ \\, //, \/, /\
  865.  
  866.     IsUNCName = ((InStr(strUNCNAME, Left$(strPathName, 2)) > 0) And _
  867.                  (Len(strPathName) > 1))
  868. End Function
  869. '-----------------------------------------------------------
  870. ' ║»╩²: LogSilentMsg
  871. '
  872. ' ╚τ╣√╩╟░▓╛▓╡─░▓╫░ú¼▒╛╫╙│╠╨≥╨┤╥╗╠⌡╧√╧ó╡╜╬─╝■ gstrSilentLogíú
  873. '
  874. ' ╚δ┐┌: [strMsg] - ╧√╧ó
  875. '
  876. ' ═¿│ú╡╪ú¼╘┌╧▀╡≈╙├▒╛╫╙│╠╨≥╧╘╩╛╥╗╕÷ MsgBoxú¼strMsg ╙δ╜½╘┌ MsgBox ╓╨╧╘╩╛╡─╧√╧ó╥╗╤∙íú
  877. ' (╫ó╥Γ: ╝╠╨°╓º│╓í░░▓╛▓í▒─ú╩╜┬≡ú┐ Rick Andrews)
  878.  
  879. '-----------------------------------------------------------
  880. '
  881. Sub LogSilentMsg(strMsg As String)
  882.     If Not gfSilent Then Exit Sub
  883.     
  884.     Dim fn As Integer
  885.     
  886.     On Error Resume Next
  887.     
  888.     fn = FreeFile
  889.     
  890.     Open gstrSilentLog For Append As fn
  891.     Print #fn, strMsg
  892.     Close fn
  893.     Exit Sub
  894. End Sub
  895. '-----------------------------------------------------------
  896. ' ║»╩²: LogSMSMsg
  897. '
  898. ' ╚τ╣√╩╟ SMS ░▓╫░ú¼▒╛╫╙│╠╨≥╠φ╝╙╥╗╕÷╧√╧ó╡╜ gstrSMSDescription ╫╓╖√┤«íú
  899. ' ╡▒░▓╫░═Ω│╔╓«║≤(│╔╣ª╗≥╩º░▄)ú¼╒Γ╕÷╫╓╖√┤«╔╘║≤╜½▒╗╨┤╡╜╫┤╠¼╬─╝■ (*.MIF) ╓╨íú
  900. '
  901. ' ╫ó╥Γú¼╚τ╣√ gfSMS = Falseú¼, ╘≥╩╟├╗╙╨╡╟┬╝╧√╧óíú
  902. ' ╥≥┤╦ú¼╥¬▒ú╗ñ─│╨⌐╧√╧ó▓╗▒╗╡╟┬╝(╚τ ╜÷╚╖╚╧╧√╧ó)ú¼┴┘╩▒╡╪╔Φ gfSMS = Falseíú
  903. '
  904. ' ╚δ┐┌: [strMsg] - ╧√╧ó
  905. '
  906. ' ═¿│ú╡╪ú¼╘┌╧▀╡≈╙├▒╛╫╙│╠╨≥╧╘╩╛╥╗╕÷ MsgBoxú¼strMsg ╙δ╜½╘┌ MsgBox ╓╨╧╘╩╛╡─╧√╧ó╥╗╤∙íú
  907. '-----------------------------------------------------------
  908. '
  909. Sub LogSMSMsg(strMsg As String)
  910.     If Not gfSMS Then Exit Sub
  911.     '
  912.     ' ╫╖╝╙╒Γ╕÷╧√╧óíú╫ó╥Γú¼╫▄│ñ╢╚▓╗─▄│¼╣² 255 ╕÷╫╓╖√ú¼╦∙╥╘╜╪╢╧│¼│ñ╡─╦∙╙╨▓┐╖╓íú
  913.     '
  914.     gstrSMSDescription = Left(gstrSMSDescription & strMsg, MAX_SMS_DESCRIP)
  915. End Sub
  916.  
  917. '-----------------------------------------------------------
  918. ' ║»╩²: MakePathAux
  919. '
  920. ' ┤┤╜¿╓╕╢¿╡──┐┬╝┬╖╛╢íú
  921. '
  922. ' ╚τ╣√╙÷╡╜┤φ╬≤ú¼╘≥├╗╙╨╙├╗º╜╗╗Ñ╖ó╔·íú
  923. ' ╚τ╣√╧ú═√╙├╗º╜╗╗Ñú¼╩╣╙├╧α╣╪║»╩² MakePathAux()íú
  924. '
  925. ' ╚δ┐┌: [strDirName] - ╥¬╔·│╔╡──┐┬╝┬╖╛╢
  926. '
  927. ' ╖╡╗╪: Trueú¼╚τ╣√│╔╣ªú╗╚τ╣√│÷┤φú¼╖╡╗╪ Falseíú
  928. '-----------------------------------------------------------
  929. '
  930. Function MakePathAux(ByVal strDirName As String) As Boolean
  931.     Dim strPath As String
  932.     Dim intOffset As Integer
  933.     Dim intAnchor As Integer
  934.     Dim strOldPath As String
  935.  
  936.     On Error Resume Next
  937.  
  938.     '
  939.     '╠φ╝╙╬▓╦µ╡─╖┤╨▒╕▄
  940.     '
  941.     If Right$(strDirName, 1) <> gstrSEP_DIR Then
  942.         strDirName = strDirName & gstrSEP_DIR
  943.     End If
  944.  
  945.     strOldPath = CurDir$
  946.     MakePathAux = False
  947.     intAnchor = 0
  948.  
  949.     '
  950.     '╤¡╗╖▓ó╩╣├┐╕÷╫╙─┐┬╝╕≈╫╘╢└┴óíú
  951.     '
  952.     intOffset = InStr(intAnchor + 1, strDirName, gstrSEP_DIR)
  953.     intAnchor = intOffset '┤╙╓┴╔┘╥╗╕÷╖┤╨▒╕▄┤ª┐¬╩╝ú¼╝┤ "C:\FirstDir"
  954.     Do
  955.         intOffset = InStr(intAnchor + 1, strDirName, gstrSEP_DIR)
  956.         intAnchor = intOffset
  957.  
  958.         If intAnchor > 0 Then
  959.             strPath = Left$(strDirName, intOffset - 1)
  960.             ' ┼╨╢╧╒Γ╕÷─┐┬╝╩╟╖±╥╤╛¡┤µ╘┌
  961.             Err = 0
  962.             ChDir strPath
  963.             If Err Then
  964.                 ' ▒╪╨δ┤┤╜¿╒Γ╕÷─┐┬╝
  965.                 Err = 0
  966. #If LOGGING Then
  967.                 NewAction gstrKEY_CREATEDIR, """" & strPath & """"
  968. #End If
  969.                 MkDir strPath
  970. #If LOGGING Then
  971.                 If Err Then
  972.                     LogError ResolveResString(resMAKEDIR) & " " & strPath
  973.                     AbortAction
  974.                     GoTo Done
  975.                 Else
  976.                     CommitAction
  977.                 End If
  978. #End If
  979.             End If
  980.         End If
  981.     Loop Until intAnchor = 0
  982.  
  983.     MakePathAux = True
  984. Done:
  985.     ChDir strOldPath
  986.  
  987.     Err = 0
  988. End Function
  989.  
  990. '-----------------------------------------------------------
  991. ' ║»╩²: MsgError
  992. '
  993. ' ╟┐╓╞╩≤▒Ω╓╕╒δ╬¬╚▒╩í└α╨═ú¼╡≈╙├ VB ╡─ MsgBox ║»╩²ú¼
  994. ' ╡╟┬╝╒Γ╕÷┤φ╬≤ú¼▓ó(╜÷ 32 ╬╗)╨┤╧┬╧√╧ó║═╙├╗º╧∞╙ª╡─╚╒╓╛╬─╝■(╜÷ 32 ╬╗)íú
  995. '
  996. ' ╚δ┐┌: [strMsg] - ╥¬╧╘╩╛╡─╧√╧ó
  997. '       [intFlags] - MsgBox ║»╩²└α╨═▒Ω╓╛
  998. '       [strCaption] - ╬¬╧√╧ó┐≥╩╣╙├╡─▒Ω╠Γ
  999. '       [intLogType] (┐╔╤í╡─) - ╔·│╔╡─╚╒╓╛╬─╝■╧ε└α╨═íú
  1000. '                    ╚▒╩í╡╪ú¼┤┤╜¿╥╗╕÷┤φ╬≤╧εíú╙├║»╩²┤┤╜¿╛»╕µíú
  1001. '                    ╙╨╨º└α╨═╬¬ú║MSGERR_ERROR ║═ MSGERR_WARNING
  1002. '
  1003. ' ╖╡╗╪: MsgBox ║»╩²╡─╜ß╣√
  1004. '-----------------------------------------------------------
  1005. '
  1006. Function MsgError(ByVal strMsg As String, ByVal intFlags As Integer, ByVal strCaption As String, Optional ByVal intLogType As Variant) As Integer
  1007.     Dim iRet As Integer
  1008.     
  1009.     iRet = MsgFunc(strMsg, intFlags, strCaption)
  1010.     MsgError = iRet
  1011. #If LOGGING Then
  1012.     ' ╨Φ╥¬╡╟┬╝╒Γ╕÷┤φ╬≤▓ó╜Γ┬δ╙├╗º╧∞╙ªíú
  1013.     Dim strID As String
  1014.     Dim strLogMsg As String
  1015.  
  1016.     Select Case iRet
  1017.         Case IDOK
  1018.             strID = ResolveResString(resLOG_IDOK)
  1019.         Case IDCANCEL
  1020.             strID = ResolveResString(resLOG_IDCANCEL)
  1021.         Case IDABORT
  1022.             strID = ResolveResString(resLOG_IDABORT)
  1023.         Case IDRETRY
  1024.             strID = ResolveResString(resLOG_IDRETRY)
  1025.         Case IDIGNORE
  1026.             strID = ResolveResString(resLOG_IDIGNORE)
  1027.         Case IDYES
  1028.             strID = ResolveResString(resLOG_IDYES)
  1029.         Case IDNO
  1030.             strID = ResolveResString(resLOG_IDNO)
  1031.         Case Else
  1032.             strID = ResolveResString(resLOG_IDUNKNOWN)
  1033.         '╜ß╩° Case
  1034.     End Select
  1035.  
  1036.     strLogMsg = strMsg & LF$ & "(" & ResolveResString(resLOG_USERRESPONDEDWITH, "|1", strID) & ")"
  1037.     If IsMissing(intLogType) Then
  1038.         intLogType = MSGERR_ERROR
  1039.     End If
  1040.     Select Case intLogType
  1041.         Case MSGERR_WARNING
  1042.             LogWarning strLogMsg
  1043.         Case MSGERR_ERROR
  1044.             LogError strLogMsg
  1045.         Case Else
  1046.             LogError strLogMsg
  1047.         '╜ß╩° Case
  1048.     End Select
  1049. #End If
  1050. End Function
  1051.  
  1052. '-----------------------------------------------------------
  1053. ' ║»╩²: MsgFunc
  1054. '
  1055. ' ╟┐╓╞╩≤▒Ω╓╕╒δ╬¬╚▒╩í└α╨═ú¼╡≈╙├ VB ╡─ MsgBox ║»╩²ú¼▓╬╝√ MsgErroríú
  1056. '
  1057. ' ╚δ┐┌: [strMsg] - ╥¬╧╘╩╛╡─╧√╧ó
  1058. '       [intFlags] - MsgBox ║»╩²└α╨═▒Ω╓╛
  1059. '       [strCaption] - ╬¬╧√╧ó┐≥╩╣╙├╡─▒Ω╠Γ
  1060. ' ╖╡╗╪: MsgBox ║»╩²╡─╜ß╣√
  1061. '-----------------------------------------------------------
  1062. '
  1063. Function MsgFunc(ByVal strMsg As String, ByVal intFlags As Integer, ByVal strCaption As String) As Integer
  1064.     Dim intOldPointer As Integer
  1065.   
  1066.     intOldPointer = Screen.MousePointer
  1067.     If gfNoUserInput Then
  1068.         MsgFunc = GetDefMsgBoxButton(intFlags)
  1069.         If gfSilent = True Then
  1070.             LogSilentMsg strMsg
  1071.         End If
  1072.         If gfSMS = True Then
  1073.             LogSMSMsg strMsg
  1074.             gfDontLogSMS = False
  1075.         End If
  1076.     Else
  1077.         Screen.MousePointer = gintMOUSE_DEFAULT
  1078.         MsgFunc = MsgBox(strMsg, intFlags, strCaption)
  1079.         Screen.MousePointer = intOldPointer
  1080.     End If
  1081. End Function
  1082.  
  1083. '-----------------------------------------------------------
  1084. ' ║»╩²: MsgWarning
  1085. '
  1086. ' ╟┐╓╞╩≤▒Ω╓╕╒δ╬¬╚▒╩í└α╨═ú¼╡≈╙├ VB ╡─ MsgBox ║»╩²ú¼
  1087. ' ╡╟┬╝╒Γ╕÷┤φ╬≤ú¼▓ó(╜÷ 32 ╬╗)╨┤╧┬╧√╧ó║═╙├╗º╧∞╙ª╡─╚╒╓╛╬─╝■(╜÷ 32 ╬╗)íú
  1088. ' ╚δ┐┌: [strMsg] - ╥¬╧╘╩╛╡─╧√╧ó
  1089. '       [intFlags] - MsgBox ║»╩²└α╨═▒Ω╓╛
  1090. '       [strCaption] - ╬¬╧√╧ó┐≥╩╣╙├╡─▒Ω╠Γ
  1091. '
  1092. ' ╖╡╗╪: MsgBox ║»╩²╡─╜ß╣√
  1093. '-----------------------------------------------------------
  1094. '
  1095. Function MsgWarning(ByVal strMsg As String, ByVal intFlags As Integer, ByVal strCaption As String) As Integer
  1096.     MsgWarning = MsgError(strMsg, intFlags, strCaption, MSGERR_WARNING)
  1097. End Function
  1098. '-----------------------------------------------------------
  1099. ' ╫╙│╠╨≥: SetFormFont
  1100. '
  1101. ' ▒Θ└·╓╕╢¿┤░╠σ╔╧╡─╦∙╙╨┐╪╝■ú¼▓ó╘┌╫╩╘┤(Resource)╬─╝■╓╨╡─╩⌠╨╘╝»╔╧╔Φ╓├ Fontíú
  1102. '
  1103. ' ╚δ┐┌: [frm] - ╨Φ╥¬╔Φ╓├╫╓╠σ╡─┐╪╝■╦∙╘┌╡─┤░╠σíú
  1104. '-----------------------------------------------------------
  1105. '
  1106. Public Sub SetFormFont(frm As Form)
  1107.     Dim ctl As Control
  1108.     Dim fntSize As Integer
  1109.     Dim fntName As String
  1110.     Dim fntBold As Boolean
  1111.     '
  1112.     ' ▒╛╣²│╠╜½╘┌╫╩╘┤╬─╝■╡─╫╓╠σ┴╨▒φ╓╨╔Φ╓├├┐╕÷┐╪╝■╡─╫╓╠σíú
  1113.     '
  1114.     ' ─│╨⌐┐╪╝■┐╔─▄╩º░▄ú¼╦∙╥╘╜½┤╙╧┬╥╗╕÷╓╪╨┬┐¬╩╝...
  1115.     '
  1116.     On Error Resume Next
  1117.     '
  1118.     ' ┤╙╫╩╘┤╬─╝■╗±╚í╫╓╠σ├√║═┤≤╨í
  1119.     '
  1120.     fntSize = CInt(LoadResString(resFONTSIZE))
  1121.     fntBold = (LoadResString(resFONTBOLD) = Format(True))
  1122.     fntName = LoadResString(resFONTNAME)
  1123.     '
  1124.     ' ╔Φ╓├┤░╠σ╫╓╠σ
  1125.     '
  1126.     frm.FontSize = fntSize
  1127.     frm.FontBold = fntBold
  1128.     frm.FontName = fntName
  1129.     If Err.Number <> 0 Then
  1130.         '
  1131.         ' ╔Φ╓├╫╓╠σ╩º░▄ú¼┐╔─▄╙╔╙┌╫╓╠σ╬┤▒╗░▓╫░íú
  1132.         ' ╘┌╫╩╘┤╬─╝■╓╨┤µ╙╨┴╜╕÷▒╕╙├╡─╫╓╠σ├√ú¼╩╘╩╘╦ⁿ├╟íú
  1133.         '
  1134.         Err.Number = 0
  1135.         fntName = LoadResString(resFONTNAMEBACKUP1)
  1136.         frm.FontName = fntName
  1137.         If Err.Number <> 0 Then
  1138.             '
  1139.             ' ╚╘╚╗╬▐╖¿╣ñ╫≈íú╥╗╕÷╫ε║≤╡─╗·╗ß╩╟ú¼│ó╩╘╡┌╢■╕÷▒╕╙├╫╓╠σíú
  1140.             ' ╚τ╣√╒Γ╥╗┤╬╩º░▄┴╦ú¼╜½╙├╚▒╩í╫╓╠σ╝╠╨°╧┬╚Ñíú
  1141.             '
  1142.             Err.Number = 0
  1143.             fntName = LoadResString(resFONTNAMEBACKUP2)
  1144.             frm.FontName = fntName
  1145.             Err.Number = 0
  1146.         End If
  1147.     End If
  1148.         
  1149.     '
  1150.     ' ╤¡╗╖├┐╕÷┐╪╝■▓ó╩╘═╝╔Φ╓├╞Σ╫╓╠σ╩⌠╨╘ú¼╒Γ┐╔─▄╡╝╓┬│÷┤φú¼╡½┤φ╬≤┤ª└φ╣²│╠╥╤╛¡╣╪▒╒
  1151.     '
  1152.     For Each ctl In frm.Controls
  1153.         ctl.FontSize = fntSize
  1154.         ctl.FontName = fntName
  1155.         ctl.FontBold = fntBold
  1156.     Next
  1157.     '
  1158.     ' ═╦│÷└┤ú¼╓╪╨┬╔Φ┤φ╬≤┤ª└φ╣²│╠
  1159.     '
  1160.     Set ctl = Nothing
  1161.     On Error GoTo 0
  1162.     Exit Sub
  1163.        
  1164. End Sub
  1165.  
  1166. '-----------------------------------------------------------
  1167. ' ╫╙│╠╨≥: SetMousePtr
  1168. '
  1169. ' ╠ß╣⌐╥╗╓╓╜÷╡▒╩≤▒Ω╓╕╒δ╫┤╠¼╕─▒Σ╩▒ú¼╔Φ╓├╩≤▒Ω╓╕╒δ╡─╖╜╖¿íú
  1170. ' ╢╘╙┌├┐╥╗╕÷ HOURGLASS ╡≈╙├ú¼╢╝╙ª╙╨╥╗╕÷╧α╙ª╡─ DEFAULT ╡≈╙├íú
  1171. ' ╞Σ╦√└α╨═╡─╩≤▒Ω╓╕╒δ┐╔╥╘╓▒╜╙╔Φ╓├íú
  1172. '
  1173. ' ╚δ┐┌: [intMousePtr] - ╧ú═√╡─╩≤▒Ω╓╕╒δ└α╨═
  1174. '-----------------------------------------------------------
  1175. '
  1176. Sub SetMousePtr(intMousePtr As Integer)
  1177.     Static intPtrState As Integer
  1178.  
  1179.     Select Case intMousePtr
  1180.         Case gintMOUSE_HOURGLASS
  1181.             intPtrState = intPtrState + 1
  1182.         Case gintMOUSE_DEFAULT
  1183.             intPtrState = intPtrState - 1
  1184.             If intPtrState < 0 Then
  1185.                 intPtrState = 0
  1186.             End If
  1187.         Case Else
  1188.             Screen.MousePointer = intMousePtr
  1189.             Exit Sub
  1190.         '╜ß╩° Case
  1191.     End Select
  1192.  
  1193.     Screen.MousePointer = IIf(intPtrState > 0, gintMOUSE_HOURGLASS, gintMOUSE_DEFAULT)
  1194. End Sub
  1195.  
  1196. '-----------------------------------------------------------
  1197. ' ║»╩²: StripTerminator
  1198. '
  1199. ' ╖╡╗╪╖╟┴π╜ß╬▓╡─╫╓╖√┤«íú╡Σ╨═╡╪ú¼╒Γ╩╟╥╗╕÷╙╔ Windows API ╡≈╙├╖╡╗╪╡─╫╓╖√┤«íú
  1200. '
  1201. ' ╚δ┐┌: [strString] - ╥¬╔╛│²╜ß╩°╖√╡─╫╓╖√┤«
  1202. '
  1203. ' ╖╡╗╪: ┤½╡▌╡─╫╓╖√┤«╝⌡╚Ñ╬▓▓┐┴π╥╘║≤╡─╓╡íú
  1204. '-----------------------------------------------------------
  1205. '
  1206. Function StripTerminator(ByVal strString As String) As String
  1207.     Dim intZeroPos As Integer
  1208.  
  1209.     intZeroPos = InStr(strString, Chr$(0))
  1210.     If intZeroPos > 0 Then
  1211.         StripTerminator = Left$(strString, intZeroPos - 1)
  1212.     Else
  1213.         StripTerminator = strString
  1214.     End If
  1215. End Function
  1216.  
  1217. '-----------------------------------------------------------
  1218. ' ║»╩²: GetFileVersion
  1219. '
  1220. ' ╬¬╓╕╢¿╡─╬─╝■╖╡╗╪─┌▓┐╬─╝■░µ▒╛║┼íú
  1221. ' ╒Γ╥▓╨φ╙δ╘┌í░╬─╝■╣▄└φ╞≈í▒╡─╬─╝■╩⌠╨╘╢╘╗░┐≥╓╨╧╘╩╛╡─░µ▒╛║┼╙╨╦∙▓╗═¼íú
  1222. ' ╦ⁿ╙δ╘┌ VB5 í░░▓╫░│╠╨≥╧≥╡╝í▒╡─í░╬─╝■╧╕╜┌í▒╥╗╞┴╓╨╧╘╩╛╡─║┼╧α═¼íú
  1223. ' ╒Γ╕÷║┼╩╟╘┌▒╚╜╧╬─╝■░µ▒╛╩▒╙╔ Windows VerInstallFile API ╦∙╩╣╙├╡─íú
  1224. '
  1225. ' ╚δ┐┌: [strFilename] - ╧ú═√╡├╡╜╞Σ╡─░µ▒╛║┼╬─╝■
  1226. '       [fIsRemoteServerSupportFile] - ╩╟╖±╕├╬─╝■╩╟╥╗╕÷╘╢│╠ ActiveX ▓┐╝■╓º│╓╬─╝■ (.VBR)ú¼
  1227. '          ╜÷╞≤╥╡░µíú╚τ╣√▓╗╩╟ú¼╝┘╔Φ╬¬ Falseíú
  1228. '
  1229. ' ╖╡╗╪: ╚τ╣√╒╥╡╜┴╦ú¼╖╡╗╪░µ▒╛║┼╫╓╖√┤«ú╗╖±╘≥ gstrNULL
  1230. '-----------------------------------------------------------
  1231. '
  1232. Function GetFileVersion(ByVal strFilename As String, Optional ByVal fIsRemoteServerSupportFile) As String
  1233.     Dim sVerInfo As VERINFO
  1234.     Dim strVer As String
  1235.  
  1236.     On Error GoTo GFVError
  1237.  
  1238.     If IsMissing(fIsRemoteServerSupportFile) Then
  1239.         fIsRemoteServerSupportFile = False
  1240.     End If
  1241.     
  1242.     '
  1243.     '╜½╡├╡╜╡─╬─╝■░µ▒╛╨┼╧ó╖┼╡╜ VERINFO ╜ß╣╣╓╨ú¼▓ó┤╙╩╩║╧╡─╘¬╦╪╓╨╩╒╝»░µ▒╛╫╓╖√┤«íú
  1244.     '
  1245.     If GetFileVerStruct(strFilename, sVerInfo, fIsRemoteServerSupportFile) = True Then
  1246.         strVer = Format$(sVerInfo.nMSHi) & gstrDECIMAL & Format$(sVerInfo.nMSLo) & gstrDECIMAL
  1247.         strVer = strVer & Format$(sVerInfo.nLSHi) & gstrDECIMAL & Format$(sVerInfo.nLSLo)
  1248.         GetFileVersion = strVer
  1249.     Else
  1250.         GetFileVersion = gstrNULL
  1251.     End If
  1252.     
  1253.     Exit Function
  1254.     
  1255. GFVError:
  1256.     GetFileVersion = gstrNULL
  1257.     Err = 0
  1258. End Function
  1259.  
  1260. '-----------------------------------------------------------
  1261. ' ║»╩²: GetFileVerStruct
  1262. '
  1263. ' ╜½╡├╡╜╡─╬─╝■░µ▒╛╨┼╧ó╖┼╡╜ VERINFO TYPE ▒Σ┴┐╓╨
  1264. '
  1265. ' ╚δ┐┌: [strFilename] - ╥¬╗±╚í░µ▒╛╨┼╧ó╡─╬─╝■├√
  1266. '       [fIsRemoteServerSupportFile] - ╩╟╖±╕├╬─╝■╩╟╥╗╕÷╘╢│╠ ActiveX ▓┐╝■╓º│╓╬─╝■ (.VBR)ú¼
  1267. '          ╜÷╞≤╥╡░µíú╚τ╣√▓╗╩╟ú¼╝┘╔Φ╬¬ Falseíú
  1268. ' │÷┐┌: [sVerInfo] - ╥¬╠ε│Σ░µ▒╛╨┼╧ó╡─ VERINFO └α╨═
  1269. '
  1270. ' ╖╡╗╪: Trueú¼╚τ╣√╒╥╡╜░µ▒╛╨┼╧óú╗╖±╘≥╬¬ False
  1271. '-----------------------------------------------------------
  1272. '
  1273. Function GetFileVerStruct(ByVal strFilename As String, sVerInfo As VERINFO, Optional ByVal fIsRemoteServerSupportFile) As Boolean
  1274.     Const strFIXEDFILEINFO$ = "\"
  1275.  
  1276.     Dim lVerSize As Long
  1277.     Dim lVerHandle As Long
  1278.     Dim lpBufPtr As Long
  1279.     Dim byteVerData() As Byte
  1280.     Dim fFoundVer As Boolean
  1281.  
  1282.     GetFileVerStruct = False
  1283.     fFoundVer = False
  1284.  
  1285.     If IsMissing(fIsRemoteServerSupportFile) Then
  1286.         fIsRemoteServerSupportFile = False
  1287.     End If
  1288.     
  1289.     If fIsRemoteServerSupportFile Then
  1290.         GetFileVerStruct = GetRemoteSupportFileVerStruct(strFilename, sVerInfo)
  1291.         fFoundVer = True
  1292.     Else
  1293.         '
  1294.         '╗±╚í╬─╝■░µ▒╛╨┼╧ó╡─┤≤╨íú¼╕°╦ⁿ╖╓┼Σ╥╗╕÷╗║│σ╟°ú¼▓ó╗±╚í░µ▒╛╨┼╧óíú
  1295.         '╜╙╫┼ú¼╬╥├╟▓Θ╤»╣╠╢¿╡─╬─╝■╨┼╧ó▓┐╖╓ú¼╘┌─╟└∩ú¼╙╔ Windows VerInstallFile API ╩╣╙├╡──┌▓┐╬─╝■░µ▒╛▒╗▒ú│╓íú
  1296.         '╬╥├╟┐╔╥╘╕│╓╡╣╠╢¿╡─╬─╝■╨┼╧ó╡╜ VERINFO ╜ß╣╣╓╨íú
  1297.         '
  1298.         lVerSize = GetFileVersionInfoSize(strFilename, lVerHandle)
  1299.         If lVerSize > 0 Then
  1300.             ReDim byteVerData(lVerSize)
  1301.             If GetFileVersionInfo(strFilename, lVerHandle, lVerSize, byteVerData(0)) <> 0 Then ' (Pass byteVerData array via reference to first element)
  1302.                 If VerQueryValue(byteVerData(0), strFIXEDFILEINFO & "", lpBufPtr, lVerSize) <> 0 Then
  1303.                     lmemcpy sVerInfo, lpBufPtr, lVerSize
  1304.                     fFoundVer = True
  1305.                     GetFileVerStruct = True
  1306.                 End If
  1307.             End If
  1308.         End If
  1309.     End If
  1310.     
  1311.     If Not fFoundVer Then
  1312.         '
  1313.         ' ┤╙╬─╝■╓╨▓Θ╒╥░µ▒╛╨┼╧ó▓╗│╔╣ªíú
  1314.         ' ╥╗╕÷┐╔─▄╩╟╦ⁿ╩╟╥╗╕÷┤╙╩⌠╬─╝■íú
  1315.         '
  1316.         If UCase(Extension(strFilename)) = gstrEXT_DEP Then
  1317.             GetFileVerStruct = GetDepFileVerStruct(strFilename, sVerInfo)
  1318.         End If
  1319.     End If
  1320. End Function
  1321. '-----------------------------------------------------------
  1322. ' ║»╩²: GetDepFileVerStruct
  1323. '
  1324. ' ┤╙╥╗╕÷┤╙╩⌠╬─╝■ (*.dep) ╓╨╗±╚í╬─╝■░µ▒╛╨┼╧óíú
  1325. ' ╒Γ╤∙╡─╬─╝■├╗╙╨ Windows ░µ▒╛┤┴ú¼╡½╦ⁿ╙╨┐╔╣⌐▓Θ╒╥╡──┌▓┐░µ▒╛┤┴íú
  1326. '
  1327. ' ╚δ┐┌: [strFilename] - ╥¬╗±╚í░µ▒╛╨┼╧ó╡─┤╙╩⌠╬─╝■├√
  1328. ' │÷┐┌: [sVerInfo] - ╥¬╠ε│Σ░µ▒╛╨┼╧ó╡─ VERINFO └α╨═
  1329. '
  1330. ' ╖╡╗╪: Trueú¼╚τ╣√╒╥╡╜░µ▒╛╨┼╧óú╗╖±╘≥╬¬ False
  1331. '-----------------------------------------------------------
  1332. '
  1333. Function GetDepFileVerStruct(ByVal strFilename As String, sVerInfo As VERINFO) As Boolean
  1334.     Const strVersionKey = "Version="
  1335.     Dim cchVersionKey As Integer
  1336.     Dim iFile As Integer
  1337.  
  1338.     GetDepFileVerStruct = False
  1339.     
  1340.     cchVersionKey = Len(strVersionKey)
  1341.     sVerInfo.nMSHi = gintNOVERINFO
  1342.     
  1343.     On Error GoTo Failed
  1344.     
  1345.     iFile = FreeFile
  1346.  
  1347.     Open strFilename For Input Access Read Lock Read Write As #iFile
  1348.     
  1349.     ' ╤¡╗╖╬─╝■╡─├┐╥╗╨╨ú¼▓Θ╒╥╣╪╝ⁿ╫╓
  1350.     While (Not EOF(iFile))
  1351.         Dim strLine As String
  1352.  
  1353.         Line Input #iFile, strLine
  1354.         If Left$(strLine, cchVersionKey) = strVersionKey Then
  1355.             ' ╥╤╛¡╒╥╡╜┴╦░µ▒╛╣╪╝ⁿ╫╓ú¼╘┌╡╚║┼║≤╚½▓┐╕┤╓╞
  1356.             Dim strVersion As String
  1357.             
  1358.             strVersion = Mid$(strLine, cchVersionKey + 1)
  1359.             
  1360.             '╖╓╬÷▓ó┤µ┤ó░µ▒╛╨┼╧ó
  1361.             PackVerInfo strVersion, sVerInfo
  1362.  
  1363.             GetDepFileVerStruct = True
  1364.             Close iFile
  1365.             Exit Function
  1366.         End If
  1367.     Wend
  1368.     
  1369.     Close iFile
  1370.     Exit Function
  1371.  
  1372. Failed:
  1373.     GetDepFileVerStruct = False
  1374. End Function
  1375.  
  1376. '-----------------------------------------------------------
  1377. ' ║»╩²: GetRemoteSupportFileVerStruct
  1378. '
  1379. ' ╜½╥╗╕÷╘╢│╠ ActiveX ▓┐╝■╓º│╓╬─╝■╡─░µ▒╛╨┼╧ó╖┼╡╜╥╗╕÷ VERINFO TYPE ▒Σ┴┐╓╨ú¼╜÷╞≤╥╡░µíú
  1380. ' ╒Γ╤∙╡─╬─╝■├╗╙╨ Windows ░µ▒╛┤┴ú¼╡½╦ⁿ╙╨┐╔╣⌐▓Θ╒╥╡──┌▓┐░µ▒╛┤┴íú
  1381. '
  1382. ' ╚δ┐┌: [strFilename] - ╥¬╗±╚í░µ▒╛╨┼╧ó╡─┤╙╩⌠╬─╝■├√
  1383. ' │÷┐┌: [sVerInfo] - ╥¬╠ε│Σ░µ▒╛╨┼╧ó╡─ VERINFO └α╨═
  1384. '
  1385. ' ╖╡╗╪: Trueú¼╚τ╣√╒╥╡╜░µ▒╛╨┼╧óú╗╖±╘≥╬¬ False
  1386. '-----------------------------------------------------------
  1387. '
  1388. Function GetRemoteSupportFileVerStruct(ByVal strFilename As String, sVerInfo As VERINFO) As Boolean
  1389.     Const strVersionKey = "Version="
  1390.     Dim cchVersionKey As Integer
  1391.     Dim iFile As Integer
  1392.  
  1393.     cchVersionKey = Len(strVersionKey)
  1394.     sVerInfo.nMSHi = gintNOVERINFO
  1395.     
  1396.     On Error GoTo Failed
  1397.     
  1398.     iFile = FreeFile
  1399.  
  1400.     Open strFilename For Input Access Read Lock Read Write As #iFile
  1401.     
  1402.     ' ╤¡╗╖╬─╝■╡─├┐╥╗╨╨ú¼▓Θ╒╥╣╪╝ⁿ╫╓
  1403.     While (Not EOF(iFile))
  1404.         Dim strLine As String
  1405.  
  1406.         Line Input #iFile, strLine
  1407.         If Left$(strLine, cchVersionKey) = strVersionKey Then
  1408.             ' ╥╤╛¡╒╥╡╜┴╦░µ▒╛╣╪╝ⁿ╫╓ú¼╘┌╡╚║┼║≤╚½▓┐╕┤╓╞
  1409.             Dim strVersion As String
  1410.             
  1411.             strVersion = Mid$(strLine, cchVersionKey + 1)
  1412.             
  1413.             '╖╓╬÷▓ó┤µ┤ó░µ▒╛╨┼╧ó
  1414.             PackVerInfo strVersion, sVerInfo
  1415.  
  1416.             '┤╙ .VBR ╬─╝■╫¬╗╗╕±╩╜ 1.2.3 ╡╜ 1.2.0.3ú¼║≤╒▀╩╟╬╥├╟╒µ╒²╧δ╥¬╡─
  1417.             sVerInfo.nLSLo = sVerInfo.nLSHi
  1418.             sVerInfo.nLSHi = 0
  1419.             
  1420.             GetRemoteSupportFileVerStruct = True
  1421.             Close iFile
  1422.             Exit Function
  1423.         End If
  1424.     Wend
  1425.     
  1426.     Close iFile
  1427.     Exit Function
  1428.  
  1429. Failed:
  1430.     GetRemoteSupportFileVerStruct = False
  1431. End Function
  1432. '-----------------------------------------------------------
  1433. ' ║»╩²: GetWindowsDir
  1434. '
  1435. ' ╡≈╙├ windows API ║»╩²╥╘╗±╚í windows ─┐┬╝▓ó╚╖▒ú┤µ╘┌╥╗╕÷╬▓╦µ╡──┐┬╝╖╓╕⌠╖√
  1436. '
  1437. ' ╖╡╗╪: windows ─┐┬╝
  1438. '-----------------------------------------------------------
  1439. '
  1440. Function GetWindowsDir() As String
  1441.     Dim strBuf As String
  1442.  
  1443.     strBuf = Space$(gintMAX_SIZE)
  1444.  
  1445.     '
  1446.     '╗±╚í windows ─┐┬╝▓ó╡≈╒√╗║│σ╟°╡╜╖╡╗╪╡─╚╖╩╡│ñ╢╚ú¼╚τ╣√ API ├╗╙╨╖╡╗╪─┐┬╝╖╓╕⌠╖√(\)ú¼╝╙╥╗╕÷
  1447.     '
  1448.     If GetWindowsDirectory(strBuf, gintMAX_SIZE) > 0 Then
  1449.         strBuf = StripTerminator$(strBuf)
  1450.         AddDirSep strBuf
  1451.  
  1452.         GetWindowsDir = strBuf
  1453.     Else
  1454.         GetWindowsDir = gstrNULL
  1455.     End If
  1456. End Function
  1457.  
  1458. '-----------------------------------------------------------
  1459. ' ║»╩²: UCase16
  1460. '
  1461. ' 16 ╬╗╟Θ┐÷╧┬╖╡╗╪╫¬╗╗│╔┤≤╨┤╡─╫╓╖√┤«ú¼
  1462. '   ╗≥╒▀╘┌ 32 ╬╗╟Θ┐÷╧┬╖╡╗╪╥╗╕÷╬┤╨▐╕─╡─╫╓╖√┤«┐╜▒┤íú
  1463. '
  1464. ' ╚δ┐┌: [str] - ╥¬╕┤╓╞/╫¬╗╗│╔┤≤╨┤╡─╫╓╖√┤«
  1465. '
  1466. '-----------------------------------------------------------
  1467. '
  1468. Function UCase16(ByVal str As String)
  1469.     UCase16 = str
  1470. End Function
  1471.  
  1472. '-----------------------------------------------------------
  1473. ' ║»╩²: ExtractFilenameItem
  1474. '
  1475. ' ┤╙╥╗╕÷╫╓╖√┤«╓╨│Θ╚í╥╗╕÷╥²║┼╥²╞≡└┤╡─╗≥╬▐╥²║┼╬─╝■├√íú
  1476. '
  1477. ' ╚δ┐┌: [str] - ╬¬╡├╡╜╬─╝■├√╢°╥¬╖╓╬÷╡─╫╓╖√┤«íú
  1478. '       [intAnchor] - ╬─╝■├√┐¬╩╝┤ª╡─╫╓╖√┤«╦≈╥²íú
  1479. '             ╬─╝■├√╝╠╨°╡╜╫╓╖√┤«╜ß╩°╗≥╡╜╫╓╖√┤«╓╨╡─╧┬╥╗╕÷╢║║┼ú¼
  1480. '             ╗≥╒▀ú¼╚τ╣√╬─╝■├√▒╗╖Γ╫░╡╜╥²║┼╓╨ú¼╘≥╝╠╨°╡╜╧┬╥╗╕÷╥²║┼íú
  1481. ' │÷┐┌: ╖╡╗╪▓╗┤°╥²║┼╡─╬─╝■├√íú
  1482. '       [intAnchor] ▒╗╔Φ╓├╬¬╢║║┼ú¼╗≥╥¬╖┼╡╜╫╓╖√┤«─⌐╬▓╡─╫╓╖√
  1483. '       [fErr] ╔Φ╬¬ Trueú¼╚τ╣√╖ó╧╓╥╗╕÷╖╓╬÷┤φ╬≤
  1484. '
  1485. '-----------------------------------------------------------
  1486. '
  1487. Function strExtractFilenameItem(ByVal str As String, intAnchor As Integer, fErr As Boolean) As String
  1488.     While Mid$(str, intAnchor, 1) = " "
  1489.         intAnchor = intAnchor + 1
  1490.     Wend
  1491.     
  1492.     Dim iEndFilenamePos As Integer
  1493.     Dim strFilename As String
  1494.     If Mid$(str, intAnchor, 1) = """" Then
  1495.         ' ╬─╝■├√▒╗╥²║┼╥²╞≡└┤
  1496.         iEndFilenamePos = InStr(intAnchor + 1, str, """") ' ╒╥╡╜┴╦╞Ñ┼Σ╡─╥²║┼
  1497.         If iEndFilenamePos > 0 Then
  1498.             strFilename = Mid$(str, intAnchor + 1, iEndFilenamePos - 1 - intAnchor)
  1499.             intAnchor = iEndFilenamePos + 1
  1500.             While Mid$(str, intAnchor, 1) = " "
  1501.                 intAnchor = intAnchor + 1
  1502.             Wend
  1503.             If (Mid$(str, intAnchor, 1) <> gstrCOMMA) And (Mid$(str, intAnchor, 1) <> "") Then
  1504.                 fErr = True
  1505.                 Exit Function
  1506.             End If
  1507.         Else
  1508.             fErr = True
  1509.             Exit Function
  1510.         End If
  1511.     Else
  1512.         ' ╝╠╨°╩╟╬─╝■├√ú¼╓▒╡╜╧┬╥╗╕÷╢║║┼╗≥╬─╝■╜ß╩°
  1513.         Dim iCommaPos As Integer
  1514.         
  1515.         iCommaPos = InStr(intAnchor, str, gstrCOMMA)
  1516.         If iCommaPos = 0 Then
  1517.             iCommaPos = Len(str) + 1
  1518.         End If
  1519.         iEndFilenamePos = iCommaPos
  1520.         
  1521.         strFilename = Mid$(str, intAnchor, iEndFilenamePos - intAnchor)
  1522.         intAnchor = iCommaPos
  1523.     End If
  1524.     
  1525.     strFilename = Trim$(strFilename)
  1526.     If strFilename = "" Then
  1527.         fErr = True
  1528.         Exit Function
  1529.     End If
  1530.     
  1531.     fErr = False
  1532.     strExtractFilenameItem = strFilename
  1533. End Function
  1534.  
  1535. '-----------------------------------------------------------
  1536. ' ║»╩²: Extension
  1537. '
  1538. ' │Θ╚í╬─╝■├√/┬╖╛╢├√╡─└⌐╒╣▓┐╖╓
  1539. '
  1540. ' ╚δ┐┌: [strFilename] - ╥¬╗±╚í└⌐╒╣▓┐╖╓╡─╬─╝■/┬╖╛╢
  1541. '
  1542. ' ╖╡╗╪: └⌐╒╣▓┐╖╓ú¼╚τ╣√┤µ╘┌ú╗╖±╘≥ gstrNULL
  1543. '-----------------------------------------------------------
  1544. '
  1545. Function Extension(ByVal strFilename As String) As String
  1546.     Dim intPos As Integer
  1547.  
  1548.     Extension = gstrNULL
  1549.  
  1550.     intPos = Len(strFilename)
  1551.  
  1552.     Do While intPos > 0
  1553.         Select Case Mid$(strFilename, intPos, 1)
  1554.             Case gstrSEP_EXT
  1555.                 Extension = Mid$(strFilename, intPos + 1)
  1556.                 Exit Do
  1557.             Case gstrSEP_DIR, gstrSEP_DIRALT
  1558.                 Exit Do
  1559.             '╜ß╩° Case
  1560.         End Select
  1561.  
  1562.         intPos = intPos - 1
  1563.     Loop
  1564. End Function
  1565.  
  1566. '-----------------------------------------------------------
  1567. ' ╫╙│╠╨≥: PackVerInfo
  1568. '
  1569. ' ╖╓╬÷┤░╠σ x[.x[.x[.x]]] ╡─╬─╝■░µ▒╛║┼╫╓╖√┤«ú¼
  1570. ' ▓ó╜½╒Γ╕÷│Θ╚í│÷└┤╡─║┼╕│╓╡╕° VERINFO └α╨═▒Σ┴┐╡─╡─╩╩╡▒╘¬╦╪íú
  1571. ' └²╚τú¼╙╨╨º╡─░µ▒╛╫╓╖√┤«╩╟ '3.11.0.102','3.11'íó'3'╡╚íú
  1572. '
  1573. ' ╚δ┐┌: [strVersion] - ░µ▒╛║┼╫╓╖√┤«
  1574. '
  1575. ' │÷┐┌: [sVerInfo] - VERINFO └α╨═▒Σ┴┐ú¼┤╙░µ▒╛║┼╫╓╖√┤«╕°╞Σ╘¬╦╪╕│╩╩╡▒╡─║┼
  1576. '-----------------------------------------------------------
  1577. '
  1578. Sub PackVerInfo(ByVal strVersion As String, sVerInfo As VERINFO)
  1579.     Dim intOffset As Integer
  1580.     Dim intAnchor As Integer
  1581.  
  1582.     On Error GoTo PVIError
  1583.  
  1584.     intOffset = InStr(strVersion, gstrDECIMAL)
  1585.     If intOffset = 0 Then
  1586.         sVerInfo.nMSHi = Val(strVersion)
  1587.         GoTo PVIMSLo
  1588.     Else
  1589.         sVerInfo.nMSHi = Val(Left$(strVersion, intOffset - 1))
  1590.         intAnchor = intOffset + 1
  1591.     End If
  1592.  
  1593.     intOffset = InStr(intAnchor, strVersion, gstrDECIMAL)
  1594.     If intOffset = 0 Then
  1595.         sVerInfo.nMSLo = Val(Mid$(strVersion, intAnchor))
  1596.         GoTo PVILSHi
  1597.     Else
  1598.         sVerInfo.nMSLo = Val(Mid$(strVersion, intAnchor, intOffset - intAnchor))
  1599.         intAnchor = intOffset + 1
  1600.     End If
  1601.  
  1602.     intOffset = InStr(intAnchor, strVersion, gstrDECIMAL)
  1603.     If intOffset = 0 Then
  1604.         sVerInfo.nLSHi = Val(Mid$(strVersion, intAnchor))
  1605.         GoTo PVILSLo
  1606.     Else
  1607.         sVerInfo.nLSHi = Val(Mid$(strVersion, intAnchor, intOffset - intAnchor))
  1608.         intAnchor = intOffset + 1
  1609.     End If
  1610.  
  1611.     intOffset = InStr(intAnchor, strVersion, gstrDECIMAL)
  1612.     If intOffset = 0 Then
  1613.         sVerInfo.nLSLo = Val(Mid$(strVersion, intAnchor))
  1614.     Else
  1615.         sVerInfo.nLSLo = Val(Mid$(strVersion, intAnchor, intOffset - intAnchor))
  1616.     End If
  1617.  
  1618.     Exit Sub
  1619.  
  1620. PVIError:
  1621.     sVerInfo.nMSHi = 0
  1622. PVIMSLo:
  1623.     sVerInfo.nMSLo = 0
  1624. PVILSHi:
  1625.     sVerInfo.nLSHi = 0
  1626. PVILSLo:
  1627.     sVerInfo.nLSLo = 0
  1628. End Sub
  1629.  
  1630. Public Function strQuoteString(strUnQuotedString As String, Optional vForce As Variant, Optional vTrim As Variant)
  1631. '
  1632. ' ╚▒╩í╡╪ú¼▒╛╫╙│╠╨≥╘┌╥╗╕÷╬▐╥²║┼╡─╫╓╖√┤«╔╧╠φ╝╙╥²║┼íú
  1633. ' ╚τ╣√╫╓╖√┤«╥╤╛¡▒╗╥²║┼╥²╞≡└┤ú¼╦ⁿ▓╗╫÷╚╬║╬╕─▒Σ╝┤╖╡╗╪ú¼│²╖╟ vForce ▒╗╔Φ╬¬ True (vForce ╚▒╩í╩╟ False)ú╗
  1634. ' ╜÷╙╨╡─╕─▒Σ╩╟╔╛╡⌠╥²║┼╟░║≤╡─┐╒╕±ú¼│²╖╟ vTrim ╔Φ╓├╬¬ Falseíú
  1635. ' ╚τ╣√╫╓╖√┤«░ⁿ║¼╙╨╟░╡╝║═╬▓╦µ┐╒╕±ú¼╞Σ╜½▒╗╔╛╡⌠ú¼│²╖╟ vTrim ╔Φ╓├╬¬ Falseú¿vTrim ╚▒╩í╬¬ Trueú⌐íú
  1636. '
  1637. '
  1638.     Dim strQuotedString As String
  1639.     
  1640.     If IsMissing(vForce) Then
  1641.         vForce = False
  1642.     End If
  1643.     If IsMissing(vTrim) Then
  1644.         vTrim = True
  1645.     End If
  1646.     
  1647.     strQuotedString = strUnQuotedString
  1648.     '
  1649.     ' ╚τ╣√╨Φ╥¬ú¼╡≈╒√╫╓╖√┤«
  1650.     '
  1651.     If vTrim = True Then
  1652.         strQuotedString = Trim(strQuotedString)
  1653.     End If
  1654.     '
  1655.     ' ▓Θ┐┤╫╓╖√┤«╩╟╖±▒╗╥²║┼╥²╞≡└┤
  1656.     '
  1657.     If vForce = False Then
  1658.         If (Left(strQuotedString, 1) = gstrQUOTE) And (Right(strQuotedString, 1) = gstrQUOTE) Then
  1659.             '
  1660.             ' ╫╓╖√┤«╥╤╛¡▒╗╥²║┼╥²╞≡└┤íú
  1661.             '
  1662.             GoTo DoneQuoteString
  1663.         End If
  1664.     End If
  1665.     '
  1666.     ' ╠φ╝╙╥²║┼
  1667.     '
  1668.     strQuotedString = gstrQUOTE & strQuotedString & gstrQUOTE
  1669. DoneQuoteString:
  1670.     strQuoteString = strQuotedString
  1671. End Function
  1672. Public Function strUnQuoteString(ByVal strQuotedString As String)
  1673. '
  1674. ' ▒╛╫╙│╠╨≥▓Γ╩╘ strQuotedString ╩╟╖±╘┌╥²║┼╓╨╒█╨╨ú¼╚τ╣√╩╟ú¼╔╛│²╓«íú
  1675. '
  1676.     strQuotedString = Trim(strQuotedString)
  1677.  
  1678.     If Mid$(strQuotedString, 1, 1) = gstrQUOTE And Right$(strQuotedString, 1) = gstrQUOTE Then
  1679.         '
  1680.         ' ╚τ╣√╙╨╥²║┼ú¼╚Ñ╡⌠╥²║┼íú
  1681.         '
  1682.         strQuotedString = Mid$(strQuotedString, 2, Len(strQuotedString) - 2)
  1683.     End If
  1684.     strUnQuoteString = strQuotedString
  1685. End Function
  1686. Public Function fCheckFNLength(strFilename As String) As Boolean
  1687. '
  1688. ' ▒╛╫╙│╠╨≥╚╖╚╧╬─╝■├√ strFilename ╡─│ñ╢╚╙╨╨ºíú
  1689. ' ╘┌ NT (Intel) ║═ Win95 ╗╖╛│╧┬ú¼╦ⁿ╡─│ñ╢╚┐╔╥╘╩╟ 259  (gintMAX_PATH_LEN-1) ╕÷╫╓╖√íú
  1690. ' ╒Γ╕÷│ñ╢╚▒╪╨δ░ⁿ└¿╟²╢»╞≈íó┬╖╛╢íó╬─╝■├√íó├ⁿ┴ε╨╨▓╬╩²║═╥²║┼ (╚τ╣√╫╓╖√┤«▒╗╥²║┼╥²╞≡└┤)íú
  1691. '
  1692.     fCheckFNLength = (Len(strFilename) < gintMAX_PATH_LEN)
  1693. End Function
  1694. Public Function intGetNextFldOffset(ByVal intAnchor As Integer, strList As String, strDelimit As String, Optional CompareType As Variant) As Integer
  1695. '
  1696. ' ▒╛╫╙│╠╨≥┤╙╥╗╕÷ strDelimit ╡Ñ╢└┴╨▒φíóstrListú¼▓ó╘┌ intAnchor ║≤├µ╡─┴╨▒φ╓╨╢¿╬╗╧┬╥╗╧εíú
  1697. ' ╗∙▒╛╡╪ú¼╦ⁿ╙╨╗·╗ß╒╥╡╜▓╗╘┌╥²║┼╓╨╡─╧┬╥╗╕÷ strDelimitíú
  1698. ' ╚τ╣√╬┤╒╥╡╜ strDelimitú¼│╠╨≥╖╡╗╪ 0íú
  1699. ' ╫ó╥Γú¼ intAnchor ▒╪╨δ╘┌╥²║┼╓«═Γú¼╖±╘≥▒╛╫╙│╠╨≥╜½╖╡╗╪▓╗╒²╚╖╡─╜ß╣√íú
  1700. '
  1701. ' ╡Σ╨═╡─ strDelimit ╩╟╢║║┼íú
  1702. '
  1703. ' ╚τ╣√│÷┤φú¼│╠╨≥╖╡╗╪ -1íú
  1704. '
  1705. ' ▒╛╫╙│╠╨≥┤╙╥╗╕÷ strDelimit ╡Ñ╢└┴╨▒φíóstrListú¼▓ó╘┌ intAnchor ║≤├µ╡─┴╨▒φ╓╨╢¿╬╗╧┬╥╗╧εíú
  1706. ' ╗∙▒╛╡╪ú¼╦ⁿ╙╨╗·╗ß╒╥╡╜▓╗╘┌╥²║┼╓╨╡─╧┬╥╗╕÷ strDelimitíú
  1707. ' ╚τ╣√╬┤╒╥╡╜ strDelimitú¼│╠╨≥╖╡╗╪ 0íú
  1708. ' ╫ó╥Γú¼ intAnchor ▒╪╨δ╘┌╥²║┼╓«═Γú¼╖±╘≥▒╛╫╙│╠╨≥╜½╖╡╗╪▓╗╒²╚╖╡─╜ß╣√íú
  1709.  
  1710.     Dim intQuote As Integer
  1711.     Dim intDelimit As Integer
  1712.     
  1713.     Const CompareBinary = 0
  1714.     Const CompareText = 1
  1715.  
  1716.     If IsMissing(CompareType) Then
  1717.         CompareType = CompareText
  1718.     End If
  1719.     
  1720.     If intAnchor = 0 Then intAnchor = 1
  1721.     
  1722.     intQuote = InStr(intAnchor, strList, gstrQUOTE, CompareType)
  1723.     intDelimit = InStr(intAnchor, strList, strDelimit, CompareType)
  1724.     
  1725.     If (intQuote > intDelimit) Or (intQuote = 0) Then
  1726.         '
  1727.         ' ╧┬╥╗╕÷╖╓║┼▓╗╘┌╥²║┼╓╨íú
  1728.         ' ╥≥┤╦ú¼╬╥├╟╥╤╛¡╒╥╡╜┴╦╬╥├╟╥¬╒╥╡─íú
  1729.         ' ╫ó╥Γ╒Γ╓╓╟Θ┐÷ú¼╘┌─╟└∩├╗╙╨╥²║┼╥▓▒╗┤ª└φíú
  1730.         '
  1731.         GoTo DoneGetNextFldOffset
  1732.     ElseIf intQuote < intDelimit Then
  1733.         '
  1734.         ' ╘┌╧┬╥╗╕÷╖╓║┼╓«╟░╫╖╝╙╥╗╕÷╥²║┼íú
  1735.         ' ╒Γ╥Γ╬╢╫┼╗≥╨φ╬╥├╟╥╤╛¡╘┌╥²║┼╓╨┴╦íú
  1736.         ' ╬╥├╟╚╘╨Φ╝∞▓Θ╩╟╖±╙╥╥²║┼╘┌╖╓║┼╓«║≤íú
  1737.         '
  1738.         intAnchor = intQuote + 1
  1739.         intQuote = InStr(intAnchor, strList, gstrQUOTE, CompareType)
  1740.         If (intQuote > intDelimit) Then
  1741.             '
  1742.             ' ╖╓║┼╘┌╥²║┼╓«─┌íú╥≥┤╦ú¼║÷┬╘╓«íú
  1743.             ' ╘┌╙╥╥²║┼╓«║≤╡─╧┬╥╗╕÷╖╓║┼▒╪╨δ╘┌╥²║┼╓«═Γ╗≥╬╥├╟╙╨╥╗╕÷╗┘╦≡╬─╝■íú
  1744.             '
  1745.             intAnchor = intQuote + 1
  1746.             intDelimit = InStr(intAnchor, strList, strDelimit, CompareType)
  1747.             '
  1748.             ' ║╧└φ╨╘╝∞▓Θíú▒ú╓ñ╘┌╬╥├╟╕╒╕╒╖ó╧╓╡─╥²║┼╓«╟░├╗╙╨┴φ╥╗╕÷╥²║┼íú
  1749.             '
  1750.             If intDelimit > 0 Then
  1751.                 intQuote = InStr(intAnchor, strList, gstrQUOTE, CompareType)
  1752.                 If (intQuote > 0) And (intQuote < intDelimit) Then
  1753.                     '
  1754.                     ' │÷┤φíú
  1755.                     ' ╬╥├╟╙÷╡╜╥╗╕÷╡Ñ╢└╡─╥²║┼ (▓╗│╔╢╘)ú¼╒Γ╥Γ╬╢╫┼╫╓╖√┤«▓╗╒²╚╖íú
  1756.                     '
  1757.                     intDelimit = -1 ' Error
  1758.                 End If
  1759.             End If
  1760.         End If
  1761.     End If
  1762. DoneGetNextFldOffset:
  1763.     intGetNextFldOffset = intDelimit
  1764. End Function
  1765.  
  1766.