home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / appshell / appglobl.bas < prev    next >
BASIC Source File  |  1980-01-04  |  16KB  |  414 lines

  1. ' ================
  2. ' Copyrights & CYA
  3. ' ================
  4. '
  5. ' App Shell is freeware with the following intent:
  6. '
  7. ' -  You are free to incorporate App Shell into your code that will be
  8. '    distributed in executable form.
  9. ' -  You are free to distribute App Shell source or incorporate App Shell
  10. '    source into your source code assuming no charge is required and this
  11. '    copyright is maintained and acknowledged.
  12. ' -  You are free to distribute App Shell source as shareware assuming
  13. '    you are an approved vendor and associate member of the Association
  14. '    of Shareware Professionals (ASP).  No registration fee is required
  15. '    but this copyright must be maintained and acknowledged.
  16. ' -  All other distribution rights are maintained by the author.
  17. ' -  The author makes NO warranties, express or implied, oral or written,
  18. '    including any implied warranties of merchantability or fitness for
  19. '    a particular purpose.  In no event shall the author be liable for
  20. '    any damages whatsoever arising out of the use of the software.
  21. '
  22. ' If you find any bugs, anomalies, or have any questions or suggestions,
  23. ' please send them to Jim Presley (CIS ID - 73417,2674).  Enjoy!
  24. '
  25. '
  26. '============================================================================'
  27. '                                                                            '
  28. ' Visual Basic global constant file.  This file can be loaded into the       '
  29. ' global module.                                                             '
  30. '                                                                            '
  31. ' Some constants are commented out because they have duplicates (for         '
  32. ' example, NONE appears in several places).                                  '
  33. '                                                                            '
  34. '============================================================================'
  35. DefInt A-Z
  36. '========='
  37. '         '
  38. ' General '
  39. '         '
  40. '========='
  41.  
  42. ' Booleans
  43. Global Const FILE_NOT_FOUND = 53
  44. Global Const PATH_NOT_FOUND = 76
  45.  
  46.  
  47. '=================='
  48. '                  '
  49. ' Event parameters '
  50. '                  '
  51. '=================='
  52.  
  53. ' Button and Shift (KeyDown, KeyUp, MouseDown, MouseMove, MouseUp)
  54. Global Const SHIFT_MASK = 1
  55. Global Const CTRL_MASK = 2
  56. Global Const ALT_MASK = 4
  57. Global Const LEFT_BUTTON = 1
  58. Global Const RIGHT_BUTTON = 2
  59. Global Const MIDDLE_BUTTON = 4
  60.  
  61. ' ErrNum (LinkError)
  62. Global Const WRONG_FORMAT = 1
  63. Global Const REQUEST_WITHOUT_INIT = 2
  64. Global Const DDE_WITHOUT_INIT = 3
  65. Global Const ADVISE_WITHOUT_INIT = 4
  66. Global Const POKE_WITHOUT_INIT = 5
  67. Global Const DDE_SERVER_CLOSED = 6
  68. Global Const TOO_MANY_LINKS = 7
  69. Global Const STRING_TOO_LONG = 8
  70. Global Const INVALID_CONTROL_ARRAY_REFERENCE = 9
  71. Global Const UNEXPECTED_DDE = 10
  72. Global Const OUT_OF_MEMORY = 11
  73. Global Const SERVER_ATTEMPTED_CLIENT_OPERATION = 12
  74.  
  75. ' KeyCode (KeyDown, KeyUp)
  76. Global Const KEY_LBUTTON = &H1
  77. Global Const KEY_RBUTTON = &H2
  78. Global Const KEY_CANCEL = &H3
  79. Global Const KEY_MBUTTON = &H4         ' NOT contiguous with L & RBUTTON
  80. Global Const KEY_BACK = &H8
  81. Global Const KEY_TAB = &H9
  82. Global Const KEY_CLEAR = &HC
  83. Global Const KEY_RETURN = &HD
  84. Global Const KEY_SHIFT = &H10
  85. Global Const KEY_CONTROL = &H11
  86. Global Const KEY_MENU = &H12
  87. Global Const KEY_PAUSE = &H13
  88. Global Const KEY_CAPITAL = &H14
  89. Global Const KEY_ESCAPE = &H1B
  90. Global Const KEY_SPACE = &H20
  91. Global Const KEY_PRIOR = &H21
  92. Global Const KEY_NEXT = &H22
  93. Global Const KEY_END = &H23
  94. Global Const KEY_HOME = &H24
  95. Global Const KEY_LEFT = &H25
  96. Global Const KEY_UP = &H26
  97. Global Const KEY_RIGHT = &H27
  98. Global Const KEY_DOWN = &H28
  99. Global Const KEY_SELECT = &H29
  100. Global Const KEY_PRINT = &H2A
  101. Global Const KEY_EXECUTE = &H2B
  102. Global Const KEY_SNAPSHOT = &H2C
  103. Global Const KEY_INSERT = &H2D
  104. Global Const KEY_DELETE = &H2E
  105. Global Const KEY_HELP = &H2F
  106.  
  107. ' KEY_A thru KEY_Z are the same as their ASCII equivalents: 'A' thru 'Z'
  108. ' KEY_0 thru KEY_9 are the same as their ASCII equivalents: '0' thru '9'
  109.  
  110. Global Const KEY_NUMPAD0 = &H60
  111. Global Const KEY_NUMPAD1 = &H61
  112. Global Const KEY_NUMPAD2 = &H62
  113. Global Const KEY_NUMPAD3 = &H63
  114. Global Const KEY_NUMPAD4 = &H64
  115. Global Const KEY_NUMPAD5 = &H65
  116. Global Const KEY_NUMPAD6 = &H66
  117. Global Const KEY_NUMPAD7 = &H67
  118. Global Const KEY_NUMPAD8 = &H68
  119. Global Const KEY_NUMPAD9 = &H69
  120. Global Const KEY_MULTIPLY = &H6A
  121. Global Const KEY_ADD = &H6B
  122. Global Const KEY_SEPARATOR = &H6C
  123. Global Const KEY_SUBTRACT = &H6D
  124. Global Const KEY_DECIMAL = &H6E
  125. Global Const KEY_DIVIDE = &H6F
  126. Global Const KEY_F1 = &H70
  127. Global Const KEY_F2 = &H71
  128. Global Const KEY_F3 = &H72
  129. Global Const KEY_F4 = &H73
  130. Global Const KEY_F5 = &H74
  131. Global Const KEY_F6 = &H75
  132. Global Const KEY_F7 = &H76
  133. Global Const KEY_F8 = &H77
  134. Global Const KEY_F9 = &H78
  135. Global Const KEY_F10 = &H79
  136. Global Const KEY_F11 = &H7A
  137. Global Const KEY_F12 = &H7B
  138. Global Const KEY_F13 = &H7C
  139. Global Const KEY_F14 = &H7D
  140. Global Const KEY_F15 = &H7E
  141. Global Const KEY_F16 = &H7F
  142. Global Const KEY_NUMLOCK = &H90
  143.  
  144. ' State (DragOver)
  145. Global Const ENTER = 0
  146. Global Const LEAVE = 1
  147. Global Const OVER = 2
  148.  
  149. '====================='
  150. '                     '
  151. ' Function parameters '
  152. '                     '
  153. '====================='
  154.  
  155. ' MsgBox parameters
  156. Global Const MB_OK = 0                 ' OK button only
  157. Global Const MB_OKCANCEL = 1           ' OK and Cancel buttons
  158. Global Const MB_ABORTRETRYIGNORE = 2   ' Abort, Retry, and Ignore buttons
  159. Global Const MB_YESNOCANCEL = 3        ' Yes, No, and Cancel buttons
  160. Global Const MB_YESNO = 4              ' Yes and No buttons
  161. Global Const MB_RETRYCANCEL = 5        ' Retry and Cancel buttons
  162.  
  163. Global Const MB_ICONSTOP = 16          ' Critical message
  164. Global Const MB_ICONQUESTION = 32      ' Warning query
  165. Global Const MB_ICONEXCLAMATION = 48   ' Warning message
  166. Global Const MB_ICONINFORMATION = 64   ' Information message
  167.  
  168. Global Const MB_DEFBUTTON1 = 0         ' First button is default
  169. Global Const MB_DEFBUTTON2 = 256       ' Second button is default
  170. Global Const MB_DEFBUTTON3 = 512       ' Third button is default
  171.  
  172. ' MsgBox return values
  173. Global Const IDOK = 1                  ' OK button pressed
  174. Global Const IDCANCEL = 2              ' Cancel button pressed
  175. Global Const IDABORT = 3               ' Abort button pressed
  176. Global Const IDRETRY = 4               ' Retry button pressed
  177. Global Const IDIGNORE = 5              ' Ignore button pressed
  178. Global Const IDYES = 6                 ' Yes button pressed
  179. Global Const IDNO = 7                  ' No button pressed
  180.  
  181.  
  182. '==================='
  183. '                   '
  184. ' Method parameters '
  185. '                   '
  186. '==================='
  187.  
  188. ' Drag (controls)
  189. Global Const CANCEL = 0
  190. Global Const BEGIN_DRAG = 1
  191. Global Const END_DRAG = 2
  192.  
  193. ' GetData, GetFormat, SetData (Clipboard)
  194. Global Const CF_LINK = &HBF00
  195. Global Const CF_TEXT = 1
  196. Global Const CF_BITMAP = 2
  197. Global Const CF_METAFILE = 3
  198. Global Const CF_DIB = 8
  199.  
  200. ' Show (form)
  201. Global Const Modal = 1
  202. Global Const MODELESS = 0
  203.  
  204. '================='
  205. '                 '
  206. ' Property values '
  207. '                 '
  208. '================='
  209.  
  210. ' Alignment (label)
  211. Global Const LEFT_JUSTIFY = 0          ' 0 - Left Justify
  212. Global Const RIGHT_JUSTIFY = 1         ' 1 - Right Justify
  213. Global Const CENTER = 2                ' 2 - Center
  214.  
  215. ' BackColor, ForeColor, FillColor (standard RGB colors: form, controls)
  216. Global Const BLACK = &H0&
  217. Global Const RED = &HFF&
  218. Global Const GREEN = &HFF00&
  219. Global Const YELLOW = &HFFFF&
  220. Global Const BLUE = &HFF0000
  221. Global Const MAGENTA = &HFF00FF
  222. Global Const CYAN = &HFFFF00
  223. Global Const WHITE = &HFFFFFF
  224.  
  225. ' BackColor, ForeColor, FillColor (system colors: form, controls)
  226. Global Const SCROLL_BARS = &H80000000           ' Scroll-bars gray area.
  227. Global Const DESKTOP = &H80000001               ' Desktop.
  228. Global Const ACTIVE_TITLE_BAR = &H80000002      ' Active window caption.
  229. Global Const INACTIVE_TITLE_BAR = &H80000003    ' Inactive window caption.
  230. Global Const MENU_BAR = &H80000004              ' Menu background.
  231. Global Const WINDOW_BACKGROUND = &H80000005     ' Window background.
  232. Global Const WINDOW_FRAME = &H80000006          ' Window frame.
  233. Global Const MENU_TEXT = &H80000007             ' Text in menus.
  234. Global Const WINDOW_TEXT = &H80000008           ' Text in windows.
  235. Global Const TITLE_BAR_TEXT = &H80000009        ' Text in caption, size box, scroll-bar arrow box..
  236. Global Const ACTIVE_BORDER = &H8000000A         ' Active window border.
  237. Global Const INACTIVE_BORDER = &H8000000B       ' Inactive window border.
  238. Global Const APPLICATION_WORKSPACE = &H8000000C ' Background color of multiple document interface (MDI) applications.
  239. Global Const HIGHLIGHT = &H8000000D             ' Items selected item in a control.
  240. Global Const HIGHLIGHT_TEXT = &H8000000E        ' Text of item selected in a control.
  241. Global Const BUTTON_FACE = &H8000000F           ' Face shading on command buttons.
  242. Global Const BUTTON_SHADOW = &H80000010         ' Edge shading on command buttons.
  243. 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.
  244. Global Const BUTTON_TEXT = &H80000012           ' Text on push buttons.
  245.  
  246. ' BorderStyle (form, label, picture box, text box)
  247. Global Const NONE = 0              ' 0 - None
  248. Global Const FIXED_SINGLE = 1          ' 1 - Fixed Single
  249. Global Const SIZABLE = 2           ' 2 - Sizable (Forms only)
  250. Global Const FIXED_DOUBLE = 3          ' 3 - Fixed Double (Forms only)
  251.  
  252. ' DragMode (controls)
  253. Global Const MANUAL = 0                ' 0 - Manual
  254. Global Const AUTOMATIC = 1             ' 1 - Automatic
  255.  
  256. ' DrawMode (form, picture box, Printer)
  257. Global Const BLACKNESS = 1             ' 1 - Blackness
  258. Global Const NOT_MERGE_PEN = 2         ' 2 - Not Merge Pen
  259. Global Const MASK_NOT_PEN = 3          ' 3 - Mask Not Pen
  260. Global Const NOT_COPY_PEN = 4          ' 4 - Not Copy Pen
  261. Global Const MASK_PEN_NOT = 5          ' 5 - Mask Pen Not
  262. Global Const INVERT = 6                ' 6 - Invert
  263. Global Const XOR_PEN = 7               ' 7 - Xor Pen
  264. Global Const NOT_MASK_PEN = 8          ' 8 - Not Mask Pen
  265. Global Const MASK_PEN = 9              ' 9 - Mask Pen
  266. Global Const NOT_XOR_PEN = 10          ' 10 - Not Xor Pen
  267. Global Const NOP = 11                  ' 11 - Nop
  268. Global Const MERGE_NOT_PEN = 12        ' 12 - Merge Not Pen
  269. Global Const COPY_PEN = 13             ' 13 - Copy Pen
  270. Global Const MERGE_PEN_NOT = 14        ' 14 - Merge Pen Not
  271. Global Const MERGE_PEN = 15            ' 15 - Merge Pen
  272. Global Const WHITENESS = 16            ' 16 - Whiteness
  273.  
  274. ' DrawStyle (form, picture box, Printer)
  275. Global Const SOLID = 0                 ' 0 - Solid
  276. Global Const DASH = 1                  ' 1 - Dash
  277. Global Const DOT = 2                   ' 2 - Dot
  278. Global Const DASH_DOT = 3              ' 3 - Dash-Dot
  279. Global Const DASH_DOT_DOT = 4          ' 4 - Dash-Dot-Dot
  280. Global Const INVISIBLE = 5             ' 5 - Invisible
  281. Global Const INSIDE_SOLID = 6          ' 6 - Inside Solid
  282.  
  283. ' FillStyle (form, picture box, Printer)
  284. ' Global Const SOLID = 0               ' 0 - Solid
  285. Global Const TRANSPARENT = 1           ' 1 - Transparent
  286. Global Const HORIZONTAL_LINE = 2       ' 2 - Horizontal Line
  287. Global Const VERTICAL_LINE = 3         ' 3 - Vertical Line
  288. Global Const UPWARD_DIAGONAL = 4       ' 4 - Upward Diagonal
  289. Global Const DOWNWARD_DIAGONAL = 5     ' 5 - Downward Diagonal
  290. Global Const CROSS = 6                 ' 6 - Cross
  291. Global Const DIAGONAL_CROSS = 7        ' 7 - Diagonal Cross
  292.  
  293. ' LinkMode (controls)
  294. ' Global Const NONE = 0                ' 0 - None
  295. Global Const HOT = 1                   ' 1 - Hot
  296. Global Const COLD = 2                  ' 2 - Cold
  297.  
  298. ' LinkMode (form)
  299. ' Global Const NONE = 0                ' 0 - None
  300. Global Const SERVER = 1                ' 1 - Server
  301.  
  302. ' MousePointer (form, controls)
  303. Global Const DEFAULT = 0           ' 0 - Default
  304. Global Const ARROW = 1             ' 1 - Arrow
  305. Global Const CROSSHAIR = 2         ' 2 - Cross
  306. Global Const IBEAM = 3             ' 3 - I-Beam
  307. Global Const ICON_POINTER = 4      ' 4 - Icon
  308. Global Const SIZE_POINTER = 5      ' 5 - Size
  309. Global Const SIZE_NE_SW = 6        ' 6 - Size NE SW
  310. Global Const SIZE_N_S = 7          ' 7 - Size N S
  311. Global Const SIZE_NW_SE = 8        ' 8 - Size NW SE
  312. Global Const SIZE_W_E = 9          ' 9 - Size W E
  313. Global Const UP_ARROW = 10         ' 10 - Up Arrow
  314. Global Const HOURGLASS = 11        ' 11 - Hourglass
  315. Global Const NO_DROP = 12          ' 12 - No drop
  316.  
  317. ' ScaleMode (form, picture box, Printer)
  318. Global Const USER = 0                  ' 0 - User
  319. Global Const TWIPS = 1                 ' 1 - Twip
  320. Global Const POINTS = 2                ' 2 - Point
  321. Global Const PIXELS = 3                ' 3 - Pixel
  322. Global Const CHARACTERS = 4            ' 4 - Character
  323. Global Const INCHES = 5                ' 5 - Inch
  324. Global Const MILLIMETERS = 6           ' 6 - Millimeter
  325. Global Const CENTIMETERS = 7           ' 7 - Centimeter
  326.  
  327. ' ScrollBar (text box)
  328. ' Global Const NONE = 0                ' 0 - None
  329. Global Const HORIZONTAL = 1            ' 1 - Horizontal
  330. Global Const VERTICAL = 2              ' 2 - Vertical
  331. Global Const BOTH = 3                  ' 3 - Both
  332.  
  333. ' Value (check box)
  334. Global Const UNCHECKED = 0             ' 0 - Unchecked
  335. Global Const CHECKED = 1               ' 1 - Checked
  336. Global Const GRAYED = 2                ' 2 - Grayed
  337.  
  338. ' WindowState (form)
  339. Global Const NORMAL = 0                ' 0 - Normal
  340. Global Const MINIMIZED = 1             ' 1 - Minimized
  341. Global Const MAXIMIZED = 2             ' 2 - Maximized
  342.  
  343. '
  344. ' Windows API Constant Declarations
  345. '
  346. Global Const MF_BYPOSITION = &H400
  347. Global Const WM_USER = &H400
  348. Global Const LB_DIR = WM_USER + 14
  349. Global Const LB_RESETCONTENT = WM_USER + 5
  350. Global Const EM_LIMITTEXT = WM_USER + 21
  351. Global Const WM_WININICHANGE = &H1A
  352. Global Const WF_STANDARD = &H10
  353. Global Const WF_ENHANCED = &H20
  354.  
  355. ' WinHelp command constants
  356.     
  357. Global Const HELP_CONTEXT = 1
  358. Global Const HELP_QUIT = 2
  359. Global Const HELP_INDEX = 3
  360. Global Const HELP_HELPONHELP = 4
  361.     
  362.  
  363.  
  364. '
  365. ' Windows API Function Declarations
  366. '
  367.  
  368. Declare Function GetSystemMenu Lib "User" (ByVal hWnd, ByVal bRevert)
  369. Declare Function RemoveMenu Lib "User" (ByVal hMenu, ByVal nPosition, ByVal wFlags)
  370. Declare Function GetFocus Lib "User" () As Integer
  371. Declare Function SendMessage Lib "User" (ByVal a%, ByVal b%, ByVal c%, ByVal d As Any) As Long
  372. Declare Function GetProfileString Lib "Kernel" (ByVal App$, Keyname As Any, ByVal DefaultVal$, ByVal RetBuf$, ByVal Size%) As Integer
  373. Declare Function WriteProfileString Lib "Kernel" (ByVal App$, ByVal Key$, ByVal Setting$) As Integer
  374. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
  375. Declare Function SetActiveWindow Lib "User" (ByVal hdc)
  376. Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags) As Long
  377. Declare Function GetWinFlags Lib "Kernel" () As Long
  378. Declare Function AppShellPrSetup Lib "AppShell" (ByVal hWnd%, ByVal Printer$, ByVal Driver$, ByVal Port$) As Integer
  379. Declare Function LoadLibrary Lib "Kernel" (ByVal lpLibFileName As String) As Integer
  380. Declare Sub FreeLibrary Lib "Kernel" (ByVal hLibModule As Integer)
  381.  
  382. '
  383. ' Miscellaneous
  384. '
  385. Global CRLF                    As String * 2
  386.  
  387. '
  388. ' Global Program Variables
  389. '
  390. Global Const APP_NAME = "App Shell"
  391. Global Const PGM_NAME = "APPSHELL"
  392. Global App_Changed         As Integer
  393. Global App_OpenTitle       As String
  394. Global App_SaveTitle       As String
  395. Global App_OpenSaveStyle   As Integer
  396. Global Const APP_OPEN = 0
  397. Global Const APP_SAVE = 1
  398. Global App_PrSetupTitle    As String
  399. Global App_PrinterName     As String
  400. Global App_PrinterDriver   As String
  401. Global App_PrinterPort     As String
  402. Global App_PrintCopyNumber As Integer
  403. Global App_PrintCopies     As Integer
  404. Global App_PrintCancel     As Integer
  405. Global App_FullFileName    As String
  406. Global App_FileName        As String
  407. Global App_Path            As String
  408. Global App_Drive           As String
  409. Global App_FileExtension   As String
  410. Global App_DialogReturn    As Integer
  411.  
  412. Global App_Data            As String
  413.  
  414.