Declare Sub GetScrollRange Lib "User" ( hWnd%, nBar%, lpMinPos As Pointer To Integer, lpMaxPos As Pointer To Integer)
Declare Sub ShowScrollBar Lib "User" ( hWnd%, wBar%, bShow%)
Declare Function SetProp Lib "User" ( hWnd%, lpString As Any, hData%) As Integer
Declare Function GetProp Lib "User" ( hWnd%, lpString As Any) As Integer
Declare Function RemoveProp Lib "User" ( hWnd%, lpString As Any) As Integer
Declare Sub SetWindowText Lib "User" ( hWnd%, lpString$)
Declare Function GetWindowTextLength Lib "User" ( hWnd%) As Integer
Declare Sub AdjustWindowRect Lib "User" (lpRect As RECT, dwStyle&, bMenu%)
Declare Sub AdjustWindowRectEx Lib "User" (lpRect As RECT, dwStyle&, bMenu%, dwExStyle&)
' MessageBox() Flags
Const MB_OK = &H0
Const MB_OKCANCEL = &H1
Const MB_ABORTRETRYIGNORE = &H2
Const MB_YESNOCANCEL = &H3
Const MB_YESNO = &H4
Const MB_RETRYCANCEL = &H5
Const MB_ICONHAND = &H10
Const MB_ICONQUESTION = &H20
Const MB_ICONEXCLAMATION = &H30
Const MB_ICONASTERISK = &H40
Const MB_ICONINFORMATION = MB_ICONASTERISK
Const MB_ICONSTOP = MB_ICONHAND
Const MB_DEFBUTTON1 = &H0
Const MB_DEFBUTTON2 = &H100
Const MB_DEFBUTTON3 = &H200
Const MB_APPLMODAL = &H0
Const MB_SYSTEMMODAL = &H1000
Const MB_TASKMODAL = &H2000
Const MB_NOFOCUS = &H8000
Const MB_TYPEMASK = &HF
Const MB_ICONMASK = &HF0
Const MB_DEFMASK = &HF00
Const MB_MODEMASK = &H3000
Const MB_MISCMASK = &HC000
Declare Function MessageBox Lib "User" ( hWndParent%, lpText$, lpCaption$, wType%) As Integer
Declare Sub MessageBeep Lib "User" ( wType%)
Declare Function ShowCursor Lib "User" ( bShow%) As Integer
Declare Sub SetCursorPos Lib "User" ( X%, Y%)
Declare Function SetCursor Lib "User" ( hCursor%) As Integer
Declare Sub GetCursorPos Lib "User" (lpPoint As POINT)
Declare Sub ClipCursor Lib "User" (lpRect As RECT)
Declare Sub CreateCaret Lib "User" ( hWnd%, hBitmap%, nWidth%, nHeight%)
Declare Function GetCaretBlinkTime Lib "User" () As Integer
Declare Sub SetCaretBlinkTime Lib "User" ( wMSeconds%)
Declare Sub DestroyCaret Lib "User" ()
Declare Sub HideCaret Lib "User" ( hWnd%)
Declare Sub ShowCaret Lib "User" ( hWnd%)
Declare Sub SetCaretPos Lib "User" ( X%, Y%)
Declare Sub GetCaretPos Lib "User" (lpPoint As POINT)
Declare Sub ClientToScreen Lib "User" ( hWnd%, lpPoint As POINT)
Declare Sub ScreenToClient Lib "User" ( hWnd%, lpPoint As POINT)
' WindowFromPoint and ChildWindowFromPoint expect a POINT structure
' passed by value - MSTest will not pass a TYPE structure by value
' so the two integer parameters listed below are a work around.
Declare Function WindowFromPoint Lib "User" (y%,x%) As Integer
Declare Function ChildWindowFromPoint Lib "User" ( hWnd%, y%, x%) As Integer
' Color Types
Const CTLCOLOR_MSGBOX = 0
Const CTLCOLOR_EDIT = 1
Const CTLCOLOR_LISTBOX = 2
Const CTLCOLOR_BTN = 3
Const CTLCOLOR_DLG = 4
Const CTLCOLOR_SCROLLBAR = 5
Const CTLCOLOR_STATIC = 6
Const CTLCOLOR_MAX = 8 ' three bits max
Const COLOR_SCROLLBAR = 0
Const COLOR_BACKGROUND = 1
Const COLOR_ACTIVECAPTION = 2
Const COLOR_INACTIVECAPTION = 3
Const COLOR_MENU = 4
Const COLOR_WINDOW = 5
Const COLOR_WINDOWFRAME = 6
Const COLOR_MENUTEXT = 7
Const COLOR_WINDOWTEXT = 8
Const COLOR_CAPTIONTEXT = 9
Const COLOR_ACTIVEBORDER = 10
Const COLOR_INACTIVEBORDER = 11
Const COLOR_APPWORKSPACE = 12
Const COLOR_HIGHLIGHT = 13
Const COLOR_HIGHLIGHTTEXT = 14
Const COLOR_BTNFACE = 15
Const COLOR_BTNSHADOW = 16
Const COLOR_GRAYTEXT = 17
Const COLOR_BTNTEXT = 18
Const COLOR_ENDCOLORS = COLOR_BTNTEXT
Declare Function GetSysColor Lib "User" ( nIndex%) As Long
Declare Sub SetSysColors Lib "User" ( nChanges%, lpSysColor As Pointer To Integer, lpColorValues As Pointer To Long)
Declare Function FillRgn Lib "User" ( hDC%, hRgn%, hBrush%) As Integer
Declare Function FrameRgn Lib "User" ( hDC%, hRgn%, hBrush%, nWidth%, nHeight%) As Integer
Declare Function InvertRgn Lib "User" ( hDC%, hRgn%) As Integer
Declare Function PaintRgn Lib "User" ( hDC%, hRgn%) As Integer
Declare Function PtInRegion Lib "User" ( hRgn%, X%, Y%) As Integer
Declare Sub DrawFocusRect Lib "User" ( hDC%, lpRect As RECT)
Declare Function FillRect Lib "User" ( hDC%, lpRect As RECT, hBrush%) As Integer
Declare Function FrameRect Lib "User" ( hDC%, lpRect As RECT, hBrush%) As Integer
Declare Sub InvertRect Lib "User" ( hDC%, lpRect As RECT)
Declare Sub SetRect Lib "User" (lpRect As RECT, X1%, Y1%, X2%, Y2%)
Declare Sub SetRectEmpty Lib "User" (lpRect As RECT)
Declare Function CopyRect Lib "User" (lpDestRect As RECT, lpSourceRect As RECT) As Integer
Declare Sub InflateRect Lib "User" (lpRect As RECT, X%, Y%)
Declare Function IntersectRect Lib "User" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Integer
Declare Function UnionRect Lib "User" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Integer
Declare Sub OffsetRect Lib "User" (lpRect As RECT, X%, Y%)
Declare Function IsRectEmpty Lib "User" (lpRect As RECT) As Integer
Declare Function EqualRect Lib "User" (lpRect1 As RECT, lpRect2 As RECT) As Integer
' PtInRect also requires a TYPE passed by value - work around with two integers
Declare Function PtInRect Lib "User" (lpRect As RECT, y%, x%) As Integer
Declare Function RectVisible Lib "User" ( hDC%, lpRect As RECT) As Integer
Declare Function RectInRegion Lib "User" ( hRgn%, lpRect As RECT) As Integer
Declare Function GetCurrentTime Lib "User" () As Long
Declare Function GetTickCount Lib "User" () As Long
Declare Function GetWindowWord Lib "User" ( hWnd%, nIndex%) As Integer
Declare Function SetWindowWord Lib "User" ( hWnd%, nIndex%, wNewWord%) As Integer
Declare Function SetWindowLong Lib "User" ( hWnd%, nIndex%, dwNewLong&) As Long
Declare Function GetClassWord Lib "User" ( hWnd%, nIndex%) As Integer
Declare Function SetClassWord Lib "User" ( hWnd%, nIndex%, wNewWord%) As Integer
Declare Function GetClassLong Lib "User" ( hWnd%, nIndex%) As Long
Declare Function SetClassLong Lib "User" ( hWnd%, nIndex%, dwNewLong&) As Long
Declare Function GetDesktopHwnd Lib "User" () As Integer
Declare Function GetParent Lib "User" ( hWnd%) As Integer
Declare Function SetParent Lib "User" ( hWndChild%, hWndNewParent%) As Integer
Declare Function GetClassName Lib "User" ( hWnd%, lpClassName$, nMaxCount%) As Integer
Declare Function GetTopWindow Lib "User" ( hWnd%) As Integer
Declare Function GetNextWindow Lib "User" ( hWnd%, wFlag%) As Integer
Declare Function GetWindowTask Lib "User" ( hWnd%) As Integer
Declare Function GetLastActivePopup Lib "User" ( hwndOwnder%) As Integer
' GetWindow() Constants
Const GW_HWNDFIRST = 0
Const GW_HWNDLAST = 1
Const GW_HWNDNEXT = 2
Const GW_HWNDPREV = 3
Const GW_OWNER = 4
Const GW_CHILD = 5
Declare Function GetWindow Lib "User" ( hWnd%, wCmd%) As Integer
' Menu flags for Add/Check/EnableMenuItem()
Const MF_INSERT = &H0
Const MF_CHANGE = &H80
Const MF_APPEND = &H100
Const MF_DELETE = &H200
Const MF_REMOVE = &H1000
Const MF_BYCOMMAND = &H0
Const MF_BYPOSITION = &H400
Const MF_SEPARATOR = &H800
Const MF_ENABLED = &H0
Const MF_GRAYED = &H1
Const MF_DISABLED = &H2
Const MF_UNCHECKED = &H0
Const MF_CHECKED = &H8
Const MF_USECHECKBITMAPS = &H200
Const MF_STRING = &H0
Const MF_BITMAP = &H4
Const MF_OWNERDRAW = &H100
Const MF_POPUP = &H10
Const MF_MENUBARBREAK = &H20
Const MF_MENUBREAK = &H40
Const MF_UNHILITE = &H0
Const MF_HILITE = &H80
Const MF_SYSMENU = &H2000
Const MF_HELP = &H4000
Const MF_MOUSESELECT = &H8000
' Menu item resource format
Type MENUITEMTEMPLATEHEADER
versionNumber As Integer
offset As Integer
End Type
Const MF_END = &H80
' System Menu Command Values
Const SC_SIZE = &HF000
Const SC_MOVE = &HF010
Const SC_MINIMIZE = &HF020
Const SC_MAXIMIZE = &HF030
Const SC_NEXTWINDOW = &HF040
Const SC_PREVWINDOW = &HF050
Const SC_CLOSE = &HF060
Const SC_VSCROLL = &HF070
Const SC_HSCROLL = &HF080
Const SC_MOUSEMENU = &HF090
Const SC_KEYMENU = &HF100
Const SC_ARRANGE = &HF110
Const SC_RESTORE = &HF120
Const SC_TASKLIST = &HF130
Const SC_ICON = SC_MINIMIZE
Const SC_ZOOM = SC_MAXIMIZE
' Resource Loading Routines
Declare Function LoadBitmap Lib "User" ( hInstance%, lpBitmapName As Any) As Integer
Declare Function LoadCursor Lib "User" ( hInstance%, lpCursorName As Any) As Integer
Declare Function CreateCursor Lib "User" ( hInstance%, nXhotspot%, nYhotspot%, nWidth%, nHeight%, lpANDbitPlane As Any, lpXORbitPlane As Any) As Integer
Declare Function DestroyCursor Lib "User" ( hCursor%) As Integer
' Standard Cursor IDs
Const IDC_ARROW = 32512
Const IDC_IBEAM = 32513
Const IDC_WAIT = 32514
Const IDC_CROSS = 32515
Const IDC_UPARROW = 32516
Const IDC_SIZE = 32640
Const IDC_ICON = 32641
Const IDC_SIZENWSE = 32642
Const IDC_SIZENESW = 32643
Const IDC_SIZEWE = 32644
Const IDC_SIZENS = 32645
Declare Function LoadIcon Lib "User" ( hInstance%, lpIconName As Any) As Integer
Declare Function CreateIcon Lib "User" ( hInstance%, nWidth%, nHeight%, nPlanes%, nBitsPixel%, lpANDbits As Any, lpXORbits As Any) As Integer
Declare Function DestroyIcon Lib "User" ( hIcon%) As Integer
Const ORD_LANGDRIVER = 1 ' The ordinal number for the entry point of
' language drivers.
' Standard Icon IDs
Const IDI_APPLICATION = 32512
Const IDI_HAND = 32513
Const IDI_QUESTION = 32514
Const IDI_EXCLAMATION = 32515
Const IDI_ASTERISK = 32516
Declare Function LoadString Lib "User" ( hInstance%, wID%, lpBuffer As Any, nBufferMax%) As Integer
Declare Function AddFontResource Lib "GDI" ( lpFilename As Any) As Integer
Declare Function RemoveFontResource Lib "GDI" ( lpFilename As Any) As Integer
' Dialog Box Command IDs
Const IDOK = 1
Const IDCANCEL = 2
Const IDABORT = 3
Const IDRETRY = 4
Const IDIGNORE = 5
Const IDYES = 6
Const IDNO = 7
' Control Manager Structures and Definitions
' Edit Control Styles
Const ES_LEFT = &H0
Const ES_CENTER = &H1
Const ES_RIGHT = &H2
Const ES_MULTILINE = &H4
Const ES_UPPERCASE = &H8
Const ES_LOWERCASE = &H10
Const ES_PASSWORD = &H20
Const ES_AUTOVSCROLL = &H40
Const ES_AUTOHSCROLL = &H80
Const ES_NOHIDESEL = &H100
Const ES_OEMCONVERT = &H400
' Edit Control Notification Codes
Const EN_SETFOCUS = &H100
Const EN_KILLFOCUS = &H200
Const EN_CHANGE = &H300
Const EN_UPDATE = &H400
Const EN_ERRSPACE = &H500
Const EN_MAXTEXT = &H501
Const EN_HSCROLL = &H601
Const EN_VSCROLL = &H602
' Edit Control Messages
Const EM_GETSEL = WM_USER+0
Const EM_SETSEL = WM_USER+1
Const EM_GETRECT = WM_USER+2
Const EM_SETRECT = WM_USER+3
Const EM_SETRECTNP = WM_USER+4
Const EM_SCROLL = WM_USER+5
Const EM_LINESCROLL = WM_USER+6
Const EM_GETMODIFY = WM_USER+7
Const EM_SETMODIFY = WM_USER+8
Const EM_GETLINECOUNT = WM_USER+9
Const EM_LINEINDEX = WM_USER+10
Const EM_SETHANDLE = WM_USER+12
Const EM_GETHANDLE = WM_USER+13
Const EM_GETTHUMB = WM_USER+14
Const EM_LINELENGTH = WM_USER+17
Const EM_REPLACESEL = WM_USER+18
Const EM_SETFONT = WM_USER+19
Const EM_GETLINE = WM_USER+20
Const EM_LIMITTEXT = WM_USER+21
Const EM_CANUNDO = WM_USER+22
Const EM_UNDO = WM_USER+23
Const EM_FMTLINES = WM_USER+24
Const EM_LINEFROMCHAR = WM_USER+25
Const EM_SETWORDBREAK = WM_USER+26
Const EM_SETTABSTOPS = WM_USER+27
Const EM_SETPASSWORDCHAR = WM_USER+28
Const EM_EMPTYUNDOBUFFER = WM_USER+29
Const EM_MSGMAX = WM_USER+30
' Button Control Styles
Const BS_PUSHBUTTON = &H0
Const BS_DEFPUSHBUTTON = &H1
Const BS_CHECKBOX = &H2
Const BS_AUTOCHECKBOX = &H3
Const BS_RADIOBUTTON = &H4
Const BS_3STATE = &H5
Const BS_AUTO3STATE = &H6
Const BS_GROUPBOX = &H7
Const BS_USERBUTTON = &H8
Const BS_AUTORADIOBUTTON = &H9
Const BS_PUSHBOX = &HA
Const BS_OWNERDRAW = &HB
Const BS_LEFTTEXT = &H20
' User Button Notification Codes
Const BN_CLICKED = 0
Const BN_PAINT = 1
Const BN_HILITE = 2
Const BN_UNHILITE = 3
Const BN_DISABLE = 4
Const BN_DOUBLECLICKED = 5
' Button Control Messages
Const BM_GETCHECK = WM_USER+0
Const BM_SETCHECK = WM_USER+1
Const BM_GETSTATE = WM_USER+2
Const BM_SETSTATE = WM_USER+3
Const BM_SETSTYLE = WM_USER+4
' Static Control Constants
Const SS_LEFT = &H0
Const SS_CENTER = &H1
Const SS_RIGHT = &H2
Const SS_ICON = &H3
Const SS_BLACKRECT = &H4
Const SS_GRAYRECT = &H5
Const SS_WHITERECT = &H6
Const SS_BLACKFRAME = &H7
Const SS_GRAYFRAME = &H8
Const SS_WHITEFRAME = &H9
Const SS_USERITEM = &HA
Const SS_SIMPLE = &HB
Const SS_LEFTNOWORDWRAP = &HC
Const SS_NOPREFIX = &H80 ' Don't do "&" character translation
' Dialog Manager Routines
Declare Function IsDialogMessage Lib "User" ( hDlg%, lpMsg As MSG) As Integer
Declare Sub MapDialogRect Lib "User" ( hDlg%, lpRect As RECT)
Declare Function DlgDirList Lib "User" ( hDlg%, lpPathSpec$, nIDListBox%, nIDStaticPath%, wFiletype%) As Integer
Declare Function DlgDirSelect Lib "User" ( hDlg%, lpString$, nIDListBox%) As Integer
Declare Function DlgDirListComboBox Lib "User" ( hDlg%, lpPathSpec$, nIDComboBox%, nIDStaticPath%, wFileType%) As Integer
Declare Function DlgDirSelectComboBox Lib "User" ( hDlg%, lpString$, nIDComboBox%) As Integer
' Dialog Styles
Const DS_ABSALIGN = &H1
Const DS_SYSMODAL = &H2
Const DS_LOCALEDIT = &H20 ' Edit items get Local storage.
Const DS_SETFONT = &H40 ' User specified font for Dlg controls
Const DS_MODALFRAME = &H80 ' Can be combined with WS_CAPTION
Const DS_NOIDLEMSG = &H100 ' WM_ENTERIDLE message will not be sent
Const DM_GETDEFID = WM_USER+0
Const DM_SETDEFID = WM_USER+1
Const DC_HASDEFID% = &H534 '0x534B
' Dialog Codes
Const DLGC_WANTARROWS = &H1 ' Control wants arrow keys
Const DLGC_WANTTAB = &H2 ' Control wants tab keys
Const DLGC_WANTALLKEYS = &H4 ' Control wants all keys
Const DLGC_WANTMESSAGE = &H4 ' Pass message to control