home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / d / d009_2 / 1.ddi / SAMPLES / WINAPI / WINUSER.IN$ / WINUSER.bin
Encoding:
Text File  |  1992-02-03  |  60.2 KB  |  1,669 lines

  1. '******************************** WINUSER.INC *********************************
  2. 'Demonstrates: Sample Declare, Const, and Type structures for calling the
  3. '              Windows 'User' API routines.
  4. '
  5. 'Required Files: None
  6. '
  7. 'Uses:
  8. '
  9. 'Complexity Level: ADVANCED (Windows programming experience required)
  10. '
  11. 'Notes: This include file correspond to the 'User' section of the Windows SDK
  12. '       'windows.h' C header file.  This include files is provided for those
  13. '       who wish to call Windows API routines from MSTest.  Since this is a
  14. '       large Include file, you may wish to extract only the statements
  15. '       necessary for your particular API call(s).
  16. '
  17. '       NOTE: Some Windows.h struct field names have been changed to avoid
  18. '       conflicts with MSTest reserved words.  These changes are:
  19. '
  20. '       RECT                - left and right are defined as wleft and wright
  21. '       MSG and EVENTMSG    - time is defined as dwtime
  22. '
  23. '******************************************************************************
  24.  
  25. '$IFNDEF WinAPI_GENDefs
  26.     '$DEFINE WinAPI_GENDefs
  27.     '   General Purpose Defines
  28.  
  29.     '  Conditional statement to avoid conflict with FASTTEST's WNAPIDEC.INC
  30.     '$IFNDEF WNAPIDEC
  31.         Type RECT
  32.             wleft As Integer
  33.             top As Integer
  34.             wright As Integer
  35.             bottom As Integer
  36.         End Type
  37.     '$ENDIF
  38.  
  39.     Type POINT
  40.         x As Integer
  41.         y As Integer
  42.     End Type
  43.  
  44. '$ENDIF
  45.  
  46.  
  47. '  Conditional statements to avoid conflict with FASTTEST's WNAPIDEC.INC
  48. '$IFNDEF WNAPIDEC
  49.     '$IFNDEF WINAPI_FIRST
  50.         '$DEFINE WINAPI_FIRST
  51.     '$ENDIF
  52.     '$DEFINE WNAPIDEC
  53. '$ENDIF
  54.  
  55. '$IFDEF WINAPI_FIRST
  56.  
  57.     Declare Sub GetClientRect Lib "User" ( hWnd%, lpRect As RECT)
  58.     Declare Sub GetWindowRect Lib "User" ( hWnd%, lpRect As RECT)
  59.  
  60.     Declare Function SetFocus Lib "User" ( hWnd%) As Integer
  61.     Declare Function GetFocus Lib "User" () As Integer
  62.  
  63.     Declare Function SendMessage Lib "User" ( hWnd%,  wMsg%,  wParam%, lParam As Any) As Long
  64.  
  65.     Declare Function IsZoomed Lib "User" ( hWnd%) As Integer
  66.  
  67.     Declare Function FindWindow Lib "User" (lpClassName As Any, lpWindowName As Any) As Integer
  68.     Declare Function SetActiveWindow Lib "User" ( hWnd%) As Integer
  69.     Declare Function GetActiveWindow Lib "User" () As Integer
  70.     Declare Function GetWindowText Lib "User" ( hWnd%,  lpString$,  nMaxCount%) As Integer
  71.     Declare Function GetDesktopWindow Lib "User" () As Integer
  72.  
  73.     Declare Function ShowWindow Lib "User" ( hWnd%,  nCmdShow%) As Integer
  74.  
  75.     '  ShowWindow() Commands
  76.     Const SW_HIDE = 0
  77.     Const SW_SHOWNORMAL = 1
  78.     Const SW_NORMAL = 1
  79.     Const SW_SHOWMINIMIZED = 2
  80.     Const SW_SHOWMAXIMIZED = 3
  81.     Const SW_MAXIMIZE = 3
  82.     Const SW_SHOWNOACTIVATE = 4
  83.     Const SW_SHOW = 5
  84.     Const SW_MINIMIZE = 6
  85.     Const SW_SHOWMINNOACTIVE = 7
  86.     Const SW_SHOWNA = 8
  87.     Const SW_RESTORE = 9
  88.  
  89.     '  Window Styles
  90.     Const WS_MINIMIZE = &H20000000
  91.     Const WS_MAXIMIZE = &H1000000
  92.  
  93.     Declare Function GetWindowLong Lib "User" ( hWnd%,  nIndex%) As Long
  94.  
  95.     '  Window field offsets for GetWindowLong()
  96.     Const GWL_WNDPROC = (-4)
  97.     Const GWL_STYLE = (-16)
  98.     Const GWL_EXSTYLE = (-20)
  99.  
  100. '$ENDIF
  101.  
  102.  
  103. ' --------------------------------------------------------------------------
  104. '   USER Section
  105. ' --------------------------------------------------------------------------
  106. '$IFNDEF WinUser
  107.     '$DEFINE WinUser
  108.  
  109.     Declare Function wvsprintf Lib "User" ( lpOutput$,  lpFormat$, lpArglist As Any) As Integer
  110.  
  111.     '  Scroll Bar Constants
  112.     Const SB_HORZ = 0
  113.     Const SB_VERT = 1
  114.     Const SB_CTL = 2
  115.     Const SB_BOTH = 3
  116.  
  117.     '  Scroll Bar Commands
  118.     Const SB_LINEUP = 0
  119.     Const SB_LINEDOWN = 1
  120.     Const SB_PAGEUP = 2
  121.     Const SB_PAGEDOWN = 3
  122.     Const SB_THUMBPOSITION = 4
  123.     Const SB_THUMBTRACK = 5
  124.     Const SB_TOP = 6
  125.     Const SB_BOTTOM = 7
  126.     Const SB_ENDSCROLL = 8
  127.  
  128.     '  Old ShowWindow() Commands
  129.     Const HIDE_WINDOW = 0
  130.     Const SHOW_OPENWINDOW = 1
  131.     Const SHOW_ICONWINDOW = 2
  132.     Const SHOW_FULLSCREEN = 3
  133.     Const SHOW_OPENNOACTIVATE = 4
  134.  
  135.     '  Identifiers for the WM_SHOWWINDOW message
  136.     Const SW_PARENTCLOSING = 1
  137.     Const SW_OTHERZOOM = 2
  138.     Const SW_PARENTOPENING = 3
  139.     Const SW_OTHERUNZOOM = 4
  140.  
  141.     '  Region Flags
  142.     Const ERRORAPI = 0
  143.     Const NULLREGION = 1
  144.     Const SIMPLEREGION = 2
  145.     Const COMPLEXREGION = 3
  146.  
  147.     '  CombineRgn() Styles
  148.     Const RGN_AND = 1
  149.     Const RGN_OR = 2
  150.     Const RGN_XOR = 3
  151.     Const RGN_DIFF = 4
  152.     Const RGN_COPY = 5
  153.  
  154.     '  Virtual Keys, Standard Set
  155.     '  Conditional check to avoid duplicate definition in MSTEST.INC
  156.     '$IFNDEF VK_WINAPI
  157.         '$DEFINE VK_WINAPI
  158.         Const VK_LBUTTON = &H1
  159.         Const VK_RBUTTON = &H2
  160.         Const VK_MBUTTON = &H4  '  NOT contiguous with L & RBUTTON
  161.     '$ENDIF
  162.     Const VK_CANCEL = &H3
  163.     Const VK_BACK = &H8
  164.     Const VK_TAB = &H9
  165.     Const VK_CLEAR = &HC
  166.     Const VK_RETURN = &HD
  167.     Const VK_SHIFT = &H10
  168.     Const VK_CONTROL = &H11
  169.     Const VK_MENU = &H12
  170.     Const VK_PAUSE = &H13
  171.     Const VK_CAPITAL = &H14
  172.     Const VK_ESCAPE = &H1B
  173.     Const VK_SPACE = &H20
  174.     Const VK_PRIOR = &H21
  175.     Const VK_NEXT = &H22
  176.     Const VK_END = &H23
  177.     Const VK_HOME = &H24
  178.     Const VK_LEFT = &H25
  179.     Const VK_UP = &H26
  180.     Const VK_RIGHT = &H27
  181.     Const VK_DOWN = &H28
  182.     Const VK_SELECT = &H29
  183.     Const VK_PRINT = &H2A
  184.     Const VK_EXECUTE = &H2B
  185.     Const VK_SNAPSHOT = &H2C
  186.     'Const VK_COPY = &H2C   not used by keyboards.
  187.     Const VK_INSERT = &H2D
  188.     Const VK_DELETE = &H2E
  189.     Const VK_HELP = &H2F
  190.  
  191.     '  VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z'
  192.     '  VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '9'
  193.  
  194.     Const VK_NUMPAD0 = &H60
  195.     Const VK_NUMPAD1 = &H61
  196.     Const VK_NUMPAD2 = &H62
  197.     Const VK_NUMPAD3 = &H63
  198.     Const VK_NUMPAD4 = &H64
  199.     Const VK_NUMPAD5 = &H65
  200.     Const VK_NUMPAD6 = &H66
  201.     Const VK_NUMPAD7 = &H67
  202.     Const VK_NUMPAD8 = &H68
  203.     Const VK_NUMPAD9 = &H69
  204.     Const VK_MULTIPLY = &H6A
  205.     Const VK_ADD = &H6B
  206.     Const VK_SEPARATOR = &H6C
  207.     Const VK_SUBTRACT = &H6D
  208.     Const VK_DECIMAL = &H6E
  209.     Const VK_DIVIDE = &H6F
  210.     Const VK_F1 = &H70
  211.     Const VK_F2 = &H71
  212.     Const VK_F3 = &H72
  213.     Const VK_F4 = &H73
  214.     Const VK_F5 = &H74
  215.     Const VK_F6 = &H75
  216.     Const VK_F7 = &H76
  217.     Const VK_F8 = &H77
  218.     Const VK_F9 = &H78
  219.     Const VK_F10 = &H79
  220.     Const VK_F11 = &H7A
  221.     Const VK_F12 = &H7B
  222.     Const VK_F13 = &H7C
  223.     Const VK_F14 = &H7D
  224.     Const VK_F15 = &H7E
  225.     Const VK_F16 = &H7F
  226.  
  227.     Const VK_NUMLOCK = &H90
  228.  
  229.     '  SetWindowsHook() codes
  230.     Const WH_MSGFILTER = (-1)
  231.     Const WH_JOURNALRECORD = 0
  232.     Const WH_JOURNALPLAYBACK = 1
  233.     Const WH_KEYBOARD = 2
  234.     Const WH_GETMESSAGE = 3
  235.     Const WH_CALLWNDPROC = 4
  236.     Const WH_CBT = 5
  237.     Const WH_SYSMSGFILTER = 6
  238.     Const WH_WINDOWMGR = 7
  239.  
  240.     '  Hook Codes
  241.     Const HC_LPLPFNNEXT = (-2)
  242.     Const HC_LPFNNEXT = (-1)
  243.     Const HC_ACTION = 0
  244.     Const HC_GETNEXT = 1
  245.     Const HC_SKIP = 2
  246.     Const HC_NOREM = 3
  247.     Const HC_NOREMOVE = 3
  248.     Const HC_SYSMODALON = 4
  249.     Const HC_SYSMODALOFF = 5
  250.  
  251.     '  CBT Hook Codes
  252.     Const HCBT_MOVESIZE = 0
  253.     Const HCBT_MINMAX = 1
  254.     Const HCBT_QS = 2
  255.  
  256.     '  WH_MSGFILTER Filter Proc Codes
  257.     Const MSGF_DIALOGBOX = 0
  258.     Const MSGF_MESSAGEBOX = 1
  259.     Const MSGF_MENU = 2
  260.     Const MSGF_MOVE = 3
  261.     Const MSGF_SIZE = 4
  262.     Const MSGF_SCROLLBAR = 5
  263.     Const MSGF_NEXTWINDOW = 6
  264.  
  265.     '  Window Manager Hook Codes
  266.     Const WC_INIT = 1
  267.     Const WC_SWP = 2
  268.     Const WC_DEFWINDOWPROC = 3
  269.     Const WC_MINMAX = 4
  270.     Const WC_MOVE = 5
  271.     Const WC_SIZE = 6
  272.     Const WC_DRAWCAPTION = 7
  273.  
  274.     '  Message Structure used in Journaling
  275.     Type EVENTMSG
  276.         message As Integer
  277.         paramL As Integer
  278.         paramH As Integer
  279.         dwtime As Long          'time is a reserved word in MSTest
  280.     End Type
  281.  
  282.     '  Message structure
  283.     Type MSG
  284.         hwnd As Integer
  285.         message As Integer
  286.         wParam As Integer
  287.         lParam As Long
  288.         dwtime As Long          'time is a reserved word in MSTest
  289.         pt As POINT
  290.     End Type
  291.  
  292.  
  293.     '  Window field offsets for GetWindowWord()
  294.     Const GWW_HINSTANCE = (-6)
  295.     Const GWW_HWNDPARENT = (-8)
  296.     Const GWW_ID = (-12)
  297.  
  298.     '  Class field offsets for GetClassLong() and GetClassWord()
  299.     Const GCL_MENUNAME = (-8)
  300.     Const GCW_HBRBACKGROUND = (-10)
  301.     Const GCW_HCURSOR = (-12)
  302.     Const GCW_HICON = (-14)
  303.     Const GCW_HMODULE = (-16)
  304.     Const GCW_CBWNDEXTRA = (-18)
  305.     Const GCW_CBCLSEXTRA = (-20)
  306.     Const GCL_WNDPROC = (-24)
  307.     Const GCW_STYLE = (-26)
  308.  
  309.     '  Window Messages
  310.     Const WM_NULL = &H0
  311.     Const WM_CREATE = &H1
  312.     Const WM_DESTROY = &H2
  313.     Const WM_MOVE = &H3
  314.     Const WM_SIZE = &H5
  315.     Const WM_ACTIVATE = &H6
  316.     Const WM_SETFOCUS = &H7
  317.     Const WM_KILLFOCUS = &H8
  318.     Const WM_ENABLE = &HA
  319.     Const WM_SETREDRAW = &HB
  320.     Const WM_SETTEXT = &HC
  321.     Const WM_GETTEXT = &HD
  322.     Const WM_GETTEXTLENGTH = &HE
  323.     Const WM_PAINT = &HF
  324.     Const WM_CLOSE = &H10
  325.     Const WM_QUERYENDSESSION = &H11
  326.     Const WM_QUIT = &H12
  327.     Const WM_QUERYOPEN = &H13
  328.     Const WM_ERASEBKGND = &H14
  329.     Const WM_SYSCOLORCHANGE = &H15
  330.     Const WM_ENDSESSION = &H16
  331.     Const WM_SHOWWINDOW = &H18
  332.     Const WM_CTLCOLOR = &H19
  333.     Const WM_WININICHANGE = &H1A
  334.     Const WM_DEVMODECHANGE = &H1B
  335.     Const WM_ACTIVATEAPP = &H1C
  336.     Const WM_FONTCHANGE = &H1D
  337.     Const WM_TIMECHANGE = &H1E
  338.     Const WM_CANCELMODE = &H1F
  339.     Const WM_SETCURSOR = &H20
  340.     Const WM_MOUSEACTIVATE = &H21
  341.     Const WM_CHILDACTIVATE = &H22
  342.     Const WM_QUEUESYNC = &H23
  343.     Const WM_GETMINMAXINFO = &H24
  344.     Const WM_PAINTICON = &H26
  345.     Const WM_ICONERASEBKGND = &H27
  346.     Const WM_NEXTDLGCTL = &H28
  347.     Const WM_SPOOLERSTATUS = &H2A
  348.     Const WM_DRAWITEM = &H2B
  349.     Const WM_MEASUREITEM = &H2C
  350.     Const WM_DELETEITEM = &H2D
  351.     Const WM_VKEYTOITEM = &H2E
  352.     Const WM_CHARTOITEM = &H2F
  353.     Const WM_SETFONT = &H30
  354.     Const WM_GETFONT = &H31
  355.  
  356.     Const WM_QUERYDRAGICON = &H37
  357.  
  358.     Const WM_COMPAREITEM = &H39
  359.     Const WM_COMPACTING = &H41
  360.  
  361.     Const WM_NCCREATE = &H81
  362.     Const WM_NCDESTROY = &H82
  363.     Const WM_NCCALCSIZE = &H83
  364.     Const WM_NCHITTEST = &H84
  365.     Const WM_NCPAINT = &H85
  366.     Const WM_NCACTIVATE = &H86
  367.     Const WM_GETDLGCODE = &H87
  368.     Const WM_NCMOUSEMOVE = &HA0
  369.     Const WM_NCLBUTTONDOWN = &HA1
  370.     Const WM_NCLBUTTONUP = &HA2
  371.     Const WM_NCLBUTTONDBLCLK = &HA3
  372.     Const WM_NCRBUTTONDOWN = &HA4
  373.     Const WM_NCRBUTTONUP = &HA5
  374.     Const WM_NCRBUTTONDBLCLK = &HA6
  375.     Const WM_NCMBUTTONDOWN = &HA7
  376.     Const WM_NCMBUTTONUP = &HA8
  377.     Const WM_NCMBUTTONDBLCLK = &HA9
  378.  
  379.     Const WM_KEYFIRST = &H100
  380.     Const WM_KEYDOWN = &H100
  381.     Const WM_KEYUP = &H101
  382.     Const WM_CHAR = &H102
  383.     Const WM_DEADCHAR = &H103
  384.     Const WM_SYSKEYDOWN = &H104
  385.     Const WM_SYSKEYUP = &H105
  386.     Const WM_SYSCHAR = &H106
  387.     Const WM_SYSDEADCHAR = &H107
  388.     Const WM_KEYLAST = &H108
  389.  
  390.     Const WM_INITDIALOG = &H110
  391.     Const WM_COMMAND = &H111
  392.     Const WM_SYSCOMMAND = &H112
  393.     Const WM_TIMER = &H113
  394.     Const WM_HSCROLL = &H114
  395.     Const WM_VSCROLL = &H115
  396.     Const WM_INITMENU = &H116
  397.     Const WM_INITMENUPOPUP = &H117
  398.     Const WM_MENUSELECT = &H11F
  399.     Const WM_MENUCHAR = &H120
  400.     Const WM_ENTERIDLE = &H121
  401.  
  402.     Const WM_MOUSEFIRST = &H200
  403.     Const WM_MOUSEMOVE = &H200
  404.     Const WM_LBUTTONDOWN = &H201
  405.     Const WM_LBUTTONUP = &H202
  406.     Const WM_LBUTTONDBLCLK = &H203
  407.     Const WM_RBUTTONDOWN = &H204
  408.     Const WM_RBUTTONUP = &H205
  409.     Const WM_RBUTTONDBLCLK = &H206
  410.     Const WM_MBUTTONDOWN = &H207
  411.     Const WM_MBUTTONUP = &H208
  412.     Const WM_MBUTTONDBLCLK = &H209
  413.     Const WM_MOUSELAST = &H209
  414.  
  415.     Const WM_PARENTNOTIFY = &H210
  416.     Const WM_MDICREATE = &H220
  417.     Const WM_MDIDESTROY = &H221
  418.     Const WM_MDIACTIVATE = &H222
  419.     Const WM_MDIRESTORE = &H223
  420.     Const WM_MDINEXT = &H224
  421.     Const WM_MDIMAXIMIZE = &H225
  422.     Const WM_MDITILE = &H226
  423.     Const WM_MDICASCADE = &H227
  424.     Const WM_MDIICONARRANGE = &H228
  425.     Const WM_MDIGETACTIVE = &H229
  426.     Const WM_MDISETMENU = &H230
  427.  
  428.     Const WM_CUT = &H300
  429.     Const WM_COPY = &H301
  430.     Const WM_PASTE = &H302
  431.     Const WM_CLEAR = &H303
  432.     Const WM_UNDO = &H304
  433.     Const WM_RENDERFORMAT = &H305
  434.     Const WM_RENDERALLFORMATS = &H306
  435.     Const WM_DESTROYCLIPBOARD = &H307
  436.     Const WM_DRAWCLIPBOARD = &H308
  437.     Const WM_PAINTCLIPBOARD = &H309
  438.     Const WM_VSCROLLCLIPBOARD = &H30A
  439.     Const WM_SIZECLIPBOARD = &H30B
  440.     Const WM_ASKCBFORMATNAME = &H30C
  441.     Const WM_CHANGECBCHAIN = &H30D
  442.     Const WM_HSCROLLCLIPBOARD = &H30E
  443.     Const WM_QUERYNEWPALETTE = &H30F
  444.     Const WM_PALETTEISCHANGING = &H310
  445.     Const WM_PALETTECHANGED = &H311
  446.  
  447.     '  NOTE: All Message Numbers below 0x0400 are RESERVED.
  448.  
  449.     '  Private Window Messages Start Here:
  450.     '$IFNDEF WinUser-WinCmDlg_DECL
  451.         '$DEFINE WinUser-WinCmDlg_DECL
  452.         Const WM_USER = &H400
  453.     '$ENDIF
  454.  
  455.     '  WM_SYNCTASK Commands
  456.     Const ST_BEGINSWP = 0
  457.     Const ST_ENDSWP = 1
  458.  
  459.     '  WinWhere() Area Codes
  460.     Const HTERROR = (-2)
  461.     Const HTTRANSPARENT = (-1)
  462.     Const HTNOWHERE = 0
  463.     Const HTCLIENT = 1
  464.     Const HTCAPTION = 2
  465.     Const HTSYSMENU = 3
  466.     Const HTGROWBOX = 4
  467.     Const HTSIZE = HTGROWBOX
  468.     Const HTMENU = 5
  469.     Const HTHSCROLL = 6
  470.     Const HTVSCROLL = 7
  471.     Const HTREDUCE = 8
  472.     Const HTZOOM = 9
  473.     Const HTLEFT = 10
  474.     Const HTRIGHT = 11
  475.     Const HTTOP = 12
  476.     Const HTTOPLEFT = 13
  477.     Const HTTOPRIGHT = 14
  478.     Const HTBOTTOM = 15
  479.     Const HTBOTTOMLEFT = 16
  480.     Const HTBOTTOMRIGHT = 17
  481.     Const HTSIZEFIRST = HTLEFT
  482.     Const HTSIZELAST = HTBOTTOMRIGHT
  483.  
  484.     '  WM_MOUSEACTIVATE Return Codes
  485.     Const MA_ACTIVATE = 1
  486.     Const MA_ACTIVATEANDEAT = 2
  487.     Const MA_NOACTIVATE = 3
  488.  
  489.     Declare Function RegisterWindowMessage Lib "User" (lpString$) As Integer
  490.  
  491.     '  Size Message Commands
  492.     Const SIZENORMAL = 0
  493.     Const SIZEICONIC = 1
  494.     Const SIZEFULLSCREEN = 2
  495.     Const SIZEZOOMSHOW = 3
  496.     Const SIZEZOOMHIDE = 4
  497.  
  498.     '  Key State Masks for Mouse Messages
  499.     Const MK_LBUTTON = &H1
  500.     Const MK_RBUTTON = &H2
  501.     Const MK_SHIFT = &H4
  502.     Const MK_CONTROL = &H8
  503.     Const MK_MBUTTON = &H10
  504.  
  505.     '  Window Styles
  506.     Const WS_OVERLAPPED = &H00000
  507.     Const WS_POPUP = &H80000000
  508.     Const WS_CHILD = &H40000000
  509.     Const WS_VISIBLE = &H10000000
  510.     Const WS_DISABLED = &H8000000
  511.     Const WS_CLIPSIBLINGS = &H4000000
  512.     Const WS_CLIPCHILDREN = &H2000000
  513.     Const WS_CAPTION = &HC00000    '  WS_BORDER Or WS_DLGFRAME
  514.     Const WS_BORDER = &H800000
  515.     Const WS_DLGFRAME = &H400000
  516.     Const WS_VSCROLL = &H200000
  517.     Const WS_HSCROLL = &H100000
  518.     Const WS_SYSMENU = &H80000
  519.     Const WS_THICKFRAME = &H40000
  520.     Const WS_GROUP = &H20000
  521.     Const WS_TABSTOP = &H10000
  522.  
  523.     Const WS_MINIMIZEBOX = &H20000
  524.     Const WS_MAXIMIZEBOX = &H10000
  525.  
  526.     Const WS_TILED = WS_OVERLAPPED
  527.     Const WS_ICONIC = WS_MINIMIZE
  528.     Const WS_SIZEBOX = WS_THICKFRAME
  529.  
  530.     '  Common Window Styles
  531.     Const WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)
  532.     Const WS_POPUPWINDOW = (WS_POPUP Or WS_BORDER Or WS_SYSMENU)
  533.     Const WS_CHILDWINDOW = (WS_CHILD)
  534.     Const WS_TILEDWINDOW = (WS_OVERLAPPEDWINDOW)
  535.  
  536.     '  Extended Window Styles
  537.     Const WS_EX_DLGMODALFRAME = &H00001
  538.     Const WS_EX_NOPARENTNOTIFY = &H00004
  539.  
  540.     '  Class styles
  541.     Const CS_VREDRAW = &H1
  542.     Const CS_HREDRAW = &H2
  543.     Const CS_KEYCVTWINDOW = &H4
  544.     Const CS_DBLCLKS = &H8
  545.     Const CS_OWNDC = &H20
  546.     Const CS_CLASSDC = &H40
  547.     Const CS_PARENTDC = &H80
  548.     Const CS_NOKEYCVT = &H100
  549.     Const CS_NOCLOSE = &H200
  550.     Const CS_SAVEBITS = &H800
  551.     Const CS_BYTEALIGNCLIENT = &H1000
  552.     Const CS_BYTEALIGNWINDOW = &H2000
  553.     Const CS_GLOBALCLASS = &H4000   '  Global window class
  554.  
  555.     '  Predefined Clipboard Formats
  556.     Const CF_TEXT = 1
  557.     Const CF_BITMAP = 2
  558.     Const CF_METAFILEPICT = 3
  559.     Const CF_SYLK = 4
  560.     Const CF_DIF = 5
  561.     Const CF_TIFF = 6
  562.     Const CF_OEMTEXT = 7
  563.     Const CF_DIB = 8
  564.     Const CF_PALETTE = 9
  565.  
  566.     Const CF_OWNERDISPLAY = &H80
  567.     Const CF_DSPTEXT = &H81
  568.     Const CF_DSPBITMAP = &H82
  569.     Const CF_DSPMETAFILEPICT = &H83
  570.  
  571.     '  "Private" formats don't get GlobalFree()'d
  572.     Const CF_PRIVATEFIRST = &H200
  573.     Const CF_PRIVATELAST = &H2FF
  574.  
  575.     '  "GDIOBJ" formats do get DeleteObject()'d
  576.     Const CF_GDIOBJFIRST = &H300
  577.     Const CF_GDIOBJLAST = &H3FF
  578.  
  579.     Type PAINTSTRUCT
  580.         hdc As Integer
  581.         fErase As Integer
  582.         rcPaint As RECT
  583.         fRestore As Integer
  584.         fIncUpdate As Integer
  585.         rgbReserved As String * 16
  586.     End Type
  587.  
  588.     Type CREATESTRUCT
  589.         lpCreateParams As Long
  590.         hInstance As Integer
  591.         hMenu As Integer
  592.         hwndParent As Integer
  593.         cy As Integer
  594.         cx As Integer
  595.         y As Integer
  596.         x As Integer
  597.         style As Long
  598.         lpszName As Long        'lpsz Actually LPSTR -
  599.         lpszClass As Long       'change to POINTER TO STRING * n or use lstrcpy
  600.         ExStyle As Long
  601.     End Type
  602.  
  603.     '  Owner draw control types
  604.     Const ODT_MENU = 1
  605.     Const ODT_LISTBOX = 2
  606.     Const ODT_COMBOBOX = 3
  607.     Const ODT_BUTTON = 4
  608.  
  609.     '  Owner draw actions
  610.     Const ODA_DRAWENTIRE = &H1
  611.     Const ODA_SELECT = &H2
  612.     Const ODA_FOCUS = &H4
  613.  
  614.     '  Owner draw state
  615.     Const ODS_SELECTED = &H1
  616.     Const ODS_GRAYED = &H2
  617.     Const ODS_DISABLED = &H4
  618.     Const ODS_CHECKED = &H8
  619.     Const ODS_FOCUS = &H10
  620.  
  621.     '  MEASUREITEMSTRUCT for ownerdraw
  622.     Type MEASUREITEMSTRUCT
  623.         CtlType As Integer
  624.         CtlID As Integer
  625.         itemID As Integer
  626.         itemWidth As Integer
  627.         itemHeight As Integer
  628.         itemData As Long
  629.     End Type
  630.  
  631.     '  DRAWITEMSTRUCT for ownerdraw
  632.     Type DRAWITEMSTRUCT
  633.         CtlType As Integer
  634.         CtlID As Integer
  635.         itemID As Integer
  636.         itemAction As Integer
  637.         itemState As Integer
  638.         hwndItem As Integer
  639.         hDC As Integer
  640.         rcItem As RECT
  641.         itemData As Long
  642.     End Type
  643.  
  644.     '  DELETEITEMSTRUCT for ownerdraw
  645.     Type DELETEITEMSTRUCT
  646.         CtlType As Integer
  647.         CtlID As Integer
  648.         itemID As Integer
  649.         hwndItem As Integer
  650.         itemData As Long
  651.     End Type
  652.  
  653.     '  COMPAREITEMSTRUCT for ownerdraw sorting
  654.     Type COMPAREITEMSTRUCT
  655.         CtlType As Integer
  656.         CtlID As Integer
  657.         hwndItem As Integer
  658.         itemID1 As Integer
  659.         itemData1 As Long
  660.         itemID2 As Integer
  661.         itemData2 As Long
  662.     End Type
  663.  
  664.     '  Message Function Templates
  665.     Declare Function GetMessage Lib "User" (lpMsg As MSG,  hWnd%,  wMsgFilterMin%,  wMsgFilterMax%) As Integer
  666.     Declare Function TranslateMessage Lib "User" (lpMsg As MSG) As Integer
  667.     Declare Function DispatchMessage Lib "User" (lpMsg As MSG) As Long
  668.     Declare Function PeekMessage Lib "User" (lpMsg As MSG,  hWnd%,  wMsgFilterMin%,  wMsgFilterMax%,  wRemoveMsg%) As Integer
  669.  
  670.     '  PeekMessage() Options
  671.     Const PM_NOREMOVE = &H0
  672.     Const PM_REMOVE = &H1
  673.     Const PM_NOYIELD = &H2
  674.  
  675.     Declare Function lstrcmp Lib "User" ( lpString1 As Any,  lpString2 As Any) As Integer
  676.     Declare Function lstrcmpi Lib "User" ( lpString1 As Any,  lpString2 As Any) As Integer
  677.     Declare Function lstrcpy Lib "Kernel" ( lpString1 As Any,  lpString2 As Any) As Long
  678.     Declare Function lstrcat Lib "Kernel" ( lpString1 As Any,  lpString2 As Any) As Long
  679.     Declare Function lstrlen Lib "Kernel" ( lpString As Any) As Integer
  680.  
  681.     Declare Function _lopen Lib "Kernel" ( lpPathName$,  iReadWrite%) As Integer
  682.     Declare Function _lclose Lib "Kernel" ( hFile%) As Integer
  683.     Declare Function _lcreat Lib "Kernel" ( lpPathName$,  iAttribute%) As Integer
  684.     Declare Function _llseek Lib "Kernel" ( hFile%,  lOffset&,  iOrigin%) As Long
  685.     Declare Function _lread Lib "Kernel" ( hFile%,  lpBuffer$,  wBytes%) As Integer
  686.     Declare Function _lwrite Lib "Kernel" ( hFile%,  lpBuffer$,  wBytes%) As Integer
  687.  
  688.     Const READAPI = 0   '  Flags for _lopen
  689.     Const WRITEAPI = 1
  690.     Const READ_WRITE = 2
  691.  
  692.     Declare Function ExitWindows Lib "User" ( dwReserved&, wReturnCode%) As Integer
  693.  
  694.     Declare Function SwapMouseButton Lib "User" ( bSwap%) As Integer
  695.     Declare Function GetMessagePos Lib "User" () As Long
  696.     Declare Function GetMessageTime Lib "User" () As Long
  697.  
  698.     Declare Function GetSysModalWindow Lib "User" () As Integer
  699.     Declare Function SetSysModalWindow Lib "User" ( hWnd%) As Integer
  700.  
  701.     Declare Function PostMessage Lib "User" ( hWnd%,  wMsg%,  wParam%, lParam As Any) As Integer
  702.     Declare Function PostAppMessage Lib "User" ( hTask%,  wMsg%,  wParam%, lParam As Any) As Integer
  703.     Declare Sub ReplyMessage Lib "User" ( lReply&)
  704.     Declare Sub WaitMessage Lib "User" ()
  705.     Declare Function DefWindowProc Lib "User" ( hWnd%,  wMsg%,  wParam%, lParam As Any) As Long
  706.     Declare Sub PostQuitMessage Lib "User" ( nExitCode%)
  707.     Declare Function InSendMessage Lib "User" () As Integer
  708.  
  709.     Declare Function GetDoubleClickTime Lib "User" () As Integer
  710.     Declare Sub SetDoubleClickTime Lib "User" ( wCount%)
  711.  
  712.     Declare Function UnregisterClass Lib "User" ( lpClassName$,  hInstance%) As Integer
  713.  
  714.     Declare Function SetMessageQueue Lib "User" ( cMsg%) As Integer
  715.  
  716.     Const CW_USEDEFAULT = &H8000
  717.  
  718.     Declare Function CreateWindow% Lib "User" ( lpClassName$,  lpWindowName$,  dwStyle&,  X%,  Y%,  nWidth%,  nHeight%,  hWndParent%,  hMenu%,  hInstance%,  lpParam$)
  719.     Declare Function CreateWindowEx% Lib "User" ( dwExStyle&,  lpClassName$,  lpWindowName$,  dwStyle&,  X%,  Y%,  nWidth%,  nHeight%,  hWndParent%,  hMenu%,  hInstance%,  lpParam$)
  720.     Declare Function IsWindow Lib "User" ( hWnd%) As Integer
  721.     Declare Function IsChild Lib "User" ( hWndParent%,  hWnd%) As Integer
  722.     Declare Function DestroyWindow Lib "User" ( hWnd%) As Integer
  723.  
  724.     Declare Function FlashWindow Lib "User" ( hWnd%,  bInvert%) As Integer
  725.     Declare Sub ShowOwnedPopups Lib "User" ( hWnd%,  fShow%)
  726.  
  727.     Declare Function OpenIcon Lib "User" ( hWnd%) As Integer
  728.     Declare Sub CloseWindow Lib "User" ( hWnd%)
  729.     Declare Sub MoveWindow Lib "User" ( hWnd%,  X%,  Y%,  nWidth%,  nHeight%,  bRepaint%)
  730.     Declare Sub SetWindowPos Lib "User" ( hWnd%,  hWndInsertAfter%,  X%,  Y%,  cx%,  cy%,  wFlags%)
  731.  
  732.     Declare Function BeginDeferWindowPos Lib "User" ( nNumWindows%) As Integer
  733.     Declare Function DeferWindowPos Lib "User" ( hWinPosInfo%,  hWnd%,  hWndInsertAfter%,  x%,  y%,  cx%,  cy%,  wFlags%) As Integer
  734.     Declare Sub EndDeferWindowPos Lib "User" ( hWinPosInfo%)
  735.  
  736.     Declare Function IsWindowVisible Lib "User" ( hWnd%) As Integer
  737.     Declare Function IsIconic Lib "User" ( hWnd%) As Integer
  738.     Declare Function AnyPopup Lib "User" () As Integer
  739.     Declare Sub BringWindowToTop Lib "User" ( hWnd%)
  740.  
  741.     '  SetWindowPos Flags
  742.     Const SWP_NOSIZE = &H1
  743.     Const SWP_NOMOVE = &H2
  744.     Const SWP_NOZORDER = &H4
  745.     Const SWP_NOREDRAW = &H8
  746.     Const SWP_NOACTIVATE = &H10
  747.     Const SWP_DRAWFRAME = &H20
  748.     Const SWP_SHOWWINDOW = &H40
  749.     Const SWP_HIDEWINDOW = &H80
  750.     Const SWP_NOCOPYBITS = &H100
  751.     Const SWP_NOREPOSITION = &H200
  752.  
  753.     Declare Sub EndDialog Lib "User" ( hDlg%,  nResult%)
  754.     Declare Function GetDlgItem Lib "User" ( hDlg%,  nIDDlgItem%) As Integer
  755.     Declare Sub SetDlgItemInt Lib "User" ( hDlg%,  nIDDlgItem%,  wValue%,  bSigned%)
  756.     Declare Function GetDlgItemInt Lib "User" ( hDlg%,  nIDDlgItem%, lpTranslated As Any,  bSigned%) As Integer
  757.     Declare Sub SetDlgItemText Lib "User" ( hDlg%,  nIDDlgItem%,  lpString$)
  758.     Declare Function GetDlgItemText Lib "User" ( hDlg%,  nIDDlgItem%,  lpString$,  nMaxCount%) As Integer
  759.     Declare Sub CheckDlgButton Lib "User" ( hDlg%,  nIDButton%,  wCheck%)
  760.     Declare Sub CheckRadioButton Lib "User" ( hDlg%,  nIDFirstButton%,  nIDLastButton%,  nIDCheckButton%)
  761.     Declare Function IsDlgButtonChecked Lib "User" ( hDlg%,  nIDButton%) As Integer
  762.     Declare Function SendDlgItemMessage Lib "User" ( hDlg%,  nIDDlgItem%,  wMsg%,  wParam%, lParam As Any) As Long
  763.     Declare Function GetNextDlgGroupItem Lib "User" ( hDlg%,  hCtl%,  bPrevious%) As Integer
  764.     Declare Function GetNextDlgTabItem Lib "User" ( hDlg%,  hCtl%,  bPrevious%) As Integer
  765.     Declare Function GetDlgCtrlID Lib "User" ( hWnd%) As Integer
  766.     Declare Function GetDialogBaseUnits Lib "User" () As Long
  767.     Declare Function DefDlgProc Lib "User" ( hDlg%,  wMsg%,  wParam%, lParam As Any) As Long
  768.  
  769.     Const DLGWINDOWEXTRA = 30   '  Window extra bytes needed for private dialog classes
  770.  
  771.     Declare Function CallMsgFilter Lib "User" (lpMsg As MSG,  nCode%) As Integer
  772.  
  773.     '  Clipboard Manager Functions
  774.     Declare Function OpenClipboard Lib "User" ( hWnd%) As Integer
  775.     Declare Function CloseClipboard Lib "User" () As Integer
  776.     Declare Function GetClipboardOwner Lib "User" () As Integer
  777.     Declare Function SetClipboardViewer Lib "User" ( hWnd%) As Integer
  778.     Declare Function GetClipboardViewer Lib "User" () As Integer
  779.     Declare Function ChangeClipboardChain Lib "User" ( hWnd%,  hWndNext%) As Integer
  780.     Declare Function SetClipboardData Lib "User" ( wFormat%,  hMem%) As Integer
  781.     Declare Function GetClipboardData Lib "User" ( wFormat%) As Integer
  782.     Declare Function RegisterClipboardFormat Lib "User" ( lpFormatName$) As Integer
  783.     Declare Function CountClipboardFormats Lib "User" () As Integer
  784.     Declare Function EnumClipboardFormats Lib "User" ( wFormat%) As Integer
  785.     Declare Function GetClipboardFormatName Lib "User" ( wFormat%,  lpFormatName$,  nMaxCount%) As Integer
  786.     Declare Function EmptyClipboard Lib "User" () As Integer
  787.     Declare Function IsClipboardFormatAvailable Lib "User" ( wFormat%) As Integer
  788.     Declare Function GetPriorityClipboardFormat Lib "User" (lpPriorityList As Any,  nCount%) As Integer
  789.  
  790.     Declare Function GetKeyState Lib "User" ( nVirtKey%) As Integer
  791.     Declare Function GetAsyncKeyState Lib "User" ( vKey%) As Integer
  792.     Declare Sub GetKeyboardState Lib "User" (LpKeyState As Any)
  793.     Declare Sub SetKeyboardState Lib "User" (lpKeyState As Any)
  794.     Declare Function EnableHardwareInput Lib "User" ( bEnableInput%) As Integer
  795.     Declare Function GetInputState Lib "User" () As Integer
  796.     Declare Function GetCapture Lib "User" () As Integer
  797.     Declare Function SetCapture Lib "User" ( hWnd%) As Integer
  798.     Declare Sub ReleaseCapture Lib "User" ()
  799.  
  800.     '  Windows Functions
  801.     Declare Function KillTimer Lib "User" ( hWnd%,  nIDEvent%) As Integer
  802.  
  803.     Declare Function EnableWindow Lib "User" ( hWnd%,  bEnable%) As Integer
  804.     Declare Function IsWindowEnabled Lib "User" ( hWnd%) As Integer
  805.  
  806.     Declare Function LoadAccelerators Lib "User" ( hInstance%,  lpTableName$) As Integer
  807.  
  808.     Declare Function TranslateAccelerator Lib "User" ( hWnd%,  hAccTable%, lpMsg As MSG) As Integer
  809.  
  810.  
  811.     '  GetSystemMetrics() codes
  812.     Const SM_CXSCREEN = 0
  813.     Const SM_CYSCREEN = 1
  814.     Const SM_CXVSCROLL = 2
  815.     Const SM_CYHSCROLL = 3
  816.     Const SM_CYCAPTION = 4
  817.     Const SM_CXBORDER = 5
  818.     Const SM_CYBORDER = 6
  819.     Const SM_CXDLGFRAME = 7
  820.     Const SM_CYDLGFRAME = 8
  821.     Const SM_CYVTHUMB = 9
  822.     Const SM_CXHTHUMB = 10
  823.     Const SM_CXICON = 11
  824.     Const SM_CYICON = 12
  825.     Const SM_CXCURSOR = 13
  826.     Const SM_CYCURSOR = 14
  827.     Const SM_CYMENU = 15
  828.     Const SM_CXFULLSCREEN = 16
  829.     Const SM_CYFULLSCREEN = 17
  830.     Const SM_CYKANJIWINDOW = 18
  831.     Const SM_MOUSEPRESENT = 19
  832.     Const SM_CYVSCROLL = 20
  833.     Const SM_CXHSCROLL = 21
  834.     Const SM_DEBUG = 22
  835.     Const SM_SWAPBUTTON = 23
  836.     Const SM_RESERVED1 = 24
  837.     Const SM_RESERVED2 = 25
  838.     Const SM_RESERVED3 = 26
  839.     Const SM_RESERVED4 = 27
  840.     Const SM_CXMIN = 28
  841.     Const SM_CYMIN = 29
  842.     Const SM_CXSIZE = 30
  843.     Const SM_CYSIZE = 31
  844.     Const SM_CXFRAME = 32
  845.     Const SM_CYFRAME = 33
  846.     Const SM_CXMINTRACK = 34
  847.     Const SM_CYMINTRACK = 35
  848.     Const SM_CMETRICS = 36
  849.  
  850.     Declare Function GetSystemMetrics Lib "User" ( nIndex%) As Integer
  851.  
  852.     Type MENUITEMTEMPLATE
  853.         mtOption As Integer
  854.         mtID As Integer
  855.         mtString As Long        'Actually LPSTR -
  856.     End Type                    'Change to POINTER TO STRING * n or use lstrcpy
  857.  
  858.     Declare Function LoadMenu Lib "User" ( hInstance%,  lpMenuName$) As Integer
  859.     Declare Function LoadMenuIndirect Lib "User" (lpMenuTemplate As Any) As Integer
  860.     Declare Function GetMenu Lib "User" ( hWnd%) As Integer
  861.     Declare Function SetMenu Lib "User" ( hWnd%,  hMenu%) As Integer
  862.     Declare Function ChangeMenu Lib "User" ( hMenu%,  wID%,  lpszNew$,  wIDNew%,  wChange%) As Integer
  863.     Declare Function HiliteMenuItem Lib "User" ( hWnd%,  hMenu%,  wIDHiliteItem%,  wHilite%) As Integer
  864.     Declare Function GetMenuString Lib "User" ( hMenu%,  wIDItem%,  lpString$,  nMaxCount%,  wFlag%) As Integer
  865.     Declare Function GetMenuState Lib "User" ( hMenu%,  wId%,  wFlags%) As Integer
  866.     Declare Sub DrawMenuBar Lib "User" ( hWnd%)
  867.     Declare Function GetSystemMenu Lib "User" ( hWnd%,  bRevert%) As Integer
  868.     Declare Function CreateMenu Lib "User" () As Integer
  869.     Declare Function CreatePopupMenu Lib "User" () As Integer
  870.     Declare Function DestroyMenu Lib "User" ( hMenu%) As Integer
  871.     Declare Function CheckMenuItem Lib "User" ( hMenu%,  wIDCheckItem%,  wCheck%) As Integer
  872.     Declare Function EnableMenuItem Lib "User" ( hMenu%,  wIDEnableItem%,  wEnable%) As Integer
  873.     Declare Function GetSubMenu Lib "User" ( hMenu%,  nPos%) As Integer
  874.     Declare Function GetMenuItemID Lib "User" ( hMenu%,  nPos%) As Integer
  875.     Declare Function GetMenuItemCount Lib "User" ( hMenu%) As Integer
  876.  
  877.     Declare Function InsertMenu Lib "User" ( hMenu%,  nPosition%,  wFlags%,  wIDNewItem%,  lpNewItem As Any) As Integer
  878.     Declare Function AppendMenu Lib "User" ( hMenu%,  wFlags%,  wIDNewItem%,  lpNewItem As Any) As Integer
  879.     Declare Function ModifyMenu Lib "User" ( hMenu%,  nPosition%,  wFlags%,  wIDNewItem%,  lpNewItem As Any) As Integer
  880.     Declare Function RemoveMenu Lib "User" ( hMenu%,  nPosition%,  wFlags%) As Integer
  881.     Declare Function DeleteMenu Lib "User" ( hMenu%,  nPosition%,  wFlags%) As Integer
  882.     Declare Function SetMenuItemBitmaps Lib "User" ( hMenu%,  nPosition%,  wFlags%,  hBitmapUnchecked%,  hBitmapChecked%) As Integer
  883.     Declare Function GetMenuCheckMarkDimensions Lib "User" () As Long
  884.     Declare Function TrackPopupMenu Lib "User" ( hMenu%,  wFlags%,  x%,  y%,  nReserved%,  hWnd%, lpReserved As Any) As Integer
  885.  
  886.     Declare Sub UpdateWindow Lib "User" ( hWnd%)
  887.  
  888.     Declare Function BeginPaint Lib "User" ( hWnd%, lpPaint As PAINTSTRUCT) As Integer
  889.     Declare Sub EndPaint Lib "User" ( hWnd%, lpPaint As PAINTSTRUCT)
  890.     Declare Function GetUpdateRect Lib "User" ( hWnd%, lpRect As RECT,  bErase%) As Integer
  891.     Declare Function GetUpdateRgn Lib "User" ( hWnd%,  hRgn%,  fErase%) As Integer
  892.  
  893.     Declare Function ExcludeUpdateRgn Lib "User" ( hDC%,  hWnd%) As Integer
  894.  
  895.     Declare Sub InvalidateRect Lib "User" ( hWnd%, lpRect As RECT,  bErase%)
  896.     Declare Sub ValidateRect Lib "User" ( hWnd%, lpRect As RECT)
  897.  
  898.     Declare Sub InvalidateRgn Lib "User" ( hWnd%,  hRgn%,  bErase%)
  899.     Declare Sub ValidateRgn Lib "User" ( hWnd%,  hRgn%)
  900.  
  901.     Declare Sub ScrollWindow Lib "User" ( hWnd%,  XAmount%,  YAmount%, lpRect As RECT, lpClipRect As RECT)
  902.     Declare Function ScrollDC Lib "User" ( hDC%,  dx%,  dy%, lprcScroll As RECT, lprcClip As RECT,  hRgnUpdate%, lprcUpdate As RECT) As Integer
  903.  
  904.     Declare Function SetScrollPos Lib "User" ( hWnd%,  nBar%,  nPos%,  bRedraw%) As Integer
  905.     Declare Function GetScrollPos Lib "User" ( hWnd%,  nBar%) As Integer
  906.     Declare Sub SetScrollRange Lib "User" ( hWnd%,  nBar%,  nMinPos%,  nMaxPos%,  bRedraw%)
  907.     Declare Sub GetScrollRange Lib "User" ( hWnd%,  nBar%, lpMinPos As Pointer To Integer, lpMaxPos As Pointer To Integer)
  908.     Declare Sub ShowScrollBar Lib "User" ( hWnd%,  wBar%,  bShow%)
  909.  
  910.     Declare Function SetProp Lib "User" ( hWnd%,  lpString As Any,  hData%) As Integer
  911.     Declare Function GetProp Lib "User" ( hWnd%,  lpString As Any) As Integer
  912.     Declare Function RemoveProp Lib "User" ( hWnd%,  lpString As Any) As Integer
  913.     Declare Sub SetWindowText Lib "User" ( hWnd%,  lpString$)
  914.     Declare Function GetWindowTextLength Lib "User" ( hWnd%) As Integer
  915.  
  916.     Declare Sub AdjustWindowRect Lib "User" (lpRect As RECT,  dwStyle&,  bMenu%)
  917.     Declare Sub AdjustWindowRectEx Lib "User" (lpRect As RECT,  dwStyle&,  bMenu%,  dwExStyle&)
  918.  
  919.  
  920.     '  MessageBox() Flags
  921.     Const MB_OK = &H0
  922.     Const MB_OKCANCEL = &H1
  923.     Const MB_ABORTRETRYIGNORE = &H2
  924.     Const MB_YESNOCANCEL = &H3
  925.     Const MB_YESNO = &H4
  926.     Const MB_RETRYCANCEL = &H5
  927.  
  928.     Const MB_ICONHAND = &H10
  929.     Const MB_ICONQUESTION = &H20
  930.     Const MB_ICONEXCLAMATION = &H30
  931.     Const MB_ICONASTERISK = &H40
  932.  
  933.     Const MB_ICONINFORMATION = MB_ICONASTERISK
  934.     Const MB_ICONSTOP = MB_ICONHAND
  935.  
  936.     Const MB_DEFBUTTON1 = &H0
  937.     Const MB_DEFBUTTON2 = &H100
  938.     Const MB_DEFBUTTON3 = &H200
  939.  
  940.     Const MB_APPLMODAL = &H0
  941.     Const MB_SYSTEMMODAL = &H1000
  942.     Const MB_TASKMODAL = &H2000
  943.  
  944.     Const MB_NOFOCUS = &H8000
  945.  
  946.     Const MB_TYPEMASK = &HF
  947.     Const MB_ICONMASK = &HF0
  948.     Const MB_DEFMASK = &HF00
  949.     Const MB_MODEMASK = &H3000
  950.     Const MB_MISCMASK = &HC000
  951.  
  952.     Declare Function MessageBox Lib "User" ( hWndParent%,  lpText$,  lpCaption$,  wType%) As Integer
  953.     Declare Sub MessageBeep Lib "User" ( wType%)
  954.  
  955.     Declare Function ShowCursor Lib "User" ( bShow%) As Integer
  956.     Declare Sub SetCursorPos Lib "User" ( X%,  Y%)
  957.     Declare Function SetCursor Lib "User" ( hCursor%) As Integer
  958.     Declare Sub GetCursorPos Lib "User" (lpPoint As POINT)
  959.     Declare Sub ClipCursor Lib "User" (lpRect As RECT)
  960.  
  961.     Declare Sub CreateCaret Lib "User" ( hWnd%,  hBitmap%,  nWidth%,  nHeight%)
  962.     Declare Function GetCaretBlinkTime Lib "User" () As Integer
  963.     Declare Sub SetCaretBlinkTime Lib "User" ( wMSeconds%)
  964.     Declare Sub DestroyCaret Lib "User" ()
  965.     Declare Sub HideCaret Lib "User" ( hWnd%)
  966.     Declare Sub ShowCaret Lib "User" ( hWnd%)
  967.     Declare Sub SetCaretPos Lib "User" ( X%,  Y%)
  968.     Declare Sub GetCaretPos Lib "User" (lpPoint As POINT)
  969.  
  970.     Declare Sub ClientToScreen Lib "User" ( hWnd%, lpPoint As POINT)
  971.     Declare Sub ScreenToClient Lib "User" ( hWnd%, lpPoint As POINT)
  972.  
  973.     '  WindowFromPoint and ChildWindowFromPoint expect a POINT structure
  974.     '  passed by value - MSTest will not pass a TYPE structure by value
  975.     '  so the two integer parameters listed below are a work around.
  976.     Declare Function WindowFromPoint Lib "User" (y%,x%) As Integer
  977.     Declare Function ChildWindowFromPoint Lib "User" ( hWnd%,  y%, x%) As Integer
  978.  
  979.  
  980.     '  Color Types
  981.     Const CTLCOLOR_MSGBOX = 0
  982.     Const CTLCOLOR_EDIT = 1
  983.     Const CTLCOLOR_LISTBOX = 2
  984.     Const CTLCOLOR_BTN = 3
  985.     Const CTLCOLOR_DLG = 4
  986.     Const CTLCOLOR_SCROLLBAR = 5
  987.     Const CTLCOLOR_STATIC = 6
  988.     Const CTLCOLOR_MAX = 8  '  three bits max
  989.  
  990.     Const COLOR_SCROLLBAR = 0
  991.     Const COLOR_BACKGROUND = 1
  992.     Const COLOR_ACTIVECAPTION = 2
  993.     Const COLOR_INACTIVECAPTION = 3
  994.     Const COLOR_MENU = 4
  995.     Const COLOR_WINDOW = 5
  996.     Const COLOR_WINDOWFRAME = 6
  997.     Const COLOR_MENUTEXT = 7
  998.     Const COLOR_WINDOWTEXT = 8
  999.     Const COLOR_CAPTIONTEXT = 9
  1000.     Const COLOR_ACTIVEBORDER = 10
  1001.     Const COLOR_INACTIVEBORDER = 11
  1002.     Const COLOR_APPWORKSPACE = 12
  1003.     Const COLOR_HIGHLIGHT = 13
  1004.     Const COLOR_HIGHLIGHTTEXT = 14
  1005.     Const COLOR_BTNFACE = 15
  1006.     Const COLOR_BTNSHADOW = 16
  1007.     Const COLOR_GRAYTEXT = 17
  1008.     Const COLOR_BTNTEXT = 18
  1009.     Const COLOR_ENDCOLORS = COLOR_BTNTEXT
  1010.  
  1011.     Declare Function GetSysColor Lib "User" ( nIndex%) As Long
  1012.     Declare Sub SetSysColors Lib "User" ( nChanges%, lpSysColor As Pointer To Integer, lpColorValues As Pointer To Long)
  1013.  
  1014.     Declare Function FillRgn Lib "User" ( hDC%,  hRgn%,  hBrush%) As Integer
  1015.     Declare Function FrameRgn Lib "User" ( hDC%,  hRgn%,  hBrush%,  nWidth%,  nHeight%) As Integer
  1016.     Declare Function InvertRgn Lib "User" ( hDC%,  hRgn%) As Integer
  1017.     Declare Function PaintRgn Lib "User" ( hDC%,  hRgn%) As Integer
  1018.     Declare Function PtInRegion Lib "User" ( hRgn%,  X%,  Y%) As Integer
  1019.  
  1020.     Declare Sub DrawFocusRect Lib "User" ( hDC%, lpRect As RECT)
  1021.     Declare Function FillRect Lib "User" ( hDC%, lpRect As RECT,  hBrush%) As Integer
  1022.     Declare Function FrameRect Lib "User" ( hDC%, lpRect As RECT,  hBrush%) As Integer
  1023.     Declare Sub InvertRect Lib "User" ( hDC%, lpRect As RECT)
  1024.     Declare Sub SetRect Lib "User" (lpRect As RECT,  X1%,  Y1%,  X2%,  Y2%)
  1025.     Declare Sub SetRectEmpty Lib "User" (lpRect As RECT)
  1026.     Declare Function CopyRect Lib "User" (lpDestRect As RECT, lpSourceRect As RECT) As Integer
  1027.     Declare Sub InflateRect Lib "User" (lpRect As RECT,  X%,  Y%)
  1028.     Declare Function IntersectRect Lib "User" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Integer
  1029.     Declare Function UnionRect Lib "User" (lpDestRect As RECT, lpSrc1Rect As RECT, lpSrc2Rect As RECT) As Integer
  1030.     Declare Sub OffsetRect Lib "User" (lpRect As RECT,  X%,  Y%)
  1031.     Declare Function IsRectEmpty Lib "User" (lpRect As RECT) As Integer
  1032.     Declare Function EqualRect Lib "User" (lpRect1 As RECT, lpRect2 As RECT) As Integer
  1033.  
  1034.     '  PtInRect also requires a TYPE passed by value - work around with two integers
  1035.     Declare Function PtInRect Lib "User" (lpRect As RECT,  y%, x%) As Integer
  1036.  
  1037.     Declare Function RectVisible Lib "User" ( hDC%, lpRect As RECT) As Integer
  1038.     Declare Function RectInRegion Lib "User" ( hRgn%, lpRect As RECT) As Integer
  1039.  
  1040.     Declare Function GetCurrentTime Lib "User" () As Long
  1041.     Declare Function GetTickCount Lib "User" () As Long
  1042.  
  1043.     Declare Function GetWindowWord Lib "User" ( hWnd%,  nIndex%) As Integer
  1044.     Declare Function SetWindowWord Lib "User" ( hWnd%,  nIndex%,  wNewWord%) As Integer
  1045.     Declare Function SetWindowLong Lib "User" ( hWnd%,  nIndex%,  dwNewLong&) As Long
  1046.     Declare Function GetClassWord Lib "User" ( hWnd%,  nIndex%) As Integer
  1047.     Declare Function SetClassWord Lib "User" ( hWnd%,  nIndex%,  wNewWord%) As Integer
  1048.     Declare Function GetClassLong Lib "User" ( hWnd%,  nIndex%) As Long
  1049.     Declare Function SetClassLong Lib "User" ( hWnd%,  nIndex%,  dwNewLong&) As Long
  1050.     Declare Function GetDesktopHwnd Lib "User" () As Integer
  1051.  
  1052.  
  1053.     Declare Function GetParent Lib "User" ( hWnd%) As Integer
  1054.     Declare Function SetParent Lib "User" ( hWndChild%,  hWndNewParent%) As Integer
  1055.     Declare Function GetClassName Lib "User" ( hWnd%,  lpClassName$,  nMaxCount%) As Integer
  1056.     Declare Function GetTopWindow Lib "User" ( hWnd%) As Integer
  1057.     Declare Function GetNextWindow Lib "User" ( hWnd%,  wFlag%) As Integer
  1058.     Declare Function GetWindowTask Lib "User" ( hWnd%) As Integer
  1059.     Declare Function GetLastActivePopup Lib "User" ( hwndOwnder%) As Integer
  1060.  
  1061.     '  GetWindow() Constants
  1062.     Const GW_HWNDFIRST = 0
  1063.     Const GW_HWNDLAST = 1
  1064.     Const GW_HWNDNEXT = 2
  1065.     Const GW_HWNDPREV = 3
  1066.     Const GW_OWNER = 4
  1067.     Const GW_CHILD = 5
  1068.  
  1069.     Declare Function GetWindow Lib "User" ( hWnd%,  wCmd%) As Integer
  1070.  
  1071.     '  Menu flags for Add/Check/EnableMenuItem()
  1072.     Const MF_INSERT = &H0
  1073.     Const MF_CHANGE = &H80
  1074.     Const MF_APPEND = &H100
  1075.     Const MF_DELETE = &H200
  1076.     Const MF_REMOVE = &H1000
  1077.  
  1078.     Const MF_BYCOMMAND = &H0
  1079.     Const MF_BYPOSITION = &H400
  1080.  
  1081.     Const MF_SEPARATOR = &H800
  1082.  
  1083.     Const MF_ENABLED = &H0
  1084.     Const MF_GRAYED = &H1
  1085.     Const MF_DISABLED = &H2
  1086.  
  1087.     Const MF_UNCHECKED = &H0
  1088.     Const MF_CHECKED = &H8
  1089.     Const MF_USECHECKBITMAPS = &H200
  1090.  
  1091.     Const MF_STRING = &H0
  1092.     Const MF_BITMAP = &H4
  1093.     Const MF_OWNERDRAW = &H100
  1094.  
  1095.     Const MF_POPUP = &H10
  1096.     Const MF_MENUBARBREAK = &H20
  1097.     Const MF_MENUBREAK = &H40
  1098.  
  1099.     Const MF_UNHILITE = &H0
  1100.     Const MF_HILITE = &H80
  1101.  
  1102.     Const MF_SYSMENU = &H2000
  1103.     Const MF_HELP = &H4000
  1104.     Const MF_MOUSESELECT = &H8000
  1105.  
  1106.     '  Menu item resource format
  1107.     Type MENUITEMTEMPLATEHEADER
  1108.         versionNumber As Integer
  1109.         offset As Integer
  1110.     End Type
  1111.  
  1112.  
  1113.     Const MF_END = &H80
  1114.  
  1115.     '  System Menu Command Values
  1116.     Const SC_SIZE = &HF000
  1117.     Const SC_MOVE = &HF010
  1118.     Const SC_MINIMIZE = &HF020
  1119.     Const SC_MAXIMIZE = &HF030
  1120.     Const SC_NEXTWINDOW = &HF040
  1121.     Const SC_PREVWINDOW = &HF050
  1122.     Const SC_CLOSE = &HF060
  1123.     Const SC_VSCROLL = &HF070
  1124.     Const SC_HSCROLL = &HF080
  1125.     Const SC_MOUSEMENU = &HF090
  1126.     Const SC_KEYMENU = &HF100
  1127.     Const SC_ARRANGE = &HF110
  1128.     Const SC_RESTORE = &HF120
  1129.     Const SC_TASKLIST = &HF130
  1130.  
  1131.     Const SC_ICON = SC_MINIMIZE
  1132.     Const SC_ZOOM = SC_MAXIMIZE
  1133.  
  1134.     '  Resource Loading Routines
  1135.     Declare Function LoadBitmap Lib "User" ( hInstance%,  lpBitmapName As Any) As Integer
  1136.     Declare Function LoadCursor Lib "User" ( hInstance%,  lpCursorName As Any) As Integer
  1137.     Declare Function CreateCursor Lib "User" ( hInstance%,  nXhotspot%,  nYhotspot%,  nWidth%,  nHeight%,  lpANDbitPlane As Any,  lpXORbitPlane As Any) As Integer
  1138.     Declare Function DestroyCursor Lib "User" ( hCursor%) As Integer
  1139.  
  1140.     '  Standard Cursor IDs
  1141.     Const IDC_ARROW = 32512
  1142.     Const IDC_IBEAM = 32513
  1143.     Const IDC_WAIT = 32514
  1144.     Const IDC_CROSS = 32515
  1145.     Const IDC_UPARROW = 32516
  1146.     Const IDC_SIZE = 32640
  1147.     Const IDC_ICON = 32641
  1148.     Const IDC_SIZENWSE = 32642
  1149.     Const IDC_SIZENESW = 32643
  1150.     Const IDC_SIZEWE = 32644
  1151.     Const IDC_SIZENS = 32645
  1152.  
  1153.     Declare Function LoadIcon Lib "User" ( hInstance%,  lpIconName As Any) As Integer
  1154.     Declare Function CreateIcon Lib "User" ( hInstance%,  nWidth%,  nHeight%,  nPlanes%,  nBitsPixel%,  lpANDbits As Any,  lpXORbits As Any) As Integer
  1155.     Declare Function DestroyIcon Lib "User" ( hIcon%) As Integer
  1156.  
  1157.  
  1158.     Const ORD_LANGDRIVER = 1    '  The ordinal number for the entry point of
  1159.                                 '  language drivers.
  1160.  
  1161.     '  Standard Icon IDs
  1162.     Const IDI_APPLICATION = 32512
  1163.     Const IDI_HAND = 32513
  1164.     Const IDI_QUESTION = 32514
  1165.     Const IDI_EXCLAMATION = 32515
  1166.     Const IDI_ASTERISK = 32516
  1167.  
  1168.     Declare Function LoadString Lib "User" ( hInstance%,  wID%,  lpBuffer As Any,  nBufferMax%) As Integer
  1169.  
  1170.     Declare Function AddFontResource Lib "GDI" ( lpFilename As Any) As Integer
  1171.     Declare Function RemoveFontResource Lib "GDI" ( lpFilename As Any) As Integer
  1172.  
  1173.     '  Dialog Box Command IDs
  1174.     Const IDOK = 1
  1175.     Const IDCANCEL = 2
  1176.     Const IDABORT = 3
  1177.     Const IDRETRY = 4
  1178.     Const IDIGNORE = 5
  1179.     Const IDYES = 6
  1180.     Const IDNO = 7
  1181.  
  1182.  
  1183.     '  Control Manager Structures and Definitions
  1184.  
  1185.     '  Edit Control Styles
  1186.     Const ES_LEFT = &H0
  1187.     Const ES_CENTER = &H1
  1188.     Const ES_RIGHT = &H2
  1189.     Const ES_MULTILINE = &H4
  1190.     Const ES_UPPERCASE = &H8
  1191.     Const ES_LOWERCASE = &H10
  1192.     Const ES_PASSWORD = &H20
  1193.     Const ES_AUTOVSCROLL = &H40
  1194.     Const ES_AUTOHSCROLL = &H80
  1195.     Const ES_NOHIDESEL = &H100
  1196.     Const ES_OEMCONVERT = &H400
  1197.  
  1198.     '  Edit Control Notification Codes
  1199.     Const EN_SETFOCUS = &H100
  1200.     Const EN_KILLFOCUS = &H200
  1201.     Const EN_CHANGE = &H300
  1202.     Const EN_UPDATE = &H400
  1203.     Const EN_ERRSPACE = &H500
  1204.     Const EN_MAXTEXT = &H501
  1205.     Const EN_HSCROLL = &H601
  1206.     Const EN_VSCROLL = &H602
  1207.  
  1208.     '  Edit Control Messages
  1209.     Const EM_GETSEL = WM_USER+0
  1210.     Const EM_SETSEL = WM_USER+1
  1211.     Const EM_GETRECT = WM_USER+2
  1212.     Const EM_SETRECT = WM_USER+3
  1213.     Const EM_SETRECTNP = WM_USER+4
  1214.     Const EM_SCROLL = WM_USER+5
  1215.     Const EM_LINESCROLL = WM_USER+6
  1216.     Const EM_GETMODIFY = WM_USER+7
  1217.     Const EM_SETMODIFY = WM_USER+8
  1218.     Const EM_GETLINECOUNT = WM_USER+9
  1219.     Const EM_LINEINDEX = WM_USER+10
  1220.     Const EM_SETHANDLE = WM_USER+12
  1221.     Const EM_GETHANDLE = WM_USER+13
  1222.     Const EM_GETTHUMB = WM_USER+14
  1223.     Const EM_LINELENGTH = WM_USER+17
  1224.     Const EM_REPLACESEL = WM_USER+18
  1225.     Const EM_SETFONT = WM_USER+19
  1226.     Const EM_GETLINE = WM_USER+20
  1227.     Const EM_LIMITTEXT = WM_USER+21
  1228.     Const EM_CANUNDO = WM_USER+22
  1229.     Const EM_UNDO = WM_USER+23
  1230.     Const EM_FMTLINES = WM_USER+24
  1231.     Const EM_LINEFROMCHAR = WM_USER+25
  1232.     Const EM_SETWORDBREAK = WM_USER+26
  1233.     Const EM_SETTABSTOPS = WM_USER+27
  1234.     Const EM_SETPASSWORDCHAR = WM_USER+28
  1235.     Const EM_EMPTYUNDOBUFFER = WM_USER+29
  1236.     Const EM_MSGMAX = WM_USER+30
  1237.  
  1238.     '  Button Control Styles
  1239.     Const BS_PUSHBUTTON = &H0
  1240.     Const BS_DEFPUSHBUTTON = &H1
  1241.     Const BS_CHECKBOX = &H2
  1242.     Const BS_AUTOCHECKBOX = &H3
  1243.     Const BS_RADIOBUTTON = &H4
  1244.     Const BS_3STATE = &H5
  1245.     Const BS_AUTO3STATE = &H6
  1246.     Const BS_GROUPBOX = &H7
  1247.     Const BS_USERBUTTON = &H8
  1248.     Const BS_AUTORADIOBUTTON = &H9
  1249.     Const BS_PUSHBOX = &HA
  1250.     Const BS_OWNERDRAW = &HB
  1251.     Const BS_LEFTTEXT = &H20
  1252.  
  1253.     '  User Button Notification Codes
  1254.     Const BN_CLICKED = 0
  1255.     Const BN_PAINT = 1
  1256.     Const BN_HILITE = 2
  1257.     Const BN_UNHILITE = 3
  1258.     Const BN_DISABLE = 4
  1259.     Const BN_DOUBLECLICKED = 5
  1260.  
  1261.     '  Button Control Messages
  1262.     Const BM_GETCHECK = WM_USER+0
  1263.     Const BM_SETCHECK = WM_USER+1
  1264.     Const BM_GETSTATE = WM_USER+2
  1265.     Const BM_SETSTATE = WM_USER+3
  1266.     Const BM_SETSTYLE = WM_USER+4
  1267.  
  1268.     '  Static Control Constants
  1269.     Const SS_LEFT = &H0
  1270.     Const SS_CENTER = &H1
  1271.     Const SS_RIGHT = &H2
  1272.     Const SS_ICON = &H3
  1273.     Const SS_BLACKRECT = &H4
  1274.     Const SS_GRAYRECT = &H5
  1275.     Const SS_WHITERECT = &H6
  1276.     Const SS_BLACKFRAME = &H7
  1277.     Const SS_GRAYFRAME = &H8
  1278.     Const SS_WHITEFRAME = &H9
  1279.     Const SS_USERITEM = &HA
  1280.     Const SS_SIMPLE = &HB
  1281.     Const SS_LEFTNOWORDWRAP = &HC
  1282.     Const SS_NOPREFIX = &H80   '  Don't do "&" character translation
  1283.  
  1284.     '  Dialog Manager Routines
  1285.     Declare Function IsDialogMessage Lib "User" ( hDlg%, lpMsg As MSG) As Integer
  1286.  
  1287.     Declare Sub MapDialogRect Lib "User" ( hDlg%, lpRect As RECT)
  1288.  
  1289.     Declare Function DlgDirList Lib "User" ( hDlg%,  lpPathSpec$,  nIDListBox%,  nIDStaticPath%,  wFiletype%) As Integer
  1290.     Declare Function DlgDirSelect Lib "User" ( hDlg%,  lpString$,  nIDListBox%) As Integer
  1291.     Declare Function DlgDirListComboBox Lib "User" ( hDlg%,  lpPathSpec$,  nIDComboBox%,  nIDStaticPath%,  wFileType%) As Integer
  1292.     Declare Function DlgDirSelectComboBox Lib "User" ( hDlg%,  lpString$,  nIDComboBox%) As Integer
  1293.  
  1294.     '  Dialog Styles
  1295.     Const DS_ABSALIGN = &H1
  1296.     Const DS_SYSMODAL = &H2
  1297.     Const DS_LOCALEDIT = &H20  '  Edit items get Local storage.
  1298.     Const DS_SETFONT = &H40    '  User specified font for Dlg controls
  1299.     Const DS_MODALFRAME = &H80 '  Can be combined with WS_CAPTION
  1300.     Const DS_NOIDLEMSG = &H100 '  WM_ENTERIDLE message will not be sent
  1301.  
  1302.     Const DM_GETDEFID = WM_USER+0
  1303.     Const DM_SETDEFID = WM_USER+1
  1304.     Const DC_HASDEFID% = &H534     '0x534B
  1305.  
  1306.     '  Dialog Codes
  1307.     Const DLGC_WANTARROWS = &H1 '  Control wants arrow keys
  1308.     Const DLGC_WANTTAB = &H2    '  Control wants tab keys
  1309.     Const DLGC_WANTALLKEYS = &H4    '  Control wants all keys
  1310.     Const DLGC_WANTMESSAGE = &H4    '  Pass message to control
  1311.     Const DLGC_HASSETSEL = &H8  '  Understands EM_SETSEL message
  1312.     Const DLGC_DEFPUSHBUTTON = &H10 '  Default pushbutton
  1313.     Const DLGC_UNDEFPUSHBUTTON = &H20   '  Non-default pushbutton
  1314.     Const DLGC_RADIOBUTTON = &H40   '  Radio button
  1315.     Const DLGC_WANTCHARS = &H80 '  Want WM_CHAR messages
  1316.     Const DLGC_STATIC = &H100   '  Static item: don't include
  1317.     Const DLGC_BUTTON = &H2000  '  Button item: can be checked
  1318.  
  1319.     Const LB_CTLCODE = 0
  1320.  
  1321.     '  Listbox Return Values
  1322.     Const LB_OKAY = 0
  1323.     Const LB_ERR = (-1)
  1324.     Const LB_ERRSPACE = (-2)
  1325.  
  1326.     '
  1327.     '  The idStaticPath parameter to DlgDirList can have the following values
  1328.     '  ORed if the list box should show other details of the files along with
  1329.     '  the name of the files;
  1330.  
  1331.     '  all other details also will be returned
  1332.  
  1333.     '  Listbox Notification Codes
  1334.     Const LBN_ERRSPACE = (-2)
  1335.     Const LBN_SELCHANGE = 1
  1336.     Const LBN_DBLCLK = 2
  1337.     Const LBN_SELCANCEL = 3
  1338.     Const LBN_SETFOCUS = 4
  1339.     Const LBN_KILLFOCUS = 5
  1340.  
  1341.     '  Listbox messages
  1342.     Const LB_ADDSTRING = (WM_USER+1)
  1343.     Const LB_INSERTSTRING = (WM_USER+2)
  1344.     Const LB_DELETESTRING = (WM_USER+3)
  1345.     Const LB_RESETCONTENT = (WM_USER+5)
  1346.     Const LB_SETSEL = (WM_USER+6)
  1347.     Const LB_SETCURSEL = (WM_USER+7)
  1348.     Const LB_GETSEL = (WM_USER+8)
  1349.     Const LB_GETCURSEL = (WM_USER+9)
  1350.     Const LB_GETTEXT = (WM_USER+10)
  1351.     Const LB_GETTEXTLEN = (WM_USER+11)
  1352.     Const LB_GETCOUNT = (WM_USER+12)
  1353.     Const LB_SELECTSTRING = (WM_USER+13)
  1354.     Const LB_DIR = (WM_USER+14)
  1355.     Const LB_GETTOPINDEX = (WM_USER+15)
  1356.     Const LB_FINDSTRING = (WM_USER+16)
  1357.     Const LB_GETSELCOUNT = (WM_USER+17)
  1358.     Const LB_GETSELITEMS = (WM_USER+18)
  1359.     Const LB_SETTABSTOPS = (WM_USER+19)
  1360.     Const LB_GETHORIZONTALEXTENT = (WM_USER+20)
  1361.     Const LB_SETHORIZONTALEXTENT = (WM_USER+21)
  1362.     Const LB_SETCOLUMNWIDTH = (WM_USER+22)
  1363.     Const LB_SETTOPINDEX = (WM_USER+24)
  1364.     Const LB_GETITEMRECT = (WM_USER+25)
  1365.     Const LB_GETITEMDATA = (WM_USER+26)
  1366.     Const LB_SETITEMDATA = (WM_USER+27)
  1367.     Const LB_SELITEMRANGE = (WM_USER+28)
  1368.     Const LB_MSGMAX = (WM_USER+33)
  1369.  
  1370.     '  Listbox Styles
  1371.     Const LBS_NOTIFY = &H1
  1372.     Const LBS_SORT = &H2
  1373.     Const LBS_NOREDRAW = &H4
  1374.     Const LBS_MULTIPLESEL = &H8
  1375.     Const LBS_OWNERDRAWFIXED = &H10
  1376.     Const LBS_OWNERDRAWVARIABLE = &H20
  1377.     Const LBS_HASSTRINGS = &H40
  1378.     Const LBS_USETABSTOPS = &H80
  1379.     Const LBS_NOINTEGRALHEIGHT = &H100
  1380.     Const LBS_MULTICOLUMN = &H200
  1381.     Const LBS_WANTKEYBOARDINPUT = &H400
  1382.     Const LBS_EXTENDEDSEL = &H800
  1383.     Const LBS_STANDARD = (LBS_NOTIFY Or LBS_SORT Or WS_VSCROLL Or WS_BORDER)
  1384.  
  1385.     '  Combo Box return Values
  1386.     Const CB_OKAY = 0
  1387.     Const CB_ERR = (-1)
  1388.     Const CB_ERRSPACE = (-2)
  1389.  
  1390.     '  Combo Box Notification Codes
  1391.     Const CBN_ERRSPACE = (-1)
  1392.     Const CBN_SELCHANGE = 1
  1393.     Const CBN_DBLCLK = 2
  1394.     Const CBN_SETFOCUS = 3
  1395.     Const CBN_KILLFOCUS = 4
  1396.     Const CBN_EDITCHANGE = 5
  1397.     Const CBN_EDITUPDATE = 6
  1398.     Const CBN_DROPDOWN = 7
  1399.  
  1400.     '  Combo Box styles
  1401.     Const CBS_SIMPLE = &H1
  1402.     Const CBS_DROPDOWN = &H2
  1403.     Const CBS_DROPDOWNLIST = &H3
  1404.     Const CBS_OWNERDRAWFIXED = &H10
  1405.     Const CBS_OWNERDRAWVARIABLE = &H20
  1406.     Const CBS_AUTOHSCROLL = &H40
  1407.     Const CBS_OEMCONVERT = &H80
  1408.     Const CBS_SORT = &H100
  1409.     Const CBS_HASSTRINGS = &H200
  1410.     Const CBS_NOINTEGRALHEIGHT = &H400
  1411.  
  1412.     '  Combo Box messages
  1413.     Const CB_GETEDITSEL = (WM_USER+0)
  1414.     Const CB_LIMITTEXT = (WM_USER+1)
  1415.     Const CB_SETEDITSEL = (WM_USER+2)
  1416.     Const CB_ADDSTRING = (WM_USER+3)
  1417.     Const CB_DELETESTRING = (WM_USER+4)
  1418.     Const CB_DIR = (WM_USER+5)
  1419.     Const CB_GETCOUNT = (WM_USER+6)
  1420.     Const CB_GETCURSEL = (WM_USER+7)
  1421.     Const CB_GETLBTEXT = (WM_USER+8)
  1422.     Const CB_GETLBTEXTLEN = (WM_USER+9)
  1423.     Const CB_INSERTSTRING = (WM_USER+10)
  1424.     Const CB_RESETCONTENT = (WM_USER+11)
  1425.     Const CB_FINDSTRING = (WM_USER+12)
  1426.     Const CB_SELECTSTRING = (WM_USER+13)
  1427.     Const CB_SETCURSEL = (WM_USER+14)
  1428.     Const CB_SHOWDROPDOWN = (WM_USER+15)
  1429.     Const CB_GETITEMDATA = (WM_USER+16)
  1430.     Const CB_SETITEMDATA = (WM_USER+17)
  1431.     Const CB_GETDROPPEDCONTROLRECT = (WM_USER+18)
  1432.     Const CB_MSGMAX = (WM_USER+19)
  1433.  
  1434.     '  Scroll Bar Styles
  1435.     Const SBS_HORZ = &H0
  1436.     Const SBS_VERT = &H1
  1437.     Const SBS_TOPALIGN = &H2
  1438.     Const SBS_LEFTALIGN = &H2
  1439.     Const SBS_BOTTOMALIGN = &H4
  1440.     Const SBS_RIGHTALIGN = &H4
  1441.     Const SBS_SIZEBOXTOPLEFTALIGN = &H2
  1442.     Const SBS_SIZEBOXBOTTOMRIGHTALIGN = &H4
  1443.     Const SBS_SIZEBOX = &H8
  1444.  
  1445.  
  1446.     '  Sound Functions
  1447.     '
  1448.     Declare Function OpenSound Lib "Sound" () As Integer
  1449.     Declare Sub CloseSound Lib "Sound" ()
  1450.     Declare Function SetVoiceQueueSize Lib "Sound" ( nVoice%,  nBytes%) As Integer
  1451.     Declare Function SetVoiceNote Lib "Sound" ( nVoice%,  nValue%,  nLength%,  nCdots%) As Integer
  1452.     Declare Function SetVoiceAccent Lib "Sound" ( nVoice%,  nTempo%,  nVolume%,  nMode%,  nPitch%) As Integer
  1453.     Declare Function SetVoiceEnvelope Lib "Sound" ( nVoice%,  nShape%,  nRepeat%) As Integer
  1454.     Declare Function SetSoundNoise Lib "Sound" ( nSource%,  nDuration%) As Integer
  1455.     Declare Function SetVoiceSound Lib "Sound" ( nVoice%,  lFrequency&,  nDuration%) As Integer
  1456.     Declare Function StartSound Lib "Sound" () As Integer
  1457.     Declare Function StopSound Lib "Sound" () As Integer
  1458.     Declare Function WaitSoundState Lib "Sound" ( nState%) As Integer
  1459.     Declare Function SyncAllVoices Lib "Sound" () As Integer
  1460.     Declare Function CountVoiceNotes Lib "Sound" ( nVoice%) As Integer
  1461.     Declare Function GetThresholdEvent Lib "Sound" () As Integer
  1462.     Declare Function GetThresholdStatus Lib "Sound" () As Integer
  1463.     Declare Function SetVoiceThreshold Lib "Sound" ( nVoice%,  nNotes%) As Integer
  1464.  
  1465.     '  WaitSoundState() Constants
  1466.     Const S_QUEUEEMPTY = 0
  1467.     Const S_THRESHOLD = 1
  1468.     Const S_ALLTHRESHOLD = 2
  1469.  
  1470.     '  Accent Modes
  1471.     Const S_NORMAL = 0
  1472.     Const S_LEGATO = 1
  1473.     Const S_STACCATO = 2
  1474.  
  1475.     '  SetSoundNoise() Sources
  1476.     Const S_PERIOD512 = 0   '  Freq = N/512 high pitch, less coarse hiss
  1477.     Const S_PERIOD1024 = 1  '  Freq = N/1024
  1478.     Const S_PERIOD2048 = 2  '  Freq = N/2048 low pitch, more coarse hiss
  1479.     Const S_PERIODVOICE = 3 '  Source is frequency from voice channel (3)
  1480.     Const S_WHITE512 = 4    '  Freq = N/512 high pitch, less coarse hiss
  1481.     Const S_WHITE1024 = 5   '  Freq = N/1024
  1482.     Const S_WHITE2048 = 6   '  Freq = N/2048 low pitch, more coarse hiss
  1483.     Const S_WHITEVOICE = 7  '  Source is frequency from voice channel (3)
  1484.  
  1485.     Const S_SERDVNA = (-1)  '  Device not available
  1486.     Const S_SEROFM = (-2)   '  Out of memory
  1487.     Const S_SERMACT = (-3)  '  Music active
  1488.     Const S_SERQFUL = (-4)  '  Queue full
  1489.     Const S_SERBDNT = (-5)  '  Invalid note
  1490.     Const S_SERDLN = (-6)   '  Invalid note length
  1491.     Const S_SERDCC = (-7)   '  Invalid note count
  1492.     Const S_SERDTP = (-8)   '  Invalid tempo
  1493.     Const S_SERDVL = (-9)   '  Invalid volume
  1494.     Const S_SERDMD = (-10)  '  Invalid mode
  1495.     Const S_SERDSH = (-11)  '  Invalid shape
  1496.     Const S_SERDPT = (-12)  '  Invalid pitch
  1497.     Const S_SERDFQ = (-13)  '  Invalid frequency
  1498.     Const S_SERDDR = (-14)  '  Invalid duration
  1499.     Const S_SERDSR = (-15)  '  Invalid source
  1500.     Const S_SERDST = (-16)  '  Invalid state
  1501.  
  1502.     '  COMM declarations
  1503.     '
  1504.     Const NOPARITY = 0
  1505.     Const ODDPARITY = 1
  1506.     Const EVENPARITY = 2
  1507.     Const MARKPARITY = 3
  1508.     Const SPACEPARITY = 4
  1509.  
  1510.     Const ONESTOPBIT = 0
  1511.     Const ONE5STOPBITS = 1
  1512.     Const TWOSTOPBITS = 2
  1513.  
  1514.     Const IGNORE = 0    '  Ignore signal
  1515.     Const INFINITE = &HFFFF '  Infinite timeout
  1516.  
  1517.     '  Error Flags
  1518.     Const CE_RXOVER = &H1   '  Receive Queue overflow
  1519.     Const CE_OVERRUN = &H2  '  Receive Overrun Error
  1520.     Const CE_RXPARITY = &H4 '  Receive Parity Error
  1521.     Const CE_FRAME = &H8    '  Receive Framing error
  1522.     Const CE_BREAK = &H10   '  Break Detected
  1523.     Const CE_CTSTO = &H20   '  CTS Timeout
  1524.     Const CE_DSRTO = &H40   '  DSR Timeout
  1525.     Const CE_RLSDTO = &H80  '  RLSD Timeout
  1526.     Const CE_TXFULL = &H100 '  TX Queue is full
  1527.     Const CE_PTO = &H200    '  LPTx Timeout
  1528.     Const CE_IOE = &H400    '  LPTx I/O Error
  1529.     Const CE_DNS = &H800    '  LPTx Device not selected
  1530.     Const CE_OOP = &H1000   '  LPTx Out-Of-Paper
  1531.     Const CE_MODE = &H8000  '  Requested mode unsupported
  1532.  
  1533.     Const IE_BADID = (-1)   '  Invalid or unsupported id
  1534.     Const IE_OPEN = (-2)    '  Device Already Open
  1535.     Const IE_NOPEN = (-3)   '  Device Not Open
  1536.     Const IE_MEMORY = (-4)  '  Unable to allocate queues
  1537.     Const IE_DEFAULT = (-5) '  Error in default parameters
  1538.     Const IE_HARDWARE = (-10)   '  Hardware Not Present
  1539.     Const IE_BYTESIZE = (-11)   '  Illegal Byte Size
  1540.     Const IE_BAUDRATE = (-12)   '  Unsupported BaudRate
  1541.  
  1542.     '  Events
  1543.     Const EV_RXCHAR = &H1   '  Any Character received
  1544.     Const EV_RXFLAG = &H2   '  Received certain character
  1545.     Const EV_TXEMPTY = &H4  '  Transmitt Queue Empty
  1546.     Const EV_CTS = &H8  '  CTS changed state
  1547.     Const EV_DSR = &H10 '  DSR changed state
  1548.     Const EV_RLSD = &H20    '  RLSD changed state
  1549.     Const EV_BREAK = &H40   '  BREAK received
  1550.     Const EV_ERR = &H80 '  Line status error occurred
  1551.     Const EV_RING = &H100   '  Ring signal detected
  1552.     Const EV_PERR = &H200   '  Printer error occured
  1553.  
  1554.     '  Escape Functions
  1555.     Const SETXOFF = 1   '  Simulate XOFF received
  1556.     Const SETXON = 2    '  Simulate XON received
  1557.     Const SETRTS = 3    '  Set RTS high
  1558.     Const CLRRTS = 4    '  Set RTS low
  1559.     Const SETDTR = 5    '  Set DTR high
  1560.     Const CLRDTR = 6    '  Set DTR low
  1561.     Const RESETDEV = 7  '  Reset device if possible
  1562.  
  1563.     Const LPTx = &H80   '  Set if ID is for LPT device
  1564.  
  1565.     Type DCB
  1566.         Id As String * 1
  1567.         BaudRate As Integer
  1568.         ByteSize As String * 1
  1569.         Parity As String * 1
  1570.         StopBits As String * 1
  1571.         RlsTimeout As Integer
  1572.         CtsTimeout As Integer
  1573.         DsrTimeout As Integer
  1574.  
  1575.         Bits1 As String * 1 ' The fifteen actual DCB bit-sized data fields
  1576.         Bits2 As String * 1 ' within these two bytes can be manipulated by
  1577.                               ' bitwise logical And/Or operations.  Refer to
  1578.                               ' SDKWIN.HLP for location/meaning of specific bits
  1579.  
  1580.         XonChar As String * 1
  1581.         XoffChar As String * 1
  1582.         XonLim As Integer
  1583.         XoffLim As Integer
  1584.         PeChar As String * 1
  1585.         EofChar As String * 1
  1586.         EvtChar As String * 1
  1587.         TxDelay As Integer
  1588.     End Type
  1589.  
  1590.     Type COMSTAT
  1591.         Bits As String * 1 ' For specific bit flags and their
  1592.                              ' meanings, refer to SDKWIN.HLP.
  1593.         cbInQue As Integer
  1594.         cbOutQue As Integer
  1595.     End Type
  1596.  
  1597.     Declare Function OpenComm Lib "User" ( lpComName$,  wInQueue%,  wOutQueue%) As Integer
  1598.     Declare Function SetCommState Lib "User" ()
  1599.     Declare Function GetCommState Lib "User" ( nCid%, lpDCB as DCB) As Integer
  1600.     Declare Function ReadComm Lib "User" ( nCid%,  lpBuf$,  nSize%) As Integer
  1601.     Declare Function UngetCommChar Lib "User" ( nCid%,  cChar%) As Integer
  1602.     Declare Function WriteComm Lib "User" ( nCid%,  lpBuf$,  nSize%) As Integer
  1603.     Declare Function CloseComm Lib "User" ( nCid%) As Integer
  1604.     Declare Function BuildCommDCB Lib "User" ( lpDef$, lpDCB As DCB) As Integer
  1605.     Declare Function TransmitCommChar Lib "User" ( nCid%,  cChar%) As Integer
  1606.     Declare Function SetCommEventMask Lib "User" ( nCid%, nEvtMask%) As Long
  1607.     Declare Function GetCommEventMask Lib "User" ( nCid%,  nEvtMask%) As Integer
  1608.     Declare Function SetCommBreak Lib "User" ( nCid%) As Integer
  1609.     Declare Function ClearCommBreak Lib "User" ( nCid%) As Integer
  1610.     Declare Function FlushComm Lib "User" ( nCid%,  nQueue%) As Integer
  1611.     Declare Function EscapeCommFunction Lib "User" ( nCid%,  nFunc%) As Integer
  1612.  
  1613.     Type MDICREATESTRUCT
  1614.         szClass As Long
  1615.         szTitle As Long
  1616.         hOwner As Integer
  1617.         x As Integer
  1618.         y As Integer
  1619.         cx As Integer
  1620.         cy As Integer
  1621.         style As Long
  1622.         lParam As Long
  1623.     End Type
  1624.  
  1625.     Type CLIENTCREATESTRUCT
  1626.         hWindowMenu As Integer
  1627.         idFirstChild As Integer
  1628.     End Type
  1629.  
  1630.     Declare Function DefFrameProc Lib "User" ( hWnd%,  hWndMDIClient%,  wMsg%,  wParam%,  lParam&) As Long
  1631.     Declare Function DefMDIChildProc Lib "User" ( hWnd%,  wMsg%,  wParam%,  lParam&) As Long
  1632.  
  1633.     Declare Function TranslateMDISysAccel Lib "User" ( hWndClient%, lpMsg As MSG) As Integer
  1634.  
  1635.     Declare Function ArrangeIconicWindows Lib "User" ( hWnd%) As Integer
  1636.  
  1637.  
  1638.     '   Help engine section.
  1639.  
  1640.     '  Commands to pass WinHelp()
  1641.     Const HELP_CONTEXT = &H1    '  Display topic in ulTopic
  1642.     Const HELP_QUIT = &H2   '  Terminate help
  1643.     Const HELP_INDEX = &H3  '  Display index
  1644.     Const HELP_HELPONHELP = &H4 '  Display help on using help
  1645.     Const HELP_SETINDEX = &H5   '  Set the current Index for multi index help
  1646.     Const HELP_KEY = &H101      '  Display topic for keyword in offabData
  1647.     Const HELP_MULTIKEY = &H201
  1648.  
  1649.     Declare Function WinHelp Lib "User" ( hWnd%,  lpHelpFile$,  wCommand%, dwData As Any) As Integer
  1650.  
  1651.     Type MULTIKEYHELP
  1652.         mkSize As Integer
  1653.         mkKeylist As String * 1
  1654.         szKeyphrase As String * 253 ' Array length is arbitrary; may be changed
  1655.     End Type
  1656.  
  1657.     '  function declarations for profiler routines contained in Windows libraries
  1658.     Declare Function ProfInsChk Lib "User" () As Integer
  1659.     Declare Sub ProfSetup Lib "User" ( nBufferSize%,  nSamples%)
  1660.     Declare Sub ProfSampRate Lib "User" ( nRate286%,  nRate386%)
  1661.     Declare Sub ProfStart Lib "User" ()
  1662.     Declare Sub ProfStop Lib "User" ()
  1663.     Declare Sub ProfClear Lib "User" ()
  1664.     Declare Sub ProfFlush Lib "User" ()
  1665.     Declare Sub ProfFinish Lib "User" ()
  1666.  
  1667. '$ENDIF
  1668.  
  1669.