' Useful constants
Global Const NULL = 0
Global Const TRUE = -1
Global Const FALSE = 0

' Cursor values
Global Const Default = 0    ' 0 - Default
Global Const ARROW = 1      ' 1 - Arrow
Global Const HOURGLASS = 11 ' 11 - Hourglass

'Declare DIB utility routines
Declare Function FindDIBBits Lib "DIBUTIL" (ByVal lpbi&) As Long
Declare Function DibNumColors Lib "DIBUTIL" (ByVal lpbi&) As Integer
Declare Function PaletteSize Lib "DIBUTIL" (ByVal lpbi&) As Integer
Declare Function CreateDIBPalette Lib "DIBUTIL" (ByVal hDIB%) As Integer 'HPAL
Declare Function DIBHeight Lib "DIBUTIL" (ByVal lpDIB&) As Long
Declare Function DIBWidth Lib "DIBUTIL" (ByVal lpDIB&) As Long
Declare Function DIBLoad Lib "DIBUTIL" (ByVal lpszDIBName$) As Integer   'hDIBInfo

' Win API Constants, type declarations, etc.

'Menu manipulation constants
Global Const MF_BYCOMMAND = &H0
Global Const MF_BYPOSITION = &H400

' The only Raster Op code we need
Global Const SRCCOPY = &HCC0020

' CreatDIBitmap init param
Global Const CBM_INIT = &H4

'A Bitmap file Header
Type BitmapFileHeader
    bftype As Integer
    bfsize As Long
    bfReserved1 As Integer
    bfReserved2 As Integer
    bfOffBits As Long
End Type

'A Win 3.x Bitmap file information header
Type BitmapInfoHeader
    biSize As Long
    biWidth As Long
    biHeight As Long
    biPlanes As Integer
    biBitCount As Integer
    biCompression As Long
    biSizeImage As Long
    biXPelsPerMeter As Long
    biYPelsPerMeter As Long
    biClrUsed As Long
    biClrImportant As Long
End Type

' Windows API declarations

' Memory functions
Declare Function GlobalFree Lib "Kernel" (ByVal hMem%) As Integer
Declare Function GlobalLock Lib "Kernel" (ByVal hMem%) As Long
Declare Function GlobalUnlock Lib "Kernel" (ByVal hMem%) As Integer

' GDI functions
Declare Function CreateCompatibleDC Lib "GDI" (ByVal hDC%) As Integer
Declare Function SelectObject Lib "GDI" (ByVal hDC%, ByVal hObject%) As Integer
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
Declare Function DeleteDC Lib "gdi" (ByVal hDC%) As Integer
Declare Function SelectPalette Lib "USER" (ByVal hDC As Integer, ByVal hPalette As Integer, ByVal bForceBackground As Integer) As Integer
Declare Function RealizePalette Lib "USER" (ByVal hDC As Integer) As Integer
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
Declare Function DeleteObject Lib "GDI" (ByVal hGDIObject%) As Integer
Declare Function GetDC Lib "USER" (ByVal hWnd As Integer) As Integer
Declare Function ReleaseDC Lib "USER" (ByVal hWnd As Integer, ByVal hDC As Integer) As Integer

' Miscellany
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
Declare Function GetSystemMenu Lib "User" (ByVal Handle%, ByVal bRevert%) As Integer
Declare Function RemoveMenu Lib "User" (ByVal hMenu%, ByVal Position%, ByVal Flags%) As Integer
Declare Function LoadLibrary Lib "Kernel" (ByVal lpszFileName$) As Integer
Declare Sub FreeLibrary Lib "Kernel" (ByVal hModule%)

