home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / cpkocx17 / system.bas < prev    next >
Encoding:
BASIC Source File  |  1997-05-27  |  4.8 KB  |  93 lines

  1. Attribute VB_Name = "SYSTEM"
  2. '
  3. ' This module contains the definition for several
  4. ' constants, together with
  5. ' some Windows API function declaration.
  6. '
  7. '
  8.  
  9.  
  10. ' Windows Common Dialog types
  11. Global Const CD_OPENFILE = 1
  12. Global Const CD_SAVEFILE = 2
  13.  
  14. Global Const OFN_HIDEREADONLY = &H4&
  15. Global Const OFN_SHOWHELP = &H10&
  16. Global Const OFN_NOVALIDATE = &H100&
  17. Global Const OFN_PATHMUSTEXIST = &H800&
  18. Global Const OFN_FILEMUSTEXIST = &H1000&
  19. Global Const OFN_CREATEPROMPT = &H2000&
  20. Global Const OFN_SHAREAWARE = &H4000&
  21. Global Const OFN_NOREADONLYRETURN = &H8000&
  22.  
  23. ' Screen.MousePointers
  24. Global Const Default = 0        ' 0 - Default
  25. Global Const ARROW = 1          ' 1 - Arrow
  26. Global Const CROSSHAIR = 2      ' 2 - Cross
  27. Global Const IBEAM = 3          ' 3 - I-Beam
  28. Global Const ICON_POINTER = 4   ' 4 - Icon
  29. Global Const HOURGLASS = 11     ' 11 - Hourglass
  30.  
  31. '
  32. ' INI file management functions
  33. '
  34. #If Win16 Then
  35.     Declare Function GetPrivateProfileInt Lib "kernel" (ByVal Appname As String, ByVal KeyName As String, ByVal Default As Integer, ByVal FileName As String) As Integer
  36.     Declare Function GetPrivateProfileString Lib "kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFilename As String) As Integer
  37.     Declare Function WritePrivateProfileString Lib "kernel" (ByVal Appname As String, ByVal KeyName As String, ByVal NewString As String, ByVal FileName As String) As Integer
  38. #Else
  39.     Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal Appname As String, ByVal KeyName As String, ByVal Default As Integer, ByVal FileName As String) As Integer
  40.     Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFilename As String) As Integer
  41.     Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal Appname As String, ByVal KeyName As String, ByVal NewString As String, ByVal FileName As String) As Integer
  42. #End If
  43.  
  44. ' MsgBox parameters
  45. Global Const MB_OK = 0                  ' OK button only
  46. Global Const MB_OKCANCEL = 1            ' OK and Cancel buttons
  47. Global Const MB_ABORTRETRYIGNORE = 2    ' Abort, Retry, and Ignore buttons
  48. Global Const MB_YESNOCANCEL = 3         ' Yes, No, and Cancel buttons
  49. Global Const MB_YESNO = 4               ' Yes and No buttons
  50. Global Const MB_RETRYCANCEL = 5         ' Retry and Cancel buttons
  51.  
  52. Global Const MB_ICONSTOP = 16           ' Critical message
  53. Global Const MB_ICONQUESTION = 32       ' Warning query
  54. Global Const MB_ICONEXCLAMATION = 48    ' Warning message
  55. Global Const MB_ICONINFORMATION = 64    ' Information message
  56.  
  57. Global Const MB_APPLMODAL = 0           ' Application Modal Message Box
  58. Global Const MB_DEFBUTTON1 = 0          ' First button is default
  59. Global Const MB_DEFBUTTON2 = 256        ' Second button is default
  60. Global Const MB_DEFBUTTON3 = 512        ' Third button is default
  61. Global Const MB_SYSTEMMODAL = 4096      ' System Modal
  62.  
  63. ' MsgBox return values
  64. Global Const IDOK = 1                   ' OK button pressed
  65. Global Const IDCANCEL = 2               ' Cancel button pressed
  66. Global Const IDABORT = 3                ' Abort button pressed
  67. Global Const IDRETRY = 4                ' Retry button pressed
  68. Global Const IDIGNORE = 5               ' Ignore button pressed
  69. Global Const IDYES = 6                  ' Yes button pressed
  70. Global Const IDNO = 7                   ' No button pressed
  71.  
  72. ' WindowState
  73. Global Const NORMAL = 0                 ' 0 - Normal
  74. Global Const MINIMIZED = 1              ' 1 - Minimized
  75. Global Const MAXIMIZED = 2              ' 2 - Maximized
  76.  
  77. ' Windows help management
  78. #If Win16 Then
  79. Declare Sub WinHelp Lib "user" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, ByVal dwData As Any)
  80. Declare Sub WinHelpString Lib "user" Alias "WinHelp" (ByVal hWnd%, ByVal hlHelpFile$, ByVal wCommand%, ByVal lpstrData$)
  81. #Else
  82. Declare Sub WinHelp Lib "user32" Alias "WinHelpA" (ByVal hWnd As Long, ByVal lpHelpFile$, ByVal wCommand As Long, ByVal dwData As Any)
  83. Declare Sub WinHelpString Lib "user32" Alias "WinHelpA" (ByVal hWnd As Long, ByVal hlHelpFile$, ByVal wCommand As Long, ByVal lpstrData$)
  84. #End If
  85.  
  86. Global Const APP_HELP_CONTENTS = &H3 ' Display Help for a particular topic
  87. Global Const HELP_CONTEXT = &H1      ' Display topic in ulTopic
  88. Global Const HELP_HELPONHELP = &H4   ' Display help on using help
  89. Global Const HELP_QUIT = &H2         ' Terminate help
  90. Global Const HELP_KEY = &H101        ' Search by key string
  91. Global Const HELP_PARTIALKEY = &H105 ' Search by partial match on key string
  92.  
  93.