home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code2 / resocd / res_glob.bas < prev    next >
Encoding:
BASIC Source File  |  1995-02-27  |  3.2 KB  |  87 lines

  1.  
  2. 'Resources Bar program, 12-6-92
  3.  
  4.  
  5. 'This allows me to pass around the parameters
  6. ' that I get out of the .ini file to correctly set
  7. ' up the sounds.
  8. Global TopOfHour As String
  9. Global BottOfHour As String
  10. Global NewTopOfHour As String
  11. Global NewBottOfHour As String
  12. Global NL As String  '= Chr$(13) + Chr$(10) carriage return for message boxes
  13.  
  14.  
  15. 'Now I Can write "true" and "false" instead of
  16. ' 0 and -1
  17.  
  18. 'Set up key recognition so I can use the
  19. ' name not the number
  20. Global Const Escape = &H1B
  21. Global Const KEY_F1 = &H70
  22. Global Const UpArrow = &H26
  23. Global Const DownArrow = &H28
  24. Global Const RightArrow = &H27
  25. Global Const LeftArrow = &H25
  26.  
  27.  
  28. 'Stay on Top
  29. Declare Function SetWindowPos Lib "user" (ByVal h%, ByVal hb%, ByVal X%, ByVal Y%, ByVal cx%, ByVal cy%, ByVal f%) As Integer
  30. Global Const SWP_NOMOVE = 2
  31. Global Const tSWP_NOSIZE = 1 'I added the "t" to elim. error mess because the move with mouse uses same name but diff. value ??? but this one dowen'seem to be used anywhere... but it works
  32. Global Const FLAGS = SWP_NOMOVE Or tSWP_NOSIZE
  33. Global Const HWND_TOPMOST = -1
  34. Global Const HWND_NOTOPMOST = -2
  35.  
  36.   'Check when form loses focus
  37.   Global Focus  As Integer
  38.   Declare Function GetActiveWindow Lib "User" () As Integer
  39.  
  40.   'Used to set/reset form when got/lost focus (now I can
  41.   ' just type the color names).
  42.   Global Const Black = &H0&
  43.   Global Const Red = &HFF&
  44.   Global Const Blue = &HFF0000
  45.   Global Const White = &HFFFFFF
  46.   Global Const Grey = &HC0C0C0
  47.  
  48. 'Free Memory
  49. Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags As Integer) As Long
  50.  
  51. 'Free Resources
  52. Declare Function GetFreeSystemResources Lib "User" (ByVal fuSysResource As Integer) As Integer
  53. Global Const GFSR_SYSTEMRESOURCES = 0
  54.  
  55. 'This is for Windows version verification
  56. Declare Function GetVersion Lib "Kernel" () As Integer
  57.  
  58. 'For DING on the hour and 1/2 hour
  59. Declare Function SndPlaySound Lib "mmsystem" (ByVal FileName$, ByVal snd_async%) As Integer
  60.  
  61. 'To handle .ini file operations
  62. Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
  63. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  64. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lplFileName As String) As Integer
  65.  
  66. 'Move window with the mouse
  67.  
  68. Type POINTAPI
  69.    X As Integer
  70.    Y As Integer
  71. End Type
  72.  
  73. Declare Sub GetCursorPos Lib "User" (lpPoint As POINTAPI)
  74. Declare Sub ScreenToClient Lib "User" (ByVal hWnd As Integer, lpPoint As POINTAPI)
  75. ' I remed this out and used the function declar. in the stay on top area
  76. '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)
  77.  
  78. Global Const SWP_NOSIZE = &H1
  79. Global Const Left_Button = 1
  80. Global CurPos As POINTAPI
  81. Global MyPosX As Integer
  82. Global MyPosY As Integer
  83.  
  84.  
  85.  
  86.  
  87.