home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / 256pb2 / 256picbx.bas next >
Encoding:
BASIC Source File  |  1995-02-27  |  3.3 KB  |  79 lines

  1. ' Useful constants
  2.  
  3. ' Cursor values
  4. Global Const Default = 0    ' 0 - Default
  5. Global Const ARROW = 1      ' 1 - Arrow
  6. Global Const HOURGLASS = 11 ' 11 - Hourglass
  7.  
  8. 'Declare DIB utility routines
  9. Declare Function FindDIBBits Lib "DIBUTIL.DLL" (ByVal lpbi&) As Long
  10. Declare Function DibNumColors Lib "DIBUTIL.DLL" (ByVal lpbi&) As Integer
  11. Declare Function PaletteSize Lib "DIBUTIL.DLL" (ByVal lpbi&) As Integer
  12. Declare Function CreateDIBPalette Lib "DIBUTIL.DLL" (ByVal hDIB%) As Integer 'HPAL
  13. Declare Function DIBHeight Lib "DIBUTIL.DLL" (ByVal lpDIB&) As Long
  14. Declare Function DIBWidth Lib "DIBUTIL.DLL" (ByVal lpDIB&) As Long
  15. Declare Function DIBLoad Lib "DIBUTIL.DLL" (ByVal lpszDIBName$) As Integer   'hDIBInfo
  16.  
  17. ' Win API Constants, type declarations, etc.
  18.  
  19. 'Menu manipulation constants
  20. Global Const MF_BYCOMMAND = &H0
  21. Global Const MF_BYPOSITION = &H400
  22.  
  23. ' The only Raster Op code we need
  24. Global Const SRCCOPY = &HCC0020
  25.  
  26. ' CreatDIBitmap init param
  27. Global Const CBM_INIT = &H4
  28.  
  29. 'A Bitmap file Header
  30. Type BitmapFileHeader
  31.     bftype As Integer
  32.     bfsize As Long
  33.     bfReserved1 As Integer
  34.     bfReserved2 As Integer
  35.     bfOffBits As Long
  36. End Type
  37.  
  38. 'A Win 3.x Bitmap file information header
  39. Type BitmapInfoHeader
  40.     biSize As Long
  41.     biWidth As Long
  42.     biHeight As Long
  43.     biPlanes As Integer
  44.     biBitCount As Integer
  45.     biCompression As Long
  46.     biSizeImage As Long
  47.     biXPelsPerMeter As Long
  48.     biYPelsPerMeter As Long
  49.     biClrUsed As Long
  50.     biClrImportant As Long
  51. End Type
  52.  
  53. ' Windows API declarations
  54.  
  55. ' Memory functions
  56. Declare Function GlobalFree Lib "Kernel" (ByVal hMem%) As Integer
  57. Declare Function GlobalLock Lib "Kernel" (ByVal hMem%) As Long
  58. Declare Function GlobalUnlock Lib "Kernel" (ByVal hMem%) As Integer
  59.  
  60. ' GDI functions
  61. Declare Function CreateCompatibleDC Lib "GDI" (ByVal hDC%) As Integer
  62. Declare Function SelectObject Lib "GDI" (ByVal hDC%, ByVal hObject%) As Integer
  63. Declare Function BitBlt Lib "GDI" (ByVal hDestDC%, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal dwRop&) As Integer
  64. Declare Function DeleteDC Lib "gdi" (ByVal hDC%) As Integer
  65. Declare Function SelectPalette Lib "USER" (ByVal hDC As Integer, ByVal hPalette As Integer, ByVal bForceBackground As Integer) As Integer
  66. Declare Function RealizePalette Lib "USER" (ByVal hDC As Integer) As Integer
  67. Declare Function CreateDIBitmap Lib "GDI" (ByVal hDC As Integer, ByVal lpInfoHeader As Long, ByVal dwUsage As Long, ByVal lpInitBits As Long, ByVal lpInitInfo As Long, ByVal wUsage As Integer) As Integer
  68. Declare Function DeleteObject Lib "GDI" (ByVal hGDIObject%) As Integer
  69. Declare Function GetDC Lib "USER" (ByVal hWnd As Integer) As Integer
  70. Declare Function ReleaseDC Lib "USER" (ByVal hWnd As Integer, ByVal hDC As Integer) As Integer
  71.  
  72. ' Miscellany
  73. Declare Function GetProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer) As Integer
  74. Declare Function GetSystemMenu Lib "User" (ByVal Handle%, ByVal bRevert%) As Integer
  75. Declare Function RemoveMenu Lib "User" (ByVal hMenu%, ByVal Position%, ByVal Flags%) As Integer
  76. Declare Function LoadLibrary Lib "Kernel" (ByVal lpszFileName$) As Integer
  77. Declare Sub FreeLibrary Lib "Kernel" (ByVal hModule%)
  78.  
  79.