Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1250 lines
60 KiB

  1. '--------------------------------------------------------------------------
  2. '
  3. ' MSTEST.INC Version 2.00
  4. ' API Declarations for TEST Tools
  5. '
  6. ' NOTE: All API are ALIAS'd to themselves to support NT
  7. ' API Not yet supported under NT are IFDEF'd out using the
  8. ' predefine symbol of NT.
  9. '
  10. ' To include the various portions of this file, any combination of the
  11. ' following $DEFINE's must be used in your script prior to $INCLUDEing
  12. ' MSTEST.INC:
  13. '
  14. ' i.e. IN YOUR SCRIPT add a line such as the following to DEFINE one of
  15. ' the SYMBOLS below, so you only include what you need.
  16. '
  17. ' REM$ DEFINE MSTest - to get everything in this include file
  18. ' REM$ DEFINE TestCtrl - to get ALL the TESTCTRL declarations etc.
  19. ' REM$ DEFINE TestScrn - to get ALL the TESTSCRN declarations etc.
  20. ' REM$ DEFINE TestDlgs - to get ALL the TESTDLGS declarations etc.
  21. ' REM$ DEFINE TestEvnt - to get ALL the TESTEVNT declarations etc.
  22. ' REM$ DEFINE TestUI - to get ALL the TESTUI declarations etc.
  23. '
  24. ' OR USE ANY OF THE FOLLOWING SYMBOLS TO GET PARTIAL
  25. '
  26. ' MSTEST: includes all of MSTEST.INC
  27. '
  28. ' TESTCTRL: includes all of TESTCTRL
  29. ' W_MISC TESTCTRL Miscellaneous routines
  30. ' W_WINDOW TESTCTRL Window routines
  31. ' W_MENU TESTCTRL Menu routines
  32. ' W_ERROR: TESTCTRL error routines
  33. ' W_CONTROL: includes all of the control declares & routines
  34. ' W_BUTTON: includes all of the BUTTON declares etc.
  35. ' W_CHECK: " CHECKBOX
  36. ' W_OPTION " OPTION BUTTON
  37. ' W_EDIT " EDIT CONTROL
  38. ' W_LIST " LIST BOX
  39. ' W_COMBO " COMBO BOX
  40. '
  41. ' TESTSCRN: includes all of TESTSCRN, Declares & Error codes
  42. ' TESTSCRN_DECL: includes all SCR Declares
  43. ' TESTSCRN_ERRS: includes all SCR Error codes
  44. '
  45. ' TESTDLGS: includes all of TESTDLGS, Declares & Error codes
  46. ' TESTDLGS_DECL: includes all DLGS Declares
  47. ' TESTDLGS_ERRS: includes all DLGS Error codes
  48. '
  49. ' TESTEVNT: includes all TESTEVNT Declares
  50. '
  51. ' W_ERROR_TRAP: Just like W_ERROR, but includes a generic
  52. ' WErrorTrap to display WError and ErrorText
  53. ' NOTE: This is not included from any other define.
  54. '
  55. ' NOTE: Including MSTEST.INC without out using any of the above $DEFINE's
  56. ' will include only TESTDRVR.EXE trappable and untrappable error
  57. ' codes, and declares for CRLF, TRUE (-1), FALSE(0), Key values for
  58. ' DoKeys() from TESTEVNT and few routines from TESTCtrl.
  59. '
  60. '---------------------------------------------------------------------------
  61. '
  62. ' Copyright (C) 1991-1992 Microsoft Corporation
  63. '
  64. ' You have a royalty-free right to use, modify, reproduce and distribute
  65. ' this file (and/or any modified version) in any way you find useful,
  66. ' provided that you agree that Microsoft has no warranty, obligation or
  67. ' liability for its contents. Refer to the Microsoft Windows Programmer's
  68. ' Reference for further information.
  69. '
  70. ' This file is not garanteed by Microsoft to be error free. Every effort
  71. ' has been made to ensure proper data-types and declarations etc., but no
  72. ' testing has been performed using this include file. Additionally, some
  73. ' API's, though listed, may not be compatible with the TESTDrvr language.
  74. '
  75. '----------------------------------------------------------------------------
  76. ' *********************
  77. '$IFNDEF MSTEST_INCLUDED
  78. '$DEFINE MSTEST_INCLUDED
  79. ' *********************
  80. '----------------------------------------------------------------------------
  81. ' Generic Global Variables
  82. '----------------------------------------------------------------------------
  83. Global CRLF As String ' UNDONE: Change to Const X = Chr$()
  84. CRLF = Chr$(13) + Chr$(10) ' once supported
  85. Const TRUE = -1
  86. Const FALSE = 0
  87. '----------------------------------------------------------------------------
  88. ' Unrecoverable TESTDRVR error codes
  89. '----------------------------------------------------------------------------
  90. Const ERR_STACK_OVERFLOW = 0
  91. Const ERR_STACK_UNDERFLOW = 1
  92. Const ERR_OUT_OF_STRING_SPACE = 2
  93. Const ERR_CANT_LOAD_TESTVIEW_DLL = 3
  94. Const ERR_OUT_OF_MEMORY = 4
  95. '----------------------------------------------------------------------------
  96. ' Recoverable TESTDRVR error codes
  97. '----------------------------------------------------------------------------
  98. Const ERR_GOSUB_STACK_OVERFLOW = 5
  99. Const ERR_RETURN_WITHOUT_GOSUB = 6
  100. Const ERR_BAD_FILE_NUMBER = 7
  101. Const ERR_FILE_IO = 8
  102. Const ERR_RUN_CMD_TOO_LONG = 9
  103. Const ERR_SHELL_CMD_TOO_LONG = 10
  104. Const ERR_SETFILE = 11
  105. Const ERR_FILE_NUMBER_IN_USE = 12
  106. Const ERR_CANT_OPEN_FILE = 13
  107. Const ERR_ILLEGAL_FUNCTION_CALL = 14
  108. Const ERR_INVALID_PATH = 15
  109. Const ERR_INVALID_DRIVE = 16
  110. Const ERR_NO_CURRENT_WORKING_DIR = 17
  111. Const ERR_BAD_RUN_CMD = 18
  112. Const ERR_DIVISION_BY_ZERO = 19
  113. Const ERR_CANT_LOAD_DLL = 20
  114. Const ERR_PROC_NOT_FOUND_IN_DLL = 21
  115. Const ERR_CANNOT_RESUME = 22
  116. Const ERR_MEM_ALLOC = 23
  117. Const ERR_INVALID_POINTER = 24
  118. Const ERR_INVALID_ALLOC_SIZE = 25
  119. Const ERR_NULL_PIONTER_REF = 26
  120. Const ERR_SUBSCRIPT_RANGE = 27
  121. Const ERR_INPUT_PAST_EOF = 28
  122. Const ERR_FILELIST_PROC = 29
  123. Const ERR_INVALID_ATTRIBUTE = 30
  124. '$ifdef WINUSER_SHOW_COMMANDS AND NOT NT
  125. '----------------------------------------------------------------------------
  126. ' RUN statement Show commands: RUN "command"[, [NOWAIT][, ShowCommand]]
  127. ' NOTE: These are the same as the SW_ constants in Windows.h
  128. '----------------------------------------------------------------------------
  129. Const SW_HIDE = 0
  130. Const SW_SHOWNORMAL = 1
  131. Const SW_NORMAL = 1
  132. Const SW_SHOWMINIMIZED = 2
  133. Const SW_SHOWMAXIMIZED = 3
  134. Const SW_MAXIMIZE = 3
  135. Const SW_SHOWNOACTIVATE = 4
  136. Const SW_SHOW = 5
  137. Const SW_MINIMIZE = 6
  138. Const SW_SHOWMINNOACTIVE = 7
  139. Const SW_SHOWNA = 8
  140. Const SW_RESTORE = 9
  141. '$endif WINUSER_SHOW_COMMANDS AND NOT NT
  142. '----------------------------------------------------------------------------
  143. ' Key contants used with WKey, PlayKeys, & PlayKeyshWnd
  144. '----------------------------------------------------------------------------
  145. Const K_ENTER = "{ENTER}"
  146. Const K_ESC = "{ESC}"
  147. Const K_UP = "{UP}"
  148. Const K_DOWN = "{DOWN}"
  149. Const K_LEFT = "{LEFT}"
  150. Const K_RIGHT = "{RIGHT}"
  151. Const K_END = "{END}"
  152. Const K_PGUP = "{PGUP}"
  153. Const K_PGDN = "{PGDN}"
  154. Const K_INSERT = "{INSERT}"
  155. Const K_INS = "{INSERT}"
  156. Const K_DELETE = "{DELETE}"
  157. Const K_DEL = "{DELETE}"
  158. Const K_HOME = "{HOME}"
  159. Const K_TAB = "{TAB}"
  160. Const K_BS = "{BS}"
  161. Const K_F1 = "{F1}"
  162. Const K_F2 = "{F2}"
  163. Const K_F3 = "{F3}"
  164. Const K_F4 = "{F4}"
  165. Const K_F5 = "{F5}"
  166. Const K_F6 = "{F6}"
  167. Const K_F7 = "{F7}"
  168. Const K_F8 = "{F8}"
  169. Const K_F9 = "{F9}"
  170. Const K_F10 = "{F10}"
  171. Const K_F11 = "{F11}"
  172. Const K_F12 = "{F12}"
  173. Const K_F13 = "{F13}"
  174. Const K_F14 = "{F14}"
  175. Const K_F15 = "{F15}"
  176. Const K_F16 = "{F16}"
  177. Const K_SHIFT = "+"
  178. Const K_CTRL = "^"
  179. Const K_ALT = "%"
  180. ' TESTCtrl API & Constants that are always declared.
  181. '
  182. ' WGetFocus() simply preforms the exact function as the windows
  183. ' GetFocus() API. Is contained in TESTCtrl since it is such a
  184. ' commonly used API in scripts, and it makes it much easier to
  185. ' use since it is defined simply by including MSTEST.INC. It is
  186. ' renamed to prevent duplicate definitions due to scripts that
  187. ' do define GetFocus() and include MSTEST.INC.
  188. '---------------------------------------------------------------
  189. Declare Function WGetFocus Lib "TESTCtrl.dll" Alias "WGetFocus" () As Integer
  190. Declare Sub WSetActWnd Lib "TESTCtrl.dll" Alias "WSetActWnd" (hWnd%)
  191. Declare Function WGetActWnd Lib "TESTCtrl.dll" Alias "WGetActWnd" (hWnd%) As Integer
  192. Declare Function WFndWnd Lib "TESTCtrl.dll" Alias "WFndWnd" (lpszCaption$, wFlags%) As Integer
  193. Declare Function WFndWndC Lib "TESTCtrl.dll" Alias "WFndWndC" (lpszText$, lpszClass$, wFlags%) As Integer
  194. Declare Function WFndWndWait Lib "TESTCtrl.dll" Alias "WFndWndWait" (lpszCaption$, wFlags%, wSeconds%) As Integer
  195. Declare Function WFndWndWaitC Lib "TESTCtrl.dll" Alias "WFndWndWaitC" (lpszText$, lpszClass$, wFlags%, wSeconds%) As Integer
  196. Const FW_DEFAULT = &h0000 'Default
  197. Const FW_RESTOREICON = &h0081 '&h0080 Or FW_FOCUS
  198. Const FW_NOEXIST = &h0040
  199. Const FW_EXIST = &h0000 'Default
  200. Const FW_CHILDNOTOK = &h0020
  201. Const FW_CHILDOK = &h0000 'Default
  202. Const FW_HIDDENOK = &h0010
  203. Const FW_HIDDENNOTOK = &h0000 'Default
  204. Const FW_ACTIVE = &h0008
  205. Const FW_ALL = &h0000 'Default
  206. Const FW_CASE = &h0004
  207. Const FW_NOCASE = &h0000 'Default
  208. Const FW_PART = &h0002
  209. Const FW_FULL = &h0000 'Default
  210. Const FW_FOCUS = &h0001
  211. Const FW_NOFOCUS = &h0000 'Default
  212. ' TESTEvnt API that are always defined.
  213. '--------------------------------------
  214. Declare Sub DoKeys Lib "TESTEvnt.Dll" Alias "DoKeys" (lpStr$)
  215. Declare Sub DoKeysHwnd Lib "TESTEvnt.Dll" Alias "DoKeyshWnd" (hWnd%, lpStr$)
  216. ' Useful function when working with the Windows API,
  217. ' to extract the HI/LO wordt from a Long Integer.
  218. '---------------------------------------------------
  219. Declare Function HIWORD(LongVar&) As Integer
  220. Function HIWORD (LongVar&) Static As Integer
  221. HIWORD = LongVar& / 65536
  222. End Function
  223. Declare Function LOWORD(LongVar&) As Integer
  224. Function LOWORD (LongVar&) Static As Integer
  225. LOWORD = LongVar& And &H0000FFFF
  226. End Function
  227. ' Useful function when working with the Windows API,
  228. ' to extract the HI/LO byte from am Integer.
  229. '---------------------------------------------------
  230. Declare Function HIBYTE(IntVar%) As Integer
  231. Function HIBYTE (IntVar%) Static As Integer
  232. HIBYTE = IntVar% / 256
  233. End Function
  234. Declare Function LOBYTE(IntVar%) As Integer
  235. Function LOBYTE (IntVar%) Static As Integer
  236. LOBYTE = IntVar% And &H00FF
  237. End Function
  238. ' *********************
  239. '$ENDIF MSTEST_INCLUDED
  240. ' *********************
  241. '----------------------------------------------------------------------------
  242. ' DEFINE's that control the inclusion of the remainder of MSTEST.INC
  243. '----------------------------------------------------------------------------
  244. '$IFDEF MSTEST
  245. '$DEFINE TESTCTRL
  246. '$DEFINE TESTSCRN
  247. '$DEFINE TESTDLGS
  248. '$DEFINE TESTEVNT
  249. '$DEFINE TESTUI
  250. '$ENDIF
  251. '$IFDEF TESTCTRL
  252. '$DEFINE W_MISC
  253. '$DEFINE W_WINDOW
  254. '$DEFINE W_MENU
  255. '$DEFINE W_ERROR
  256. '$DEFINE W_CONTROL
  257. '$ENDIF
  258. '$IFDEF W_ERROR_TRAP
  259. '$DEFINE W_ERROR
  260. '$ENDIF
  261. '$IFDEF W_CONTROL
  262. '$DEFINE W_BUTTON
  263. '$DEFINE W_CHECK
  264. '$DEFINE W_OPTION
  265. '$DEFINE W_EDIT
  266. '$DEFINE W_LIST
  267. '$DEFINE W_COMBO
  268. '$ENDIF
  269. '$IFDEF TESTSCRN
  270. '$DEFINE TESTSCRN_DECL
  271. '$DEFINE TESTSCRN_ERRS
  272. '$ENDIF
  273. '$IFDEF TESTDLGS
  274. '$DEFINE TESTDLGS_DECL
  275. '$DEFINE TESTDLGS_ERRS
  276. '$ENDIF
  277. '$IFDEF W_BUTTON OR W_CHECK OR W_OPTION OR W_EDIT OR W_LIST OR W_COMBO
  278. '$DEFINE W_A_CONTROL
  279. '$ENDIF
  280. ' *********************
  281. '$IFDEF TESTUI AND NOT TESTUI_INCLUDED AND NOT NT
  282. ' *********************
  283. '----------------------------------------------------------------------------
  284. ' TESTUI.dll:
  285. ' Function declarations for use with TESTUI
  286. '----------------------------------------------------------------------------
  287. Declare Function DlgBox Lib "TESTUI.dll" Alias "DlgBox" (DlgId%, hwndOwner%, proc As CallBack, ResFile$) As Integer
  288. Declare Function DlgBox3D Lib "TESTUI.dll" Alias "DlgBox3D" (DlgId%, hwndOwner%, proc As CallBack, ResFile$) As Integer
  289. Declare Function SetScriptMenu Lib "TESTUI.dll" Alias "SetScriptMenu" (MenuId%, hwnd%, ResFile$) As Integer
  290. Declare Function SetIconBar Lib "TESTUI.dll" Alias "SetIconBar" (IconBarId%, proc As Callback, AppName$, ResFile$, fAlwaysOnTop%) As Integer
  291. Declare Function SetSysMenu Lib "TESTUI.dll" Alias "SetSysMenu" (MenuId%, proc As Callback, AppName$, ResFile$) As Integer
  292. Declare Function SetSysMenu3D Lib "TESTUI.dll" Alias "SetSysMenu3D" (MenuId%, proc As Callback, AppName$, ResFile$) As Integer
  293. Declare Function MSTLoadIcon Lib "TESTUI.dll" Alias "MSTLoadIcon" (IconId%, ResFile$) As Integer
  294. Declare Sub MSTDestroyIcon Lib "TESTUI.dll" Alias "MSTDestroyIcon" (hIcon%)
  295. ' *********************
  296. '$DEFINE TESTUI_INCLUDED
  297. '$ENDIF
  298. '$IFDEF W_MISC AND NOT W_MISC_INCLUDED
  299. ' *********************
  300. '----------------------------------------------------------------------------
  301. ' W_MISC: Miscellanious Routines, types and Constants.
  302. '----------------------------------------------------------------------------
  303. Const MAX_CAPTION = 128
  304. Type INFO
  305. hWnd As Integer
  306. hWndParent As Integer
  307. szClass As String * MAX_CAPTION
  308. szCaption As String * MAX_CAPTION
  309. szParentClass As String * MAX_CAPTION
  310. szParentCaption As String * MAX_CAPTION
  311. szModuleName As String * MAX_CAPTION
  312. lStyle As Long
  313. fChild As Integer
  314. wID As Integer
  315. wLeft As Integer
  316. wTop As Integer
  317. wRight As Integer
  318. wBottom As Integer
  319. wWidth As Integer
  320. wHeight As Integer
  321. End Type
  322. ' The 4 WMessage[W|L] API are slight variations on the windows
  323. ' SendMessage() API. Two things are provided:
  324. '
  325. ' Validation of hWnd%: - If invalid an error value that
  326. ' is trappable by WErrorTrap is
  327. ' - If hWnd is NULL, the message goes
  328. ' to the ActiveWindow.
  329. ' Only need paramaters: Pass in only the paramaters that are needed:
  330. ' WMessage: Wp and Lp are set to zero
  331. ' WMessageW: Lp is set to zero
  332. ' WMessageL: Wp is set to zero
  333. ' WMessageWL: just like SendMessage() but with hWnd validation
  334. '---------------------------------------------------------------------
  335. Declare Function WMessage Lib "TESTCtrl.dll" Alias "WMessage" (hWnd%, wMsg%)
  336. Declare Function WMessageW Lib "TESTCtrl.dll" Alias "WMessageW" (hWnd%, wMsg%, wp%)
  337. Declare Function WMessageL Lib "TESTCtrl.dll" Alias "WMessageL" (hWnd%, wMsg%, lp As Any)
  338. Declare Function WMessageWL Lib "TESTCtrl.dll" Alias "WMessageWL" (hWnd%, wMsg%, wp%, lp As Any)
  339. Declare Function WIsVisible Lib "TESTCtrl.dll" Alias "WIsVisible" (hWnd%) As Integer
  340. Declare Function WTextLen Lib "TESTCtrl.dll" Alias "WTextLen" (hWnd%) As Long
  341. Declare Sub WGetText Lib "TESTCtrl.dll" Alias "WGetText" (hWnd%, lpszBuffer$)
  342. Declare Sub WSetText Lib "TESTCtrl.dll" Alias "WSetText" (hWnd%, lpszText$)
  343. Declare Function WNumAltKeys Lib "TESTCtrl.dll" Alias "WNumAltKeys" () As Integer
  344. Declare Sub WGetAltKeys Lib "TESTCtrl.dll" Alias "WGetAltKeys" (lpszBuff$)
  345. Declare Function WNumDupAltKeys Lib "TESTCtrl.dll" Alias "WNumDupAltKeys" () As Integer
  346. Declare Sub WGetDupAltKeys Lib "TESTCtrl.dll" Alias "WGetDupAltKeys" (lpszBuff$)
  347. Declare Sub WDisplayInfo Lib "TESTCtrl.dll" Alias "WDisplayInfo" (hWnd%, wDisplay%)
  348. Declare Sub WGetInfo Lib "TESTCtrl.dll" Alias "WGetInfo" (hWnd%, lpInfo As INFO)
  349. ' Layered routines to simulate string functions for the coresponding
  350. ' TESTCtrl API
  351. '----------------------------------------------------------------------------
  352. Declare Function GetText (hWnd%) As String
  353. Declare Function GetAltKeys () As String
  354. Declare Function GetDupAltKeys () As String
  355. Const DI_DIALOG = 1
  356. Const DI_DEBUG = 2
  357. Const DI_BOTH = 3
  358. '----------------------------------------------------------------------------
  359. ' GetText: Layered routine for WGetText()
  360. '----------------------------------------------------------------------------
  361. Function GetText(hWnd%) Static As String
  362. Dim lpszBuffer As String
  363. Dim textLength As Long
  364. GetText = ""
  365. textLength = WTextLen(hWnd%)
  366. If textLength > 0 Then
  367. lpszBuffer = String$(textLength+1, " ")
  368. WGetText hWnd%, lpszBuffer
  369. GetText = lpszBuffer
  370. End If
  371. lpszBuffer = ""
  372. End Function
  373. '----------------------------------------------------------------------------
  374. ' GetAltKeys: Layered routine for WGetAltKeys()
  375. '----------------------------------------------------------------------------
  376. Function GetAltKeys() Static As String
  377. Dim lpszBuffer As String
  378. lpszBuffer = String$(WNumAltKeys()+1, " ")
  379. WGetAltKeys lpszBuffer
  380. GetAltKeys = lpszBuffer
  381. lpszBuffer = ""
  382. End Function
  383. '----------------------------------------------------------------------------
  384. ' GetDupAltKeys: Layered routine for WGetDupAltKeys()
  385. '----------------------------------------------------------------------------
  386. Function GetDupAltKeys() Static As String
  387. Dim lpszBuffer As String
  388. lpszBuffer = String$(WNumDupAltKeys()+1, " ")
  389. WGetDupAltKeys lpszBuffer
  390. GetDupAltKeys = lpszBuffer
  391. lpszBuffer = ""
  392. End Function
  393. ' *********************
  394. '$DEFINE W_MISC_INCLUDED
  395. '$ENDIF
  396. '$IFDEF TESTEVNT AND NOT TESTEVNT_INCLUDED
  397. ' *********************
  398. '----------------------------------------------------------------------------
  399. ' TESTEvnt.Dll:
  400. ' Function declarations for use with TESTEvnt
  401. '----------------------------------------------------------------------------
  402. '$IFNDEF NT
  403. TYPE MEMORYINFO
  404. LargestAvail AS LONG ' Largest available free block in bytes
  405. MaxPagesUnlock AS LONG ' Maximum unlocked page allocation in pages
  406. MaxPagesLocked AS LONG ' Maximum locked page allocation in pages
  407. TotalLinBytes AS LONG ' Linear address space size in bytes
  408. TotalUnlockBytes AS LONG ' Total number of unlocked bytes
  409. TotalFreePhysBytes AS LONG ' Total number of free physical bytes
  410. TotalPhysBytes AS LONG ' Total number of physical bytes
  411. FreeLinBytes AS LONG ' Free linear address space in bytes
  412. SwapFileSize AS LONG ' Size of paging file/partition in bytes
  413. Reserved1 AS LONG ' reserved for future expansion, all bits set
  414. Reserved2 AS LONG ' reserved for future expansion, all bits set
  415. Reserved3 AS LONG ' reserved for future expansion, all bits set
  416. Reserved4 AS LONG ' reserved for future expansion, all bits set
  417. NumSelectors AS INTEGER ' Total number of selectors on current LDT
  418. NumFreeSelectors AS INTEGER ' Number of free selectors on current LDT
  419. GlobalHeapFree AS LONG ' Number of free Global bytes
  420. USERHeapFree AS LONG ' Number of free bytes in USER.EXE's heap
  421. GDIHeapFree AS LONG ' Number of free bytes in GDI.EXE's heap
  422. SysResFree AS INTEGER ' *PERCENTAGE* of free system resources
  423. END TYPE
  424. Declare Sub WaitUntilIdle Lib "TESTEVNT.DLL" Alias "WaitUntilIdle" ()
  425. Declare Function GetMemoryInfo Lib "TESTEvnt.Dll" Alias "GetMemoryInfo" (lpMemInfo As MEMORYINFO) As Integer
  426. Declare Function VMGetScreenCols Lib "TESTEvnt.Dll" Alias "VMGetScreenCols" (HWND%) As Integer
  427. Declare Function VMGetCursPos Lib "TESTEvnt.Dll" Alias "VMGetCursPos" (HWND%) As Integer
  428. Declare Function VMGetScreen Lib "TESTEvnt.Dll" Alias "VMGetScreen" (HWND%, UINT%, UINT%, UINT%, UINT%, LPSTR$) As Integer
  429. Declare Function VMGetScreenClip Lib "TESTEvnt.Dll" Alias "VMGetScreenClip" (HWND%, UINT%, UINT%, UINT%, UINT%) As Integer
  430. Declare Sub VMSetBackground Lib "TESTEvnt.Dll" Alias "VMSetBackground" (HWND%, BOOL%)
  431. Declare Function VMPipeOpen Lib "TESTEvnt.Dll" Alias "VMPipeOpen" (HWND%, SCRIPTSUB As Callback ) As Integer
  432. Declare Function VMPipeClose Lib "TESTEvnt.Dll" Alias "VMPipeClose" (HWND%) As Integer
  433. Declare Function VMPipeGetText Lib "TESTEvnt.Dll" Alias "VMPipeGetText" (HWND%, LPSTR$ ) As Integer
  434. CONST PIPESTRINGSIZE = 129 ' 128 chars + NULL
  435. ' ** VMPipeGetText() Return values... **
  436. '----------------------------------------
  437. CONST PGT_FAILED = &H0000
  438. CONST PGT_COMPLETE = &H0001
  439. CONST PGT_MOREREADY = &H0002
  440. '$ENDIF NT 'for TESTEvnt VM Stuff
  441. Declare Sub QueKeys Lib "TESTEvnt.Dll" Alias "QueKeys" (lpStr$)
  442. Declare Sub QueKeyDn Lib "TESTEvnt.Dll" Alias "QueKeyDn" (lpStr$)
  443. Declare Sub QueKeyUp Lib "TESTEvnt.Dll" Alias "QueKeyUp" (lpStr$)
  444. Declare Sub QueSetSpeed Lib "TESTEvnt.Dll" Alias "QueSetSpeed" (ms%)
  445. Declare Sub QuePause Lib "TESTEvnt.Dll" Alias "QuePause" (ms&)
  446. Declare Sub QueFlush Lib "TESTEvnt.Dll" Alias "QueFlush" (fRestoreKeyState%)
  447. Declare Sub QueEmpty Lib "TESTEvnt.Dll" Alias "QueEmpty" ()
  448. Declare Sub QueMouseMove Lib "TESTEvnt.Dll" Alias "QueMouseMove" (x%, y%)
  449. Declare Sub QueMouseDn Lib "TESTEvnt.Dll" Alias "QueMouseDn" (iBtn%, x%, y%)
  450. Declare Sub QueMouseUp Lib "TESTEvnt.Dll" Alias "QueMouseUp" (iBtn%, x%, y%)
  451. Declare Sub QueMouseClick Lib "TESTEvnt.Dll" Alias "QueMouseClick" (iBtn%, x%, y%)
  452. Declare Sub QueMouseDblClk Lib "TESTEvnt.Dll" Alias "QueMouseDblClk" (iBtn%, x%, y%)
  453. Declare Sub QueMouseDblDn Lib "TESTEvnt.Dll" Alias "QueMouseDblDn" (iBtn%, x%, y%)
  454. Declare Sub QueSetFocus Lib "TESTEvnt.Dll" Alias "QueSetFocus" (hwnd%)
  455. Declare Sub QueSetRelativeWindow Lib "TESTEvnt.Dll" Alias "QueSetRelativeWindow" (hwnd%)
  456. '$ifndef VK_WINAPI
  457. Const VK_LBUTTON = 1
  458. Const VK_RBUTTON = 2
  459. Const VK_MBUTTON = 4
  460. '$define VK_WINAPI
  461. '$endif
  462. ' *********************
  463. '$DEFINE TESTEVNT_INCLUDED
  464. '$ENDIF
  465. '$IFDEF TESTSCRN_DECL AND NOT TESTSCRN_DECL_INCLUDED
  466. ' *********************
  467. '----------------------------------------------------------------------------
  468. ' TESTScrn.DLL:
  469. ' Type, Const, and Function declarations for use with TESTScrn
  470. '----------------------------------------------------------------------------
  471. Type wRect
  472. x1 As Integer
  473. y1 As Integer
  474. x2 As Integer
  475. y2 As Integer
  476. End Type
  477. Const SCRNAPPEND = 0
  478. Const SCRNREPLACE = 1
  479. Const SCRNINSERT = 2
  480. '*** TESTSCRN.DLL Routines
  481. '
  482. Declare Function fCompFiles Lib "TESTScrn.DLL" Alias "fCompFiles" (lpszFileName1$, Scr1%, lpszFileName2$, Scr2%, CompareType%) As Integer
  483. Declare Function fCompScreenActivate Lib "TESTScrn.DLL" Alias "fCompScreenActivate" (lpszFileName$, OpenKeys$, CloseKeys$, lpRect As wRect, Scr1%, Hide%, Flag%) As Integer
  484. Declare Function fCompScreen Lib "TESTScrn.DLL" Alias "fCompScreen" (lpszFileName$, lpRect As wRect, Scr1%, Hide%, Flag%) As Integer
  485. Declare Function fCompWindowActivate Lib "TESTScrn.DLL" Alias "fCompWindowActivate" (lpszFileName$, OpenKeys$, CloseKeys$, Scr1%, Hide%, Flag%) As Integer
  486. Declare Function fCompWindow Lib "TESTScrn.DLL" Alias "fCompWindow" (lpszFileName$, hWnd%, Scr1%, Hide%, Flag%) As Integer
  487. Declare Function fDelScreen Lib "TESTScrn.DLL" Alias "fDelScreen" (lpszFileName$, Scr%) As Integer
  488. Declare Function fDumpFileToClip Lib "TESTScrn.DLL" Alias "fDumpFileToClip" (lpszFileName$, Scr%) As Integer
  489. Declare Function fDumpScreenActivate Lib "TESTScrn.DLL" Alias "fDumpScreenActivate" (lpszFileName$, OpenKeys$, CloseKeys$, lpRect As wRect, Action%, Scr1%, Flag%) As Integer
  490. Declare Function fDumpScreen Lib "TESTScrn.DLL" Alias "fDumpScreen" (lpszFileName$, lpRect As wRect, Action%, Scr1%, Flag%) As Integer
  491. Declare Function fDumpSrnToClipActivate Lib "TESTScrn.DLL" Alias "fDumpSrnToClipActivate" (OpenKeys$, CloseKeys$, lpRect As wRect, Hide%) As Integer
  492. Declare Function fDumpSrnToClip Lib "TESTScrn.DLL" Alias "fDumpSrnToClip" (lpRect As wRect, Hide%) As Integer
  493. Declare Function fDumpWindowActivate Lib "TESTScrn.DLL" Alias "fDumpWindowActivate" (lpszFileName$, OpenKeys$, CloseKeys$, Action%, Scr1%, Flag%) As Integer
  494. Declare Function fDumpWindow Lib "TESTScrn.DLL" Alias "fDumpWindow" (lpszFileName$, wHnd%, Action%, Scr1%, Flag%) As Integer
  495. Declare Function fDumpWndToClipActivate Lib "TESTScrn.DLL" Alias "fDumpWndToClipActivate" (OpenKeys$, CloseKeys$, Hide%) As Integer
  496. Declare Function fDumpWndToClip Lib "TESTScrn.DLL" Alias "fDumpWndToClip" (hWnd%, Hide%) As Integer
  497. Declare Function fFileInfo Lib "TESTScrn.DLL" Alias "fFileInfo" (lpszName$, lpRect AS wRect, VideoMode AS POINTER TO INTEGER, Count AS POINTER TO INTEGER) As Integer
  498. Declare Function fGetDLLVersion Lib "TESTScrn.DLL" Alias "fGetDLLVersion" (lpszFileName$) As Integer
  499. Declare Function fGetMaxScreen Lib "TESTScrn.DLL" Alias "fGetMaxScreen" (lpszFileName$) As Integer
  500. Declare Function fGetOS Lib "TESTScrn.DLL" Alias "fGetOS" (lpszFileName$) As Integer
  501. Declare Function fSaveFileToDIB Lib "TESTScrn.DLL" Alias "fSaveFileToDIB" (lpszFileName1$, Scr%, lpszFileName2$) As Integer
  502. Declare Function fSaveSrnToDIBActivate Lib "TESTScrn.DLL" Alias "fSaveSrnToDIBActivate" (lpszFileName$, OpenKeys$, CloseKeys$, lpRect As wRect, Hide%) As Integer
  503. Declare Function fSaveSrnToDIB Lib "TESTScrn.DLL" Alias "fSaveSrnToDIB" (lpszFileName$, lpRect As wRect, Hide%) As Integer
  504. Declare Function fSaveWndToDIBActivate Lib "TESTScrn.DLL" Alias "fSaveWndToDIBActivate" (lpszFileName$, OpenKeys$, CloseKeys$, Hide%) As Integer
  505. Declare Function fSaveWndToDIB Lib "TESTScrn.DLL" Alias "fSaveWndToDIB" (lpszFileName$, hWnd%, Hide%) As Integer
  506. Declare Function fViewScreen Lib "TESTScrn.DLL" Alias "fViewScreen" (lpszFileName$, hWnd%, Scr1%, Action%) As Integer
  507. ' *********************
  508. '$DEFINE TESTSCRN_DECL_INCLUDED
  509. '$ENDIF
  510. '$IFDEF TESTSCRN_ERRS AND NOT TESTSCRN_ERRS_INCLUDED
  511. ' *********************
  512. '*** TESTScrn.DLL Error Codes
  513. '
  514. Const ERR_SCR_NOERROR = 0
  515. Const ERR_SCR_FILEACCESS = 301
  516. Const ERR_SCR_INVALIDFIL = 302
  517. Const ERR_SCR_INVALSRNID = 303
  518. Const ERR_SCR_INVALSRNMD = 304
  519. Const ERR_SCR_OUTOMEMORY = 305
  520. Const ERR_SCR_READSRNFIL = 306
  521. Const ERR_SCR_RELMEMORY = 307
  522. Const ERR_SCR_CREATEDDB = 308
  523. Const ERR_SCR_RWSRNTABLE = 309
  524. Const ERR_SCR_RWCOLTABLE = 310
  525. Const ERR_SCR_WSRNIMAGE = 311
  526. Const ERR_SCR_WFILEHEAD = 312
  527. Const ERR_SCR_CREATEDIB = 313
  528. Const ERR_SCR_SCREENSIZE = 314
  529. Const ERR_SCR_DISPSCREEN = 315
  530. Const ERR_SCR_INVALIDACT = 316
  531. Const ERR_SCR_IMAGEDIFF = 317
  532. Const ERR_SCR_SRNSIZEDIF = 318
  533. Const ERR_SCR_FILEEXIST = 319
  534. Const ERR_SCR_CTEMPFILE = 320
  535. Const ERR_SCR_HIDEWIN = 321
  536. Const ERR_SCR_INVALWHAND = 322
  537. Const ERR_SCR_OFILEFORM = 323
  538. Const ERR_SCR_SRNFILEFUL = 324
  539. Const ERR_SCR_INVALSCALE = 325
  540. Const ERR_SCR_OPENCB = 326
  541. Const ERR_SCR_EMPTYCB = 327
  542. Const ERR_SCR_COPYTOCB = 328
  543. Const ERR_SCR_CLOSECB = 329
  544. Const ERR_SCR_CREATEPAL = 330
  545. Const ERR_SCR_LIBLOADERR = 331
  546. ' *********************
  547. '$DEFINE TESTSCRN_ERRS_INCLUDED
  548. '$ENDIF
  549. '$IFNDEF NT
  550. '$IFDEF TESTDLGS_DECL AND NOT TESTDLGS_DECL_INCLUDED
  551. ' *********************
  552. '----------------------------------------------------------------------------
  553. ' TESTDlgs.DLL:
  554. ' Type, Const, and Function declarations for use with TESTDlgs
  555. '----------------------------------------------------------------------------
  556. Const cchCLASSMAC = 32
  557. Const cchTEXTMAC = 256
  558. Const wVEREB = 1
  559. Type DCR
  560. xLeft As Integer
  561. yMin As Integer
  562. xRight As Integer
  563. yLast As Integer
  564. End Type
  565. Declare Function AwaitSaveCompletion Lib "TESTDlgs.DLL" Alias "AwaitSaveCompletion" () As Integer
  566. Declare Function ComparisonResults Lib "TESTDlgs.DLL" Alias "ComparisonResults" () As Integer
  567. Declare Function CmpWindow Lib "TESTDlgs.DLL" Alias "CmpWindow" (hWnd%, nDialog%, fIncludeParent%) As Integer
  568. Declare Function CmpWindowActivate Lib "TESTDlgs.DLL" Alias "CmpWindowActivate" (lpszOpenKeys$, lpszCloseKey$, nDialog%, fIncludeParent%) As Integer
  569. Declare Function CmpWindowCaption Lib "TESTDlgs.DLL" Alias "CmpWindowCaption" (lpszCap$, nDialog%, fIncludeParent%) As Integer
  570. Declare Function CmpWindowDelayed Lib "TESTDlgs.DLL" Alias "CmpWindowDelayed" (nDelay%, nDialog%, fIncludeParent%, lpszCloseKeys$) As Integer
  571. Declare Function FindWindowCaption Lib "TESTDlgs.DLL" Alias "FindWindowCaption" (lpszCap$, hWndStart%) As Integer
  572. Declare Function SaveMenu Lib "TESTDlgs.DLL" Alias "SaveMenu" (hWnd%, nDialog%, lpszDesc$, fReplace%) As Integer
  573. Declare Function SaveMenuActivate Lib "TESTDlgs.DLL" Alias "SaveMenuActivate" (lpszOpenKeys$, lpszCloseKeys$, nDialog%, lpszDesc$, fReplace%) As Integer
  574. Declare Function SaveMenuCaption Lib "TESTDlgs.DLL" Alias "SaveMenuCaption" (lpszCap$, nDialog%, lpszDesc$, fReplace%) As Integer
  575. Declare Function SaveMenuDelayed Lib "TESTDlgs.DLL" Alias "SaveMenuDelayed" (nDelay%, nDialog%, lpszDesc$, fReplace%, CloseKeys$) As Integer
  576. Declare Function SaveWindow Lib "TESTDlgs.DLL" Alias "SaveWindow" (hWnd%, nDialog%, lpszDesc$, fReplace%, fIncludeParent%) As Integer
  577. Declare Function SaveWindowActivate Lib "TESTDlgs.DLL" Alias "SaveWindowActivate" (lpszOpenKeys$, lpszCloseKeys$, nDialog%, lpszDesc$, fReplace%, fIncludeParent%) As Integer
  578. Declare Function SaveWindowCaption Lib "TESTDlgs.DLL" Alias "SaveWindowCaption" (lpszCap$, nDialog%, lpszDesc$, fReplace%, fIncludeParent%) As Integer
  579. Declare Function SaveWindowDelayed Lib "TESTDlgs.DLL" Alias "SaveWindowDelayed" (nDelay%, nDialog%, lpszDesc$, fReplace%, fIncludeParent%, lpszCloseKeys$) As Integer
  580. Declare Function SetDialogFile Lib "TESTDlgs.DLL" Alias "SetDialogFile" (lpszDialogName$) As Integer
  581. Declare Function SetLogFile Lib "TESTDlgs.DLL" Alias "SetLogFile" (lpszLogName$) As Integer
  582. ' *********************
  583. '$DEFINE TESTDLGS_DECL_INCLUDED
  584. '$ENDIF
  585. '$IFDEF TESTDLGS_ERRS AND NOT TESTDLGS_ERRS_INCLUDED
  586. ' *********************
  587. '*** Function return codes
  588. '
  589. Const ERR_DLGS_NOERR = 0
  590. Const ERR_DLGS_FUZZY = -1
  591. Const ERR_DLGS_EXCESS = -2
  592. Const ERR_DLGS_CTLNOTFOUND = -3
  593. Const ERR_DLGS_NODLGFILE = -10
  594. Const ERR_DLGS_FILENOTFOUND = -11
  595. Const ERR_DLGS_BADWDLFILE = -12
  596. Const ERR_DLGS_LIBLOADERR = -13
  597. Const ERR_DLGS_SAVEERR = -14
  598. Const ERR_DLGS_DLGFILEERR = -15
  599. Const ERR_DLGS_TMPFILEERR = -16
  600. Const ERR_DLGS_VERSIONERR = -17
  601. Const ERR_DLGS_DLGFILEFULL = -18
  602. Const ERR_DLGS_OUTOFMEMORY = -20
  603. Const ERR_DLGS_BUFFERERR = -21
  604. Const ERR_DLGS_NOTIMER = -22
  605. Const ERR_DLGS_NODYNDIALOG = -30
  606. Const ERR_DLGS_INVALIDHWND = -31
  607. Const ERR_DLGS_BADCAPTION = -32
  608. Const ERR_DLGS_BADDLGNUM = -33
  609. Const ERR_DLGS_BADCTLINDEX = -34
  610. Const ERR_DLGS_BADCTLTYPE = -35
  611. Const ERR_DLGS_BADSAVEACTION = -36
  612. Const ERR_DLGS_APPSPECIFIC = -37
  613. ' *********************
  614. '$DEFINE TESTDLGS_ERRS_INCLUDED
  615. '$ENDIF
  616. '$ENDIF NT for TESTDLGS
  617. '$IFDEF W_WINDOW AND NOT W_WINDOW_INCLUDED
  618. ' *********************
  619. '----------------------------------------------------------------------------
  620. ' TESTCtrl.dll routines, types, & constants
  621. '----------------------------------------------------------------------------
  622. '*** Window size and position types
  623. '
  624. Type WNDPOS
  625. wLeft As Integer
  626. wTop As Integer
  627. End Type
  628. Type WNDSIZ
  629. wWidth As Integer
  630. wHeight As Integer
  631. End Type
  632. Type WNDPOSSIZ
  633. wLeft As Integer
  634. wTop As Integer
  635. wWidth As Integer
  636. wHeight As Integer
  637. End Type
  638. '*** Window Positioning and Sizing routines & contants
  639. '
  640. Declare Sub WMinWnd Lib "TESTCtrl.dll" Alias "WMinWnd" (hWnd%)
  641. Declare Sub WMaxWnd Lib "TESTCtrl.dll" Alias "WMaxWnd" (hWnd%)
  642. Declare Sub WResWnd Lib "TESTCtrl.dll" Alias "WResWnd" (hWnd%)
  643. Declare Sub WSetWndPos Lib "TESTCtrl.dll" Alias "WSetWndPos" (hWnd%, wLeft%, wTop%)
  644. Declare Sub WSetWndSiz Lib "TESTCtrl.dll" Alias "WSetWndSiz" (hWnd%, wWidth%, wHeight%)
  645. Declare Sub WSetWndPosSiz Lib "TESTCtrl.dll" Alias "WSetWndPosSiz" (hWnd%, wLeft%, wTop%, wWidth%, wHeight%)
  646. Declare Sub WAdjWndPos Lib "TESTCtrl.dll" Alias "WAdjWndPos" (hWnd%, deltaLeft%, deltaTop%)
  647. Declare Sub WAdjWndSiz Lib "TESTCtrl.dll" Alias "WAdjWndSiz" (hWnd%, deltaWidth%, deltaHeight%)
  648. Declare Sub WAdjWndPosSiz Lib "TESTCtrl.dll" Alias "WAdjWndPosSiz" (hWnd%, deltaLeft%, deltaTop%, deltaWidth%, deltaHeight%)
  649. Declare Sub WGetWndPos Lib "TESTCtrl.dll" Alias "WGetWndPos" (hWnd%, lpWndPos As WNDPOS, fRelative%)
  650. Declare Sub WGetWndSiz Lib "TESTCtrl.dll" Alias "WGetWndSiz" (hWnd%, lpWndSiz As WNDSIZ)
  651. Declare Sub WGetWndPosSiz Lib "TESTCtrl.dll" Alias "WGetWndPosSiz" (hWnd%, lpWndPosSiz As WNDPOSSIZ, fRelative%)
  652. Declare Function WIsMaximized Lib "TESTCtrl.dll" Alias "WIsMaximized" (hWnd%) As Integer
  653. Declare Function WIsMinimized Lib "TESTCtrl.dll" Alias "WIsMinimized" (hWnd%) As Integer
  654. Const W_RELATIVE = TRUE
  655. Const W_ABSOLUTE = FALSE
  656. ' *********************
  657. '$DEFINE W_WINDOW_INCLUDED
  658. '$ENDIF
  659. '$IFDEF W_MENU AND NOT W_MENU_INCLUDED
  660. ' *********************
  661. '*** Menu routines & constants
  662. '
  663. Declare Sub WSysMenu Lib "TESTCtrl.dll" Alias "WSysMenu" (hWnd%)
  664. Declare Function WSysMenuExists Lib "TESTCtrl.dll" Alias "WSysMenuExists" (hWnd%) As Integer
  665. Declare Sub WMenu Lib "TESTCtrl.dll" Alias "WMenu" (lpszName$)
  666. Declare Sub WMenuEx CDECL Lib "TESTCtrl.dll" Alias "WMenuEx" (lpszName$, ...)
  667. Declare Function WMenuExists Lib "TESTCtrl.dll" Alias "WMenuExists" (lpszName$) As Integer
  668. Declare Function WMenuGrayed Lib "TESTCtrl.dll" Alias "WMenuGrayed" (lpszName$) As Integer
  669. Declare Function WMenuChecked Lib "TESTCtrl.dll" Alias "WMenuChecked" (lpszName$) As Integer
  670. Declare Function WMenuEnabled Lib "TESTCtrl.dll" Alias "WMenuEnabled" (lpszName$) As Integer
  671. Declare Function WMenuCount Lib "TESTCtrl.dll" Alias "WMenuCount" () As Integer
  672. Declare Sub WMenuText Lib "TESTCtrl.dll" Alias "WMenuText" (lpszName$, lpszBuffer$)
  673. Declare Function WMenuLen Lib "TESTCtrl.dll" Alias "WMenuLen" (lpszName$) As Integer
  674. Declare Sub WMenuFullText Lib "TESTCtrl.dll" Alias "WMenuFullText" (lpszName$, lpszBuffer$)
  675. Declare Function WMenuFullLen Lib "TESTCtrl.dll" Alias "WMenuFullLen" (lpszName$) As Integer
  676. Declare Sub WMenuEnd Lib "TESTCtrl.dll" Alias "WMenuEnd" ()
  677. Declare Function WMenuNumAltKeys Lib "TESTCtrl.dll" Alias "WMenuNumAltKeys" () As Integer
  678. Declare Sub WMenuGetAltKeys Lib "TESTCtrl.dll" Alias "WMenuGetAltKeys" (lpszBuff$)
  679. Declare Function WMenuNumDupAltKeys Lib "TESTCtrl.dll" Alias "WMenuNumDupAltKeys" () As Integer
  680. Declare Sub WMenuGetDupAltKeys Lib "TESTCtrl.dll" Alias "WMenuGetDupAltKeys" (lpszBuff$)
  681. ' Layered routines to simulate string functions for the coresponding
  682. ' TESTCtrl API
  683. '----------------------------------------------------------------------------
  684. Declare Function MenuText (lpszName$) As String
  685. Declare Function MenuFullText (lpszName$) As String
  686. Declare Function MenuGetAltKeys () As String
  687. Declare Function MenuGetDupAltKeys () As String
  688. ' Unlike the rest of the menu routines, WMenuSeparator() does not ignore
  689. ' menu separators when specifing indexes. The first menu item is item #1
  690. ' the second #2, and so on including all separators.
  691. '------------------------------------------------------------------------
  692. Declare Function WMenuSeparator Lib "TESTCtrl.dll" Alias "WMenuSeparator" (sIndex%) As Integer
  693. ' Obsolete Menu API
  694. '------------------
  695. Declare Sub WMenuX Lib "TESTCtrl.dll" Alias "WMenuX" (iIndex%)
  696. Declare Function WMenuGrayedX Lib "TESTCtrl.dll" Alias "WMenuGrayedX" (iIndex%) As Integer
  697. Declare Function WMenuCheckedX Lib "TESTCtrl.dll" Alias "WMenuCheckedX" (iIndex%) As Integer
  698. Declare Function WMenuEnabledX Lib "TESTCtrl.dll" Alias "WMenuEnabledX" (iIndex%) As Integer
  699. '----------------------------------------------------------------------------
  700. ' MenuText: Layered routine for WMenuText()
  701. '----------------------------------------------------------------------------
  702. Function MenuText(lpszName$) Static As String
  703. Dim lpszBuffer As String
  704. Dim menuLength As Integer
  705. MenuText = ""
  706. menuLength = WMenuLen(lpszName$)
  707. If menuLength >= 0 Then
  708. lpszBuffer = String$(menuLength+1, " ")
  709. WMenuText lpszName$, lpszBuffer
  710. MenuText = lpszBuffer
  711. End if
  712. lpszBuffer = ""
  713. End Function
  714. '----------------------------------------------------------------------------
  715. ' MenuFullText: Layered routine for WMenuFullText()
  716. '----------------------------------------------------------------------------
  717. Function MenuFullText(lpszName$) Static As String
  718. Dim lpszBuffer As String
  719. Dim menuLength As Integer
  720. MenuFullText = ""
  721. menuLength = WMenuFullLen(lpszName$)
  722. If menuLength >= 0 Then
  723. lpszBuffer = String$(menuLength+1, " ")
  724. WMenuFullText lpszName$, lpszBuffer
  725. MenuFullText = lpszBuffer
  726. End If
  727. lpszBuffer = ""
  728. End Function
  729. '----------------------------------------------------------------------------
  730. ' MenuGetAltKeys: Layered routine for WMenuGetAltKeys()
  731. '----------------------------------------------------------------------------
  732. Function MenuGetAltKeys() Static As String
  733. Dim lpszBuffer As String
  734. lpszBuffer = String$(WMenuNumAltKeys()+1, " ")
  735. WMenuGetAltKeys lpszBuffer
  736. MenuGetAltKeys = lpszBuffer
  737. lpszBuffer = ""
  738. End Function
  739. '----------------------------------------------------------------------------
  740. ' MenuGetDupAltKeys: Layered routine for WMenuGetDupAltKeys()
  741. '----------------------------------------------------------------------------
  742. Function MenuGetDupAltKeys() Static As String
  743. Dim lpszBuffer As String
  744. lpszBuffer = String$(WMenuNumDupAltKeys()+1, " ")
  745. WMenuGetDupAltKeys lpszBuffer
  746. MenuGetDupAltKeys = lpszBuffer
  747. lpszBuffer = ""
  748. End Function
  749. ' *********************
  750. '$DEFINE W_MENU_INCLUDED
  751. '$ENDIF
  752. '$IFDEF W_A_CONTROL AND NOT W_A_CONTROL_INCLUDED
  753. ' *********************
  754. '*** Global routine & constants used by all controls
  755. '
  756. Declare Sub WStaticSetClass Lib "TESTCtrl.dll" Alias "WStaticSetClass" (lpszClassName$)
  757. Declare Sub WResetClasses Lib "TESTCtrl.dll" Alias "WResetClasses" ()
  758. ' *********************
  759. '$DEFINE W_A_CONTROL_INCLUDED
  760. '$ENDIF
  761. '$IFDEF W_BUTTON AND NOT W_BUTTON_INCLUDED
  762. ' *********************
  763. '*** Button routines
  764. '
  765. Declare Sub WButtonSetClass Lib "TESTCtrl.dll" Alias "WButtonSetClass" (lpszClassName$)
  766. Declare Function WButtonExists Lib "TESTCtrl.dll" Alias "WButtonExists" (lpszName$) As Integer
  767. Declare Function WButtonEnabled Lib "TESTCtrl.dll" Alias "WButtonEnabled" (lpszName$) As Integer
  768. Declare Function WButtonFocus Lib "TESTCtrl.dll" Alias "WButtonFocus" (lpszName$) As Integer
  769. Declare Sub WButtonClick Lib "TESTCtrl.dll" Alias "WButtonClick" (lpszName$)
  770. Declare Sub WButtonHide Lib "TESTCtrl.dll" Alias "WButtonHide" (lpszName$)
  771. Declare Sub WButtonShow Lib "TESTCtrl.dll" Alias "WButtonShow" (lpszName$)
  772. Declare Sub WButtonEnable Lib "TESTCtrl.dll" Alias "WButtonEnable" (lpszName$)
  773. Declare Sub WButtonDisable Lib "TESTCtrl.dll" Alias "WButtonDisable" (lpszName$)
  774. Declare Function WButtonDefault Lib "TESTCtrl.dll" Alias "WButtonDefault" (lpszName$) As Integer
  775. Declare Function WButtonDefaults Lib "TESTCtrl.dll" Alias "WButtonDefaults" () As Integer
  776. Declare Sub WButtonSetFocus Lib "TESTCtrl.dll" Alias "WButtonSetFocus" (lpszName$)
  777. ' *********************
  778. '$DEFINE W_BUTTON_INCLUDED
  779. '$ENDIF
  780. '$IFDEF W_CHECK AND NOT W_CHECK_INCLUDED
  781. ' *********************
  782. ' CheckBox routines
  783. '
  784. Declare Sub WCheckSetClass Lib "TESTCtrl.dll" Alias "WCheckSetClass" (lpszClassName$)
  785. Declare Function WCheckExists Lib "TESTCtrl.dll" Alias "WCheckExists" (lpszName$) As Integer
  786. Declare Function WCheckEnabled Lib "TESTCtrl.dll" Alias "WCheckEnabled" (lpszName$) As Integer
  787. Declare Function WCheckFocus Lib "TESTCtrl.dll" Alias "WCheckFocus" (lpszName$) As Integer
  788. Declare Function WCheckState Lib "TESTCtrl.dll" Alias "WCheckState" (lpszName$) As Integer
  789. Declare Sub WCheckClick Lib "TESTCtrl.dll" Alias "WCheckClick" (lpszName$)
  790. Declare Sub WCheckHide Lib "TESTCtrl.dll" Alias "WCheckHide" (lpszName$)
  791. Declare Sub WCheckShow Lib "TESTCtrl.dll" Alias "WCheckShow" (lpszName$)
  792. Declare Sub WCheckEnable Lib "TESTCtrl.dll" Alias "WCheckEnable" (lpszName$)
  793. Declare Sub WCheckDisable Lib "TESTCtrl.dll" Alias "WCheckDisable" (lpszName$)
  794. Declare Sub WCheckCheck Lib "TESTCtrl.dll" Alias "WCheckCheck" (lpszName$)
  795. Declare Sub WCheckUnCheck Lib "TESTCtrl.dll" Alias "WCheckUnCheck" (lpszName$)
  796. Declare Sub WCheckSetFocus Lib "TESTCtrl.dll" Alias "WCheckSetFocus" (lpszName$)
  797. Const UNCHECKED = 0
  798. Const CHECKED = 1
  799. Const GRAYED = 2
  800. ' *********************
  801. '$DEFINE W_CHECK_INCLUDED
  802. '$ENDIF
  803. '$IFDEF W_OPTION AND NOT W_OPTION_INCLUDED
  804. ' *********************
  805. '*** Option Button routines
  806. '
  807. Declare Sub WOptionSetClass Lib "TESTCtrl.dll" Alias "WOptionSetClass" (lpszClassName$)
  808. Declare Function WOptionExists Lib "TESTCtrl.dll" Alias "WOptionExists" (lpszName$) As Integer
  809. Declare Function WOptionEnabled Lib "TESTCtrl.dll" Alias "WOptionEnabled" (lpszName$) As Integer
  810. Declare Function WOptionFocus Lib "TESTCtrl.dll" Alias "WOptionFocus" (lpszName$) As Integer
  811. Declare Function WOptionState Lib "TESTCtrl.dll" Alias "WOptionState" (lpszName$) As Integer
  812. Declare Sub WOptionClick Lib "TESTCtrl.dll" Alias "WOptionClick" (lpszName$)
  813. Declare Sub WOptionHide Lib "TESTCtrl.dll" Alias "WOptionHide" (lpszName$)
  814. Declare Sub WOptionShow Lib "TESTCtrl.dll" Alias "WOptionShow" (lpszName$)
  815. Declare Sub WOptionEnable Lib "TESTCtrl.dll" Alias "WOptionEnable" (lpszName$)
  816. Declare Sub WOptionDisable Lib "TESTCtrl.dll" Alias "WOptionDisable" (lpszName$)
  817. Declare Sub WOptionSelect Lib "TESTCtrl.dll" Alias "WOptionSelect" (lpszName$)
  818. Declare Sub WOptionSetFocus Lib "TESTCtrl.dll" Alias "WOptionSetFocus" (lpszName$)
  819. ' *********************
  820. '$DEFINE W_OPTION_INCLUDED
  821. '$ENDIF
  822. '$IFDEF W_LIST AND NOT W_LIST_INCLUDED
  823. ' *********************
  824. '*** Listbox routines
  825. '
  826. Declare Sub WListSetClass Lib "TESTCtrl.dll" Alias "WListSetClass" (lpszClass$)
  827. Declare Function WListExists Lib "TESTCtrl.dll" Alias "WListExists" (lpszName$) As Integer
  828. Declare Function WListCount Lib "TESTCtrl.dll" Alias "WListCount" (lpszName$) As Integer
  829. Declare Sub WListText Lib "TESTCtrl.dll" Alias "WListText" (lpszName$, lpszBuffer$)
  830. Declare Function WListLen Lib "TESTCtrl.dll" Alias "WListLen" (lpszName$) As Integer
  831. Declare Function WListIndex Lib "TESTCtrl.dll" Alias "WListIndex" (lpszName$) As Integer
  832. Declare Function WListTopIndex Lib "TESTCtrl.dll" Alias "WListTopIndex" (lpszName$) As Integer
  833. Declare Sub WListItemText Lib "TESTCtrl.dll" Alias "WListItemText" (lpszName$, iItem%, lpszBuffer$)
  834. Declare Function WListItemLen Lib "TESTCtrl.dll" Alias "WListItemLen" (lpszName$, iItem%) As Integer
  835. Declare Function WListItemExists Lib "TESTCtrl.dll" Alias "WListItemExists" (lpszName$, lpszItem$) As Integer
  836. Declare Sub WListItemClk Lib "TESTCtrl.dll" Alias "WListItemClk" (lpszName$, iItem%)
  837. Declare Sub WListItemCtrlClk Lib "TESTCtrl.dll" Alias "WListItemCtrlClk" (lpszName$, iItem%)
  838. Declare Sub WListItemShftClk Lib "TESTCtrl.dll" Alias "WListItemShftClk" (lpszName$, iItem%)
  839. Declare Sub WListItemDblClk Lib "TESTCtrl.dll" Alias "WListItemDblClk" (lpszName$, iItem%)
  840. Declare Sub WListItemClkT Lib "TESTCtrl.dll" Alias "WListItemClkT" (lpszName$, lpszItem$)
  841. Declare Sub WListItemCtrlClkT Lib "TESTCtrl.dll" Alias "WListItemCtrlClkT" (lpszName$, lpszItem$)
  842. Declare Sub WListItemShftClkT Lib "TESTCtrl.dll" Alias "WListItemShftClkT" (lpszName$, lpszItem$)
  843. Declare Sub WListItemDblClkT Lib "TESTCtrl.dll" Alias "WListItemDblClkT" (lpszName$, lpszItem$)
  844. Declare Function WListSelCount Lib "TESTCtrl.dll" Alias "WListSelCount" (lpszName$) As Integer
  845. Declare Sub WListSelItems Lib "TESTCtrl.dll" Alias "WListSelItems" (lpszName$, lpIntArray As Pointer To Integer)
  846. Declare Sub WListClear Lib "TESTCtrl.dll" Alias "WListClear" (lpszName$)
  847. Declare Sub WListAddItem Lib "TESTCtrl.dll" Alias "WListAddItem" (lpszName$, lpszItem$)
  848. Declare Sub WListDelItem Lib "TESTCtrl.dll" Alias "WListDelItem" (lpszName$, iItem%)
  849. Declare Sub WListDelItemT Lib "TESTCtrl.dll" Alias "WListDelItemT" (lpszName$, lpszItem$)
  850. Declare Function WListEnabled Lib "TESTCtrl.dll" Alias "WListEnabled" (lpszName$) As Integer
  851. Declare Sub WListSetFocus Lib "TESTCtrl.dll" Alias "WListSetFocus" (lpszName$)
  852. ' Layered routines to simulate string functions for the coresponding
  853. ' TESTCtrl API
  854. '----------------------------------------------------------------------------
  855. Declare Function ListText (lpszName$) As String
  856. Declare Function ListItemText (lpszName$, iItem%) As String
  857. '----------------------------------------------------------------------------
  858. ' ListText: Layered routine for WListText()
  859. '----------------------------------------------------------------------------
  860. Function ListText(lpszName$) Static As String
  861. Dim lpszBuffer As String
  862. Dim itemLength As Integer
  863. ListText = ""
  864. itemLength = WListLen(lpszName)
  865. If itemLength >= 0 Then
  866. lpszBuffer = String$(itemLength+1, " ")
  867. WListText lpszName, lpszBuffer
  868. ListText = lpszBuffer
  869. End If
  870. lpszBuffer = ""
  871. End Function
  872. '----------------------------------------------------------------------------
  873. ' ListItemText: Layered routine for WListItemText()
  874. '----------------------------------------------------------------------------
  875. Function ListItemText(lpszName$, sItem%) Static As String
  876. Dim lpszBuffer As String
  877. Dim itemLength As Integer
  878. ListItemText = ""
  879. itemLength = WListItemLen(lpszName, sItem)
  880. If itemLength >= 0 Then
  881. lpszBuffer = String$(itemLength+1, " ")
  882. WListItemText lpszName, sItem, lpszBuffer
  883. ListItemText = lpszBuffer
  884. End If
  885. lpszBuffer = ""
  886. End Function
  887. ' *********************
  888. '$DEFINE W_LIST_INCLUDED
  889. '$ENDIF
  890. '$IFDEF W_COMBO AND NOT W_COMBO_INCLUDED
  891. ' *********************
  892. '*** Combobox routines
  893. '
  894. Declare Sub WComboSetClass Lib "TESTCtrl.dll" Alias "WComboSetClass" (lpszClass$)
  895. Declare Sub WComboSetLBClass Lib "TESTCtrl.dll" Alias "WComboSetLBClass" (lpszClass$)
  896. Declare Function WComboExists Lib "TESTCtrl.dll" Alias "WComboExists" (lpszName$) As Integer
  897. Declare Function WComboCount Lib "TESTCtrl.dll" Alias "WComboCount" (lpszName$) As Integer
  898. Declare Sub WComboSetText Lib "TESTCtrl.dll" Alias "WComboSetText" (lpszName$, lpszText$)
  899. Declare Sub WComboText Lib "TESTCtrl.dll" Alias "WComboText" (lpszName$, lpszBuffer$)
  900. Declare Function WComboLen Lib "TESTCtrl.dll" Alias "WComboLen" (lpszName$) As Integer
  901. Declare Sub WComboSelText Lib "TESTCtrl.dll" Alias "WComboSelText" (lpszName$, lpszBuffer$)
  902. Declare Function WComboSelLen Lib "TESTCtrl.dll" Alias "WComboSelLen" (lpszName$) As Integer
  903. Declare Function WComboIndex Lib "TESTCtrl.dll" Alias "WComboIndex" (lpszName$) As Integer
  904. Declare Sub WComboItemText Lib "TESTCtrl.dll" Alias "WComboItemText" (lpszName$, iItem%, lpszBuffer$)
  905. Declare Function WComboItemLen Lib "TESTCtrl.dll" Alias "WComboItemLen" (lpszName$, iItem%) As Integer
  906. Declare Function WComboItemExists Lib "TESTCtrl.dll" Alias "WComboItemExists" (lpszName$, lpszItem$) As Integer
  907. Declare Sub WComboItemClk Lib "TESTCtrl.dll" Alias "WComboItemClk" (lpszName$, iItem%)
  908. Declare Sub WComboItemDblClk Lib "TESTCtrl.dll" Alias "WComboItemDblClk" (lpszName$, iItem%)
  909. Declare Sub WComboItemClkT Lib "TESTCtrl.dll" Alias "WComboItemClkT" (lpszName$, lpszItem$)
  910. Declare Sub WComboItemDblClkT Lib "TESTCtrl.dll" Alias "WComboItemDblClkT" (lpszName$, lpszItem$)
  911. Declare Sub WComboClear Lib "TESTCtrl.dll" Alias "WComboClear" (lpszName$)
  912. Declare Sub WComboAddItem Lib "TESTCtrl.dll" Alias "WComboAddItem" (lpszName$, lpszItem$)
  913. Declare Sub WComboDelItem Lib "TESTCtrl.dll" Alias "WComboDelItem" (lpszName$, iItem%)
  914. Declare Sub WComboDelItemT Lib "TESTCtrl.dll" Alias "WComboDelItemT" (lpszName$, lpszItem$)
  915. Declare Function WComboEnabled Lib "TESTCtrl.dll" Alias "WComboEnabled" (lpszName$) As Integer
  916. Declare Sub WComboSetFocus Lib "TESTCtrl.dll" Alias "WComboSetFocus" (lpszName$)
  917. ' Layered routines to simulate string functions for the coresponding
  918. ' TESTCtrl API
  919. '----------------------------------------------------------------------------
  920. Declare Function ComboText (lpszName$) As String
  921. Declare Function ComboSelText (lpszName$) As String
  922. Declare Function ComboItemText (lpszName$, iItem%) As String
  923. '----------------------------------------------------------------------------
  924. ' ComboText: Layered routine for WComboText()
  925. '----------------------------------------------------------------------------
  926. Function ComboText(lpszName$) Static As String
  927. Dim lpszBuffer As String
  928. Dim itemLength As Integer
  929. ComboText = ""
  930. itemLength = WComboLen(lpszName$)
  931. If itemLength >= 0 Then
  932. lpszBuffer = String$(itemLength+1, " ")
  933. WComboText lpszName, lpszBuffer
  934. ComboText = lpszBuffer
  935. End If
  936. lpszBuffer = ""
  937. End Function
  938. '----------------------------------------------------------------------------
  939. ' ComboSelText: Layered routine for WComboSelText()
  940. '----------------------------------------------------------------------------
  941. Function ComboSelText(lpszName$) Static As String
  942. Dim lpszBuffer As String
  943. Dim itemLength As Integer
  944. ComboSelText = ""
  945. itemLength = WComboSelLen(lpszName$)
  946. If itemLength >= 0 Then
  947. lpszBuffer = String$(itemLength+1, " ")
  948. WComboSelText lpszName, lpszBuffer
  949. ComboSelText = lpszBuffer
  950. End If
  951. lpszBuffer = ""
  952. End Function
  953. '----------------------------------------------------------------------------
  954. ' ComboItemText: Layered routine for WComboItemText()
  955. '----------------------------------------------------------------------------
  956. Function ComboItemText(lpszName$, sItem%) Static As String
  957. Dim lpszBuffer As String
  958. Dim itemLength As Integer
  959. ComboItemText = ""
  960. itemLength = WComboItemLen(lpszName, sItem)
  961. If itemLength >= 0 Then
  962. lpszBuffer = String$(itemLength+1, " ")
  963. WComboItemText lpszName, sItem, lpszBuffer
  964. ComboItemText = lpszBuffer
  965. End If
  966. lpszBuffer = ""
  967. End Function
  968. ' *********************
  969. '$DEFINE W_COMBO_INCLUDED
  970. '$ENDIF
  971. '$IFDEF W_EDIT AND NOT W_EDIT_INCLUDED
  972. ' *********************
  973. '*** Edit box routines
  974. '
  975. Declare Sub WEditSetClass Lib "TESTCtrl.dll" Alias "WEditSetClass" (lpszClass$)
  976. Declare Function WEditExists Lib "TESTCtrl.dll" Alias "WEditExists" (lpszName$) As Integer
  977. Declare Function WEditLen Lib "TESTCtrl.dll" Alias "WEditLen" (lpszName$) As Long
  978. Declare Sub WEditText Lib "TESTCtrl.dll" Alias "WEditText" (lpszName$, lpszBuffer$)
  979. Declare Sub WEditSetText Lib "TESTCtrl.dll" Alias "WEditSetText" (lpszName$, lpszBuffer$)
  980. Declare Sub WEditSelText Lib "TESTCtrl.dll" Alias "WEditSelText" (lpszName$, lpszBuffer$)
  981. Declare Function WEditSelLen Lib "TESTCtrl.dll" Alias "WEditSelLen" (lpszName$) As Long
  982. Declare Sub WEditLineText Lib "TESTCtrl.dll" Alias "WEditLineText" (lpszName$, lIndex&, lpszBuffer$)
  983. Declare Function WEditLineLen Lib "TESTCtrl.dll" Alias "WEditLineLen" (lpszName$, lIndex&) As Long
  984. Declare Function WEditPos Lib "TESTCtrl.dll" Alias "WEditPos" (lpszName$) As Long
  985. Declare Function WEditLine Lib "TESTCtrl.dll" Alias "WEditLine" (lpszName$) As Long
  986. Declare Function WEditChar Lib "TESTCtrl.dll" Alias "WEditChar" (lpszName$) As Long
  987. Declare Function WEditFirst Lib "TESTCtrl.dll" Alias "WEditFirst" (lpszName$) As Long
  988. Declare Function WEditLines Lib "TESTCtrl.dll" Alias "WEditLines" (lpszName$) As Long
  989. Declare Sub WEditClick Lib "TESTCtrl.dll" Alias "WEditClick" (lpszName$)
  990. Declare Function WEditEnabled Lib "TESTCtrl.dll" Alias "WEditEnabled" (lpszName$) As Integer
  991. Declare Sub WEditSetFocus Lib "TESTCtrl.dll" Alias "WEditSetFocus" (lpszName$)
  992. ' Layered routines to simulate string functions for the coresponding
  993. ' TESTCtrl API
  994. '----------------------------------------------------------------------------
  995. Declare Function EditText (lpszName$) As String
  996. Declare Function EditSelText (lpszName$) As String
  997. Declare Function EditLineText (lpszName$, lIndex&) As String
  998. '----------------------------------------------------------------------------
  999. ' EditText: Layered routine for WEditText()
  1000. '----------------------------------------------------------------------------
  1001. Function EditText(lpszName$) Static As String
  1002. Dim textLength As Long
  1003. Dim lpszBuffer As String
  1004. EditText = ""
  1005. textLength = WEditLen(lpszName)
  1006. If textLength >= 0 Then
  1007. lpszBuffer = String$(textLength+1, " ")
  1008. WEditText lpszName, lpszBuffer
  1009. EditText = lpszBuffer
  1010. End If
  1011. lpszBuffer = ""
  1012. End Function
  1013. '----------------------------------------------------------------------------
  1014. ' EditSelText: Layered routine for WEditSelText()
  1015. '----------------------------------------------------------------------------
  1016. Function EditSelText(lpszName$) Static As String
  1017. Dim selLength As Long
  1018. Dim lpszBuffer As String
  1019. EditSelText = ""
  1020. selLength = WEditSelLen(lpszName)
  1021. If selLength >= 0 Then
  1022. lpszBuffer = String$(selLength+1, " ")
  1023. WEditSelText lpszName, lpszBuffer
  1024. EditSelText = lpszBuffer
  1025. End If
  1026. lpszBuffer = ""
  1027. End Function
  1028. '----------------------------------------------------------------------------
  1029. ' EditLineText: Layered routine for WEditLineText()
  1030. '----------------------------------------------------------------------------
  1031. Function EditLineText(lpszName$, lIndex&) Static As String
  1032. Dim lineLength As Long
  1033. Dim lpszBuffer As String
  1034. EditLineText = ""
  1035. lineLength = WEditLineLen(lpszName, lIndex)
  1036. If lineLength >= 0 Then
  1037. lpszBuffer = String$(lineLength+1, " ")
  1038. WEditLineText lpszName, lIndex&, lpszBuffer
  1039. EditLineText = lpszBuffer
  1040. End if
  1041. lpszBuffer = ""
  1042. End Function
  1043. ' *********************
  1044. '$DEFINE W_EDIT_INCLUDED
  1045. '$ENDIF
  1046. '$IFDEF W_ERROR AND NOT W_ERROR_INCLUDED
  1047. ' *********************
  1048. Declare Function WError Lib "TESTCtrl.dll" Alias "WError" () As Integer
  1049. Declare Sub WErrorSet Lib "TESTCtrl.dll" Alias "WErrorSet" (iErrorNum%)
  1050. Declare Sub WErrorText Lib "TESTCtrl.dll" Alias "WErrorText" (lpszBuffer$)
  1051. Declare Function WErrorLen Lib "TESTCtrl.dll" Alias "WErrorLen" () As Integer
  1052. ' Layered routines to simulate string functions for the coresponding
  1053. ' TESTCtrl API
  1054. '----------------------------------------------------------------------------
  1055. Declare Function ErrorText () As String
  1056. Const NO_ERROR = 0
  1057. Const ERR_MENU_NOT_FOUND = 1
  1058. Const ERR_MENU_ITEM_NOT_FOUND = 2
  1059. Const ERR_NOT_A_LISTBOX = 3
  1060. Const ERR_LISTBOX_NOT_FOUND = 4
  1061. Const ERR_ITEM_NOT_IN_LISTBOX = 5
  1062. Const ERR_INVALID_LISTBOX_INDEX = 6
  1063. Const ERR_LISTBOX_HAS_NO_STRINGS = 7
  1064. Const ERR_LISTBOX_IS_NOT_MULTISELECT = 8
  1065. Const ERR_NOT_A_COMBOBOX = 9
  1066. Const ERR_COMBOBOX_NOT_FOUND = 10
  1067. Const ERR_ITEM_NOT_IN_COMBOBOX = 11
  1068. Const ERR_INVALID_COMBOBOX_INDEX = 12
  1069. Const ERR_COMBOBOX_HAS_NO_EDITBOX = 13
  1070. Const ERR_COMBOBOX_HAS_NO_STRINGS = 14
  1071. Const ERR_NOT_AN_EDITBOX = 15
  1072. Const ERR_EDITBOX_NOT_FOUND = 16
  1073. Const ERR_BUTTON_NOT_FOUND = 17
  1074. Const ERR_OPTION_BUTTON_NOT_FOUND = 18
  1075. Const ERR_CHECKBOX_NOT_FOUND = 19
  1076. Const ERR_INVALID_WINDOW_HANDLE = 20
  1077. Const ERR_NO_SYSTEM_MENU = 21
  1078. Const ERR_INVALID_MENU_INDEX = 22
  1079. Const MAX_ERROR = 23
  1080. '----------------------------------------------------------------------------
  1081. ' ErrorText: Layered routine for WErrorText() of TESTCtrl.DLL.
  1082. ' Simulates a DLL String Function.
  1083. '----------------------------------------------------------------------------
  1084. Function ErrorText() Static As String
  1085. Dim lpszBuffer As String
  1086. Dim errorLength As Integer
  1087. errorLength= WErrorLen()
  1088. lpszBuffer = String$(errorLength+1, " ")
  1089. WErrorText lpszBuffer
  1090. ErrorText = lpszBuffer
  1091. lpszBuffer = ""
  1092. End Function
  1093. ' *********************
  1094. '$DEFINE W_ERROR_INCLUDED
  1095. '$ENDIF
  1096. '$IFDEF W_ERROR_TRAP AND NOT W_ERROR_TRAP_INCLUDED
  1097. ' *********************
  1098. '----------------------------------------------------------------------------
  1099. ' WErrorTrap: This trap is in TESTCTRL.DLL.
  1100. '
  1101. ' This trap is here in MSTEST.INC just so it is easy to quickly add a
  1102. ' trap that will display any TESTCTRL error messages. It is only included if
  1103. ' W_ERROR_TRAP is defined, so if WErrorTrap() is to be used for more than
  1104. ' just to display the TESTCTRL error messages, W_ERROR_TRAP should no be
  1105. ' defined. and a custom WErrorTrap() should be added to your script.
  1106. '----------------------------------------------------------------------------
  1107. Trap WErrorTrap From "TESTCTRL.DLL"
  1108. Print WError;" ";ErrorText
  1109. End Trap
  1110. ' *********************
  1111. '$DEFINE W_ERROR_TRAP_INCLUDED
  1112. '$ENDIF
  1113. ' *********************