home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / patchfix / dbpatch / globals.bas < prev    next >
Encoding:
BASIC Source File  |  1995-05-05  |  21.2 KB  |  589 lines

  1. '-----------------------------------------------------------------------
  2. ' IPS Time and MDB Patch Tool (TALAS), Version 1.0
  3. ' ⌐Copyright 1995 (Unpublished) Integrated Planning Systems, inc.
  4. ' All Rights Reserved.
  5. '
  6. ' Integrated Planning Systems Proprietary Rights are included in this
  7. ' Software, in the data or documentation relating thereto, and in the
  8. ' information disclosed therein.  Neither this software, regardless of
  9. ' the form in which it exists, nor such data or information may be
  10. ' used by or disclosed to others for any purpose except as specifically
  11. ' authorized in writing by Integrated Planning Systems, inc.
  12. '
  13. ' This software was developed exclusively at private expense
  14. ' as defined in DFARS 252.227-7013(a)(12).
  15. '
  16. ' This software was developed under IPS General and Administrative
  17. ' Account A1035LAS.
  18. '-----------------------------------------------------------------------
  19.  
  20. Option Explicit
  21.  
  22. Global Filename As String, FDir As String, FNum As Integer, HomeDir As String
  23. Global WinDir As String, WinAPIReturn As Integer, WinAPIBuffer As String * 16384
  24. Global WinINISect As String * 30, WinINIVar As String * 30, WindwState As Integer
  25. Global WindowWidth As Integer, WindowHeight As Integer, WindowLeft As Integer, WindowTop As Integer
  26. Global HelpFilePath As String, PicFileName As String
  27.  
  28. Global DBFilename As String, DBFNum As Integer, DBDir As String
  29. Global PEL2TWIPSX As Integer, PEL2TWIPSY As Integer, SuspendRepaint As Integer
  30.  
  31. Global Const INISectionName = "IPS DB Patch"
  32.  
  33. Type RECT
  34.    Left As Integer
  35.    Top As Integer
  36.    right As Integer
  37.    bottom As Integer
  38. End Type
  39.  
  40. Global Const TableObject = 1
  41. Global Const QueryObject = 2
  42. Global Const FormObject = 3
  43. Global Const ReportObject = 4
  44. Global Const MacroObject = 5
  45. Global Const ModuleObject = 6
  46.  
  47. Global Const KeyStat_Toggled = 1
  48.  
  49. '----------------------------------------------------------------------------
  50. ' Windows API Routines
  51. '----------------------------------------------------------------------------
  52. Declare Function GetProfileString Lib "Kernel" (ByVal lpSection As String, ByVal lpEntry As String, ByVal lpDefault As String, ByVal Buffer As String, ByVal cbBuffer As Integer) As Integer
  53. Declare Function WriteProfileString Lib "Kernel" (ByVal lpSection As String, ByVal lpEntry As Any, ByVal lpString As Any) As Integer
  54. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  55. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFileName As String) As Integer
  56. Declare Function GetWindowsDirectory Lib "Kernel" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  57. Declare Sub GetClientRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT)
  58. Declare Function GetKeyState Lib "User" (ByVal nVirtKey As Integer) As Integer
  59. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  60. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
  61. Declare Sub SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
  62.  
  63. 'Windows constants
  64. Global Const HWND_TOPMOST = -1
  65. Global Const SWP_NOMOVE = &H2
  66. Global Const SWP_NOSIZE = &H1
  67.  
  68. 'Constants for referencing picClip Graphic Cells for CCNSelect Pictures:
  69. 'Global Const Normal = 0      'Commented out because Normal is already defined as zero
  70. Global Const NormalActive = 1
  71. Global Const NormalDisabled = 2
  72. Global Const NormalSelected = 3
  73. Global Const Modified = 4
  74. Global Const ModifiedActive = 5
  75. Global Const ModifiedDisabled = 6
  76. Global Const ModifiedSelected = 7
  77. Global Const NewLine = 8
  78. Global Const NewLineActive = 9
  79. Global Const NewLineDisabled = 10
  80. Global Const NewLineSelected = 11
  81.  
  82. 'Help Constants
  83. Global Const HELP_CONTEXT = &H1           'Display topic in ulTopic
  84. Global Const HELP_QUIT = &H2              'Terminate help
  85. Global Const HELP_INDEX = &H3             'Display index
  86. Global Const HELP_CONTENTS = &H3
  87. Global Const HELP_HELPONHELP = &H4        'Display help on using help
  88. Global Const HELP_SETINDEX = &H5          'Set the current Index for multi index help
  89. Global Const HELP_SETCONTENTS = &H5
  90. Global Const HELP_CONTEXTPOPUP = &H8
  91. Global Const HELP_FORCEFILE = &H9
  92. Global Const HELP_KEY = &H101             'Display topic for keyword in offabData
  93. Global Const HELP_COMMAND = &H102
  94. Global Const HELP_PARTIALKEY = &H105      'call the search engine in winhelp
  95.  
  96. 'Error Constants
  97. Global Const File_Not_Found = 53
  98. Global Const Disk_Full = 61
  99.  
  100. ' Show parameters
  101. Global Const MODAL = 1
  102. Global Const MODELESS = 0
  103.  
  104. ' Arrange Method
  105. ' for MDI Forms
  106. Global Const CASCADE = 0
  107. Global Const TILE_HORIZONTAL = 1
  108. Global Const TILE_VERTICAL = 2
  109. Global Const ARRANGE_ICONS = 3
  110.  
  111. 'ZOrder Method
  112. Global Const BRINGTOFRONT = 0
  113. Global Const SENDTOBACK = 1
  114.  
  115. ' Key Codes
  116. Global Const KEY_LBUTTON = &H1
  117. Global Const KEY_RBUTTON = &H2
  118. Global Const KEY_CANCEL = &H3
  119. Global Const KEY_MBUTTON = &H4    ' NOT contiguous with L & RBUTTON
  120. Global Const KEY_BACK = &H8
  121. Global Const KEY_TAB = &H9
  122. Global Const KEY_CLEAR = &HC
  123. Global Const KEY_RETURN = &HD
  124. Global Const KEY_SHIFT = &H10
  125. Global Const KEY_CONTROL = &H11
  126. Global Const KEY_MENU = &H12
  127. Global Const KEY_PAUSE = &H13
  128. Global Const KEY_CAPITAL = &H14
  129. Global Const KEY_ESCAPE = &H1B
  130. Global Const KEY_SPACE = &H20
  131. Global Const KEY_PRIOR = &H21
  132. Global Const KEY_NEXT = &H22
  133. Global Const KEY_END = &H23
  134. Global Const KEY_HOME = &H24
  135. Global Const KEY_LEFT = &H25
  136. Global Const KEY_UP = &H26
  137. Global Const KEY_RIGHT = &H27
  138. Global Const KEY_DOWN = &H28
  139. Global Const KEY_SELECT = &H29
  140. Global Const KEY_PRINT = &H2A
  141. Global Const KEY_EXECUTE = &H2B
  142. Global Const KEY_SNAPSHOT = &H2C
  143. Global Const KEY_INSERT = &H2D
  144. Global Const KEY_DELETE = &H2E
  145. Global Const KEY_HELP = &H2F
  146.  
  147. ' KEY_A thru KEY_Z are the same as their ASCII equivalents: 'A' thru 'Z'
  148. ' KEY_0 thru KEY_9 are the same as their ASCII equivalents: '0' thru '9'
  149.  
  150. Global Const KEY_NUMPAD0 = &H60
  151. Global Const KEY_NUMPAD1 = &H61
  152. Global Const KEY_NUMPAD2 = &H62
  153. Global Const KEY_NUMPAD3 = &H63
  154. Global Const KEY_NUMPAD4 = &H64
  155. Global Const KEY_NUMPAD5 = &H65
  156. Global Const KEY_NUMPAD6 = &H66
  157. Global Const KEY_NUMPAD7 = &H67
  158. Global Const KEY_NUMPAD8 = &H68
  159. Global Const KEY_NUMPAD9 = &H69
  160. Global Const KEY_MULTIPLY = &H6A
  161. Global Const KEY_ADD = &H6B
  162. Global Const KEY_SEPARATOR = &H6C
  163. Global Const KEY_SUBTRACT = &H6D
  164. Global Const KEY_DECIMAL = &H6E
  165. Global Const KEY_DIVIDE = &H6F
  166. Global Const KEY_F1 = &H70
  167. Global Const KEY_F2 = &H71
  168. Global Const KEY_F3 = &H72
  169. Global Const KEY_F4 = &H73
  170. Global Const KEY_F5 = &H74
  171. Global Const KEY_F6 = &H75
  172. Global Const KEY_F7 = &H76
  173. Global Const KEY_F8 = &H77
  174. Global Const KEY_F9 = &H78
  175. Global Const KEY_F10 = &H79
  176. Global Const KEY_F11 = &H7A
  177. Global Const KEY_F12 = &H7B
  178. Global Const KEY_F13 = &H7C
  179. Global Const KEY_F14 = &H7D
  180. Global Const KEY_F15 = &H7E
  181. Global Const KEY_F16 = &H7F
  182.  
  183. Global Const KEY_NUMLOCK = &H90
  184. Global Const KEY_SCROLLOCK = &H91
  185.  
  186. ' Colors
  187. Global Const BLACK = &H0&
  188. Global Const RED = &HFF&
  189. Global Const GREEN = &HFF00&
  190. Global Const YELLOW = &HFFFF&
  191. Global Const BLUE = &HFF0000
  192. Global Const MAGENTA = &HFF00FF
  193. Global Const CYAN = &HFFFF00
  194. Global Const WHITE = &HFFFFFF
  195. Global Const GRAY = &HC0C0C0
  196.  
  197. ' System Colors
  198. Global Const SCROLL_BARS = &H80000000           ' Scroll-bars gray area.
  199. Global Const DESKTOP = &H80000001               ' Desktop.
  200. Global Const ACTIVE_TITLE_BAR = &H80000002      ' Active window caption.
  201. Global Const INACTIVE_TITLE_BAR = &H80000003    ' Inactive window caption.
  202. Global Const MENU_BAR = &H80000004              ' Menu background.
  203. Global Const WINDOW_BACKGROUND = &H80000005     ' Window background.
  204. Global Const WINDOW_FRAME = &H80000006          ' Window frame.
  205. Global Const MENU_TEXT = &H80000007             ' Text in menus.
  206. Global Const WINDOW_TEXT = &H80000008           ' Text in windows.
  207. Global Const TITLE_BAR_TEXT = &H80000009        ' Text in caption, size box, scroll-bar arrow box..
  208. Global Const ACTIVE_BORDER = &H8000000A         ' Active window border.
  209. Global Const INACTIVE_BORDER = &H8000000B       ' Inactive window border.
  210. Global Const APPLICATION_WORKSPACE = &H8000000C ' Background color of multiple document interface (MDI) applications.
  211. Global Const Highlight = &H8000000D             ' Items selected item in a control.
  212. Global Const HIGHLIGHT_TEXT = &H8000000E        ' Text of item selected in a control.
  213. Global Const BUTTON_FACE = &H8000000F           ' Face shading on command buttons.
  214. Global Const BUTTON_SHADOW = &H80000010         ' Edge shading on command buttons.
  215. Global Const GRAY_TEXT = &H80000011             ' Grayed (disabled) text.  This color is set to 0 if the current display driver does not support a solid gray color.
  216. Global Const BUTTON_TEXT = &H80000012           ' Text on push buttons.
  217. Global Const BUTTON_HIGHLIGHT = &HFFFFFF
  218.  
  219. ' MousePointer
  220. Global Const DEFAULT = 0        ' 0 - Default
  221. Global Const ARROW = 1          ' 1 - Arrow
  222. Global Const CROSSHAIR = 2      ' 2 - Cross
  223. Global Const IBEAM = 3          ' 3 - I-Beam
  224. Global Const ICON_POINTER = 4   ' 4 - Icon
  225. Global Const SIZE_POINTER = 5   ' 5 - Size
  226. Global Const SIZE_NE_SW = 6     ' 6 - Size NE SW
  227. Global Const SIZE_N_S = 7       ' 7 - Size N S
  228. Global Const SIZE_NW_SE = 8     ' 8 - Size NW SE
  229. Global Const SIZE_W_E = 9       ' 9 - Size W E
  230. Global Const UP_ARROW = 10      ' 10 - Up Arrow
  231. Global Const HOURGLASS = 11     ' 11 - Hourglass
  232. Global Const NO_DROP = 12       ' 12 - No drop
  233.  
  234. 'Shell command constants
  235. Global Const NORMALWITHFOCUS = 1
  236. Global Const MINIMIZEDWITHFOCUS = 2
  237. Global Const MAXIMIZEDWITHFOCUS = 3
  238. Global Const NORMALWITHOUTFOCUS = 4
  239. Global Const MINIMIZEDWITHOUTFOCUS = 6
  240.  
  241. 'DDE Link Mode Constants
  242. Global Const LM_NONE = 0
  243. Global Const LM_AUTOMATIC = 1
  244. Global Const LM_MANUAL = 2
  245. Global Const LM_NOTIFY = 3
  246.  
  247. ' WindowState
  248. Global Const Normal = 0    ' 0 - Normal
  249. Global Const MINIMIZED = 1 ' 1 - Minimized
  250. Global Const MAXIMIZED = 2 ' 2 - Maximized
  251.  
  252. ' Check Value
  253. Global Const UNCHECKED = 0 ' 0 - Unchecked
  254. Global Const CHECKED = 1   ' 1 - Checked
  255. Global Const GRAYED = 2    ' 2 - Grayed
  256.  
  257. ' Shift parameter masks
  258. Global Const SHIFT_MASK = 1
  259. Global Const CTRL_MASK = 2
  260. Global Const ALT_MASK = 4
  261.  
  262. ' Button parameter masks
  263. Global Const LEFT_BUTTON = 1
  264. Global Const RIGHT_BUTTON = 2
  265. Global Const MIDDLE_BUTTON = 4
  266.  
  267. ' Function Parameters
  268. ' MsgBox parameters
  269. Global Const MB_OK = 0                 ' OK button only
  270. Global Const MB_OKCANCEL = 1           ' OK and Cancel buttons
  271. Global Const MB_ABORTRETRYIGNORE = 2   ' Abort, Retry, and Ignore buttons
  272. Global Const MB_YESNOCANCEL = 3        ' Yes, No, and Cancel buttons
  273. Global Const MB_YESNO = 4              ' Yes and No buttons
  274. Global Const MB_RETRYCANCEL = 5        ' Retry and Cancel buttons
  275.  
  276. Global Const MB_ICONSTOP = 16          ' Critical message
  277. Global Const MB_ICONQUESTION = 32      ' Warning query
  278. Global Const MB_ICONEXCLAMATION = 48   ' Warning message
  279. Global Const MB_ICONINFORMATION = 64   ' Information message
  280.  
  281. Global Const MB_APPLMODAL = 0          ' Application Modal Message Box
  282. Global Const MB_DEFBUTTON1 = 0         ' First button is default
  283. Global Const MB_DEFBUTTON2 = 256       ' Second button is default
  284. Global Const MB_DEFBUTTON3 = 512       ' Third button is default
  285. Global Const MB_SYSTEMMODAL = 4096      'System Modal
  286.  
  287. ' MsgBox return values
  288. Global Const IDOK = 1                  ' OK button pressed
  289. Global Const IDCANCEL = 2              ' Cancel button pressed
  290. Global Const IDABORT = 3               ' Abort button pressed
  291. Global Const IDRETRY = 4               ' Retry button pressed
  292. Global Const IDIGNORE = 5              ' Ignore button pressed
  293. Global Const IDYES = 6                 ' Yes button pressed
  294. Global Const IDNO = 7                  ' No button pressed
  295.  
  296.  
  297. 'File Open/Save Dialog Flags
  298. Global Const OFN_READONLY = &H1&
  299. Global Const OFN_OVERWRITEPROMPT = &H2&
  300. Global Const OFN_HIDEREADONLY = &H4&
  301. Global Const OFN_NOCHANGEDIR = &H8&
  302. Global Const OFN_SHOWHELP = &H10&
  303. Global Const OFN_NOVALIDATE = &H100&
  304. Global Const OFN_ALLOWMULTISELECT = &H200&
  305. Global Const OFN_EXTENSIONDIFFERENT = &H400&
  306. Global Const OFN_PATHMUSTEXIST = &H800&
  307. Global Const OFN_FILEMUSTEXIST = &H1000&
  308. Global Const OFN_CREATEPROMPT = &H2000&
  309. Global Const OFN_SHAREAWARE = &H4000&
  310. Global Const OFN_NOREADONLYRETURN = &H8000&
  311.  
  312.  
  313. 'Printer Dialog Flags
  314. Global Const PD_ALLPAGES = &H0&
  315. Global Const PD_SELECTION = &H1&
  316. Global Const PD_PAGENUMS = &H2&
  317. Global Const PD_NOSELECTION = &H4&
  318. Global Const PD_NOPAGENUMS = &H8&
  319. Global Const PD_COLLATE = &H10&
  320. Global Const PD_PRINTTOFILE = &H20&
  321. Global Const PD_PRINTSETUP = &H40&
  322. Global Const PD_NOWARNING = &H80&
  323. Global Const PD_RETURNDC = &H100&
  324. Global Const PD_RETURNIC = &H200&
  325. Global Const PD_RETURNDEFAULT = &H400&
  326. Global Const PD_SHOWHELP = &H800&
  327. Global Const PD_USEDEVMODECOPIES = &H40000
  328. Global Const PD_DISABLEPRINTTOFILE = &H80000
  329. Global Const PD_HIDEPRINTTOFILE = &H100000
  330.  
  331.  
  332. 'Error Constants
  333. Global Const CDERR_DIALOGFAILURE = -32768
  334. Global Const CDERR_GENERALCODES = &H7FFF
  335. Global Const CDERR_STRUCTSIZE = &H7FFE
  336. Global Const CDERR_INITIALIZATION = &H7FFD
  337. Global Const CDERR_NOTEMPLATE = &H7FFC
  338. Global Const CDERR_NOHINSTANCE = &H7FFB
  339. Global Const CDERR_LOADSTRFAILURE = &H7FFA
  340. Global Const CDERR_FINDRESFAILURE = &H7FF9
  341. Global Const CDERR_LOADRESFAILURE = &H7FF8
  342. Global Const CDERR_LOCKRESFAILURE = &H7FF7
  343. Global Const CDERR_MEMALLOCFAILURE = &H7FF6
  344. Global Const CDERR_MEMLOCKFAILURE = &H7FF5
  345. Global Const CDERR_NOHOOK = &H7FF4
  346. Global Const CDERR_DISKNOTREADY = &H47
  347.  
  348. 'Added for CMDIALOG.VBX
  349. Global Const CDERR_CANCEL = &H7FF3
  350. Global Const CDERR_NODLL = &H7FF2
  351. Global Const CDERR_ERRPROC = &H7FF1
  352. Global Const CDERR_ALLOC = &H7FF0
  353. Global Const CDERR_HELP = &H7FEF
  354.  
  355. Global Const PDERR_PRINTERCODES = &H6FFF
  356. Global Const PDERR_SETUPFAILURE = &H6FFE
  357. Global Const PDERR_PARSEFAILURE = &H6FFD
  358. Global Const PDERR_RETDEFFAILURE = &H6FFC
  359. Global Const PDERR_LOADDRVFAILURE = &H6FFB
  360. Global Const PDERR_GETDEVMODEFAIL = &H6FFA
  361. Global Const PDERR_INITFAILURE = &H6FF9
  362. Global Const PDERR_NODEVICES = &H6FF8
  363. Global Const PDERR_NODEFAULTPRN = &H6FF7
  364. Global Const PDERR_DNDMMISMATCH = &H6FF6
  365. Global Const PDERR_CREATEICFAILURE = &H6FF5
  366. Global Const PDERR_PRINTERNOTFOUND = &H6FF4
  367.  
  368. Global Const CFERR_CHOOSEFONTCODES = &H5FFF
  369. Global Const CFERR_NOFONTS = &H5FFE
  370.  
  371. Global Const FNERR_FILENAMECODES = &H4FFF
  372. Global Const FNERR_SUBCLASSFAILURE = &H4FFE
  373. Global Const FNERR_INVALIDFILENAME = &H4FFD
  374. Global Const FNERR_BUFFERTOOSMALL = &H4FFC
  375.  
  376. Global Const FRERR_FINDREPLACECODES = &H3FFF
  377. Global Const CCERR_CHOOSECOLORCODES = &H2FFF
  378.  
  379.  
  380.  
  381. '---------------------------------------
  382. 'Key Status Control
  383. '---------------------------------------
  384. 'Style
  385. Global Const KEYSTAT_CAPSLOCK = 0
  386. Global Const KEYSTAT_NUMLOCK = 1
  387. Global Const KEYSTAT_INSERT = 2
  388. Global Const KEYSTAT_SCROLLLOCK = 3
  389.  
  390.  
  391. '---------------------------------------
  392. 'API SendMessage Constants
  393. '---------------------------------------
  394.  
  395. Global Const WM_USER = &H400
  396. Global Const EM_CANUNDO = WM_USER + 22
  397. Global Const EM_UNDO = WM_USER + 23
  398. Global Const EM_SETREADONLY = WM_USER + 31
  399.  
  400. Sub CenterForm (frm As Form)
  401.    Dim iLeft As Integer, iTop As Integer
  402.    iLeft = (Screen.Width - frm.Width) / 2
  403.    iTop = (Screen.Height - frm.Height) / 2
  404.    frm.Move iLeft, iTop
  405. End Sub
  406.  
  407. Function FileExist (ByVal FName As String) As Integer
  408.    On Error GoTo FileExistError
  409.    FileExist = Dir(FName) <> ""
  410.    On Error GoTo 0
  411.    Exit Function
  412.  
  413. FileExistError:
  414.    FileExist = False
  415.    Resume Next
  416. End Function
  417.  
  418. Function FileNamePart (FName As String) As String
  419.    Dim FnameStart As Integer
  420.    FnameStart = 1
  421.    If (Len(FName) > 0) Then
  422.       While InStr(FnameStart, FName, "\") <> 0
  423.      FnameStart = InStr(FnameStart, FName, "\") + 1
  424.       Wend
  425.       FileNamePart = Mid$(FName, FnameStart)
  426.    Else
  427.       FileNamePart = ""
  428.    End If
  429. End Function
  430.  
  431. Function Help_File_In_Path ()
  432. Dim Path As String, CurrentDir As String, Found As Integer, SemiColon As Integer
  433.  
  434.     On Error Resume Next
  435.     CurrentDir = App.Path
  436.     If Right$(CurrentDir, 1) <> "\" Then CurrentDir = CurrentDir + "\"
  437.     Found = Dir$(CurrentDir + "TIMESUM.HLP") <> ""
  438.     If Not Found Then
  439.     Path = Environ$("PATH")
  440.     If Path <> "" Then
  441.         If Right$(Path, 1) <> ";" Then Path = Path + ";"
  442.         SemiColon = InStr(Path, ";")
  443.         Do
  444.         CurrentDir = Left$(Path, SemiColon - 1)
  445.         If Right$(CurrentDir, 1) <> "\" Then CurrentDir = CurrentDir + "\"
  446.         Found = Dir$(CurrentDir + "TIMESUM.HLP") <> ""
  447.         Path = Right$(Path, Len(Path) - SemiColon)
  448.         SemiColon = InStr(Path, ";")
  449.         Loop While ((SemiColon <> 0) And Not Found)
  450.     End If
  451.     End If
  452.     If Found Then
  453.     HelpFilePath = CurrentDir + "TIMESUM.HLP"
  454.     App.HelpFile = CurrentDir + "TIMESUM.HLP"
  455.     End If
  456.     Help_File_In_Path = Found
  457.     
  458.     On Error GoTo 0
  459.  
  460. End Function
  461.  
  462. Sub InitGlobalArrays ()
  463. '******************************************************
  464. '**  Get Screen Properties so we can convert Pixel Sizes
  465. '**  to the TWIPS required by VB
  466. '******************************************************
  467.    PEL2TWIPSX = Screen.TwipsPerPixelX
  468.    PEL2TWIPSY = Screen.TwipsPerPixelY
  469. End Sub
  470.  
  471. Sub Make3D (ParentCtrl As Control, Ctrl As Control)
  472.    Dim Shadow As Long, Highlight As Long
  473.    If Ctrl.Visible Then
  474.       Shadow = BUTTON_SHADOW
  475.       Highlight = BUTTON_HIGHLIGHT
  476.    Else
  477.       Shadow = BUTTON_FACE
  478.       Highlight = BUTTON_FACE
  479.    End If
  480.    If TypeOf Ctrl Is PictureBox Then
  481.       Ctrl.DrawWidth = 1
  482.       Ctrl.ScaleMode = 3 'Pixel
  483.       Ctrl.CurrentX = 0
  484.       Ctrl.CurrentY = Ctrl.ScaleHeight - 1
  485.       Ctrl.Line -Step(0, -(Ctrl.ScaleHeight - 1)), Highlight
  486.       Ctrl.Line -Step((Ctrl.ScaleWidth - 1), 0), Highlight
  487.       Ctrl.Line -Step(0, (Ctrl.ScaleHeight - 1)), Shadow
  488.       Ctrl.Line -Step(-(Ctrl.ScaleWidth), 0), Shadow
  489.       Ctrl.CurrentX = 1
  490.       Ctrl.CurrentY = Ctrl.ScaleHeight - 2
  491.       Ctrl.Line -Step(0, -(Ctrl.ScaleHeight - 3)), Highlight
  492.       Ctrl.Line -Step((Ctrl.ScaleWidth - 3), 0), Highlight
  493.       Ctrl.Line -Step(0, (Ctrl.ScaleHeight - 3)), Shadow
  494.       Ctrl.Line -Step(-(Ctrl.ScaleWidth - 2), 0), Shadow
  495.    ElseIf TypeOf Ctrl Is Label Then
  496.       ParentCtrl.DrawWidth = 1
  497.       ParentCtrl.ScaleMode = 3 'Pixel
  498.       ParentCtrl.CurrentX = Ctrl.Left - 1
  499.       ParentCtrl.CurrentY = Ctrl.Top + Ctrl.Height
  500.       ParentCtrl.Line -Step(0, -(Ctrl.Height + 1)), Highlight
  501.       ParentCtrl.Line -Step((Ctrl.Width + 1), 0), Highlight
  502.       ParentCtrl.Line -Step(0, (Ctrl.Height + 1)), Shadow
  503.       ParentCtrl.Line -Step(-(Ctrl.Width + 1), 0), Shadow
  504.       ParentCtrl.CurrentX = Ctrl.Left - 2
  505.       ParentCtrl.CurrentY = Ctrl.Top + Ctrl.Height + 1
  506.       ParentCtrl.Line -Step(0, -(Ctrl.Height + 3)), Highlight
  507.       ParentCtrl.Line -Step((Ctrl.Width + 3), 0), Highlight
  508.       ParentCtrl.Line -Step(0, (Ctrl.Height + 3)), Shadow
  509.       ParentCtrl.Line -Step(-(Ctrl.Width + 3), 0), Shadow
  510.    Else
  511.       ParentCtrl.DrawWidth = 1
  512.       ParentCtrl.ScaleMode = 3 'Pixel
  513.       ParentCtrl.CurrentX = Ctrl.Left - 1
  514.       ParentCtrl.CurrentY = Ctrl.Top + Ctrl.Height
  515.       ParentCtrl.Line -Step(0, -(Ctrl.Height + 1)), Shadow
  516.       ParentCtrl.Line -Step((Ctrl.Width + 1), 0), Shadow
  517.       ParentCtrl.Line -Step(0, (Ctrl.Height + 1)), Highlight
  518.       ParentCtrl.Line -Step(-(Ctrl.Width + 1), 0), Highlight
  519.       ParentCtrl.CurrentX = Ctrl.Left - 2
  520.       ParentCtrl.CurrentY = Ctrl.Top + Ctrl.Height + 1
  521.       ParentCtrl.Line -Step(0, -(Ctrl.Height + 3)), Shadow
  522.       ParentCtrl.Line -Step((Ctrl.Width + 3), 0), Shadow
  523.       ParentCtrl.Line -Step(0, (Ctrl.Height + 3)), Highlight
  524.       ParentCtrl.Line -Step(-(Ctrl.Width + 3), 0), Highlight
  525.    End If
  526. End Sub
  527.  
  528. Function NumTokens (tmp As String, search As String)
  529.    Dim X As Integer, s As Integer, n As Integer
  530.    s = 1
  531.    X = InStr(s, tmp, search)
  532.    While X > 0
  533.       n = n + 1
  534.       s = X + 1
  535.       X = InStr(s, tmp, search)
  536.    Wend
  537.    If X = Len(tmp) Then
  538.       NumTokens = n
  539.    Else
  540.       NumTokens = n + 1
  541.    End If
  542. End Function
  543.  
  544. Function PathNamePart (FName As String) As String
  545.    Dim FnameStart As Integer
  546.    FnameStart = 1
  547.    If (Len(FName) > 0) Then
  548.       While InStr(FnameStart, FName, "\") <> 0
  549.      FnameStart = InStr(FnameStart, FName, "\") + 1
  550.       Wend
  551.       PathNamePart = Left$(FName, FnameStart - 2)
  552.    Else
  553.       PathNamePart = ""
  554.    End If
  555. End Function
  556.  
  557. Sub PrintSetup ()
  558.    Dim ErrSave As Integer
  559.    On Error GoTo FilePrtSetupErrorHandler
  560.    CommonForm.CMDialog1.Flags = PD_PRINTSETUP
  561.    CommonForm.CMDialog1.Action = 5
  562.    On Error GoTo 0
  563.  
  564. FilePrtSetupExit:
  565.    Exit Sub
  566.  
  567. FilePrtSetupErrorHandler:
  568.    ErrSave = Err
  569.    FNum = 0
  570.    If ErrSave = CDERR_CANCEL Then
  571.       Resume FilePrtSetupExit
  572.    Else
  573.       Exit Sub
  574.    End If
  575. End Sub
  576.  
  577. Function Token (tmp As String, search As String) As String
  578.     Dim X As Integer
  579.     X = InStr(1, tmp, search)
  580.     If X Then
  581.        Token = Mid$(tmp, 1, X - 1)
  582.        tmp = Mid$(tmp, X + 1)
  583.     Else
  584.        Token = tmp
  585.        tmp = ""
  586.     End If
  587. End Function
  588.  
  589.