home *** CD-ROM | disk | FTP | other *** search
- '*********************** TESTDLGS.MST ************************************
- 'Demonstrates: The use of procedures found in the TESTDLGS.DLL Library,
- ' provided with Microsoft test for Windows.
- '
- 'Required Files: MSTEST.INC, TESTDLGS.DLL
- '
- 'Uses: TESTDLGS
- '
- 'Complexity Level: INTERMEDIATE
- '
- 'Notes:
- '
- '*************************************************************************
-
- '$DEFINE TESTDLGS
- '$INCLUDE 'MSTEST.INC'
-
- DIM ret%, WinHandle%
-
- Viewport Clear
-
- '*** Dlgs.cmp will be where dialog information is saved
- '*** Dlgs.res will be where comparison results are logged
-
- ret = SetDialogFile("dlgs.cmp")
- ret = SetLogFile("dlgs.res")
-
- RUN "calc.exe", NOWAIT
-
- WinHandle = WGetActWnd(0) '*** Get the handle of the active application
-
- DoKeys "%vs" '*** Send Alt+v+s to ensure calc is in scientific mode
-
- '*** Save the scientific calculator menu structure and attributes
- '*** as dialog number 1 in dlgs.cmp:
- ret = SaveMenu(Winhandle, 1, "ScientificMenu", TRUE)
-
- '*** Save the standard calculator menu structure and attributes, this
- '*** time as dialog number 2 in dlgs.cmp:
-
- ret = SaveMenuActivate("%vt", "", 2, "StandardMenu",TRUE)
-
- '*** Select the Help/About Calculator menu item, record its controls in a
- '*** dialog record number 3, then close the About box.
-
- ret = SaveWindowActivate("%ha", "{ENTER}", 3, "AboutBoxControls",TRUE, FALSE)
-
- '*** Compare the active window (calc in standard mode) to dialog number 1:
-
- ret = CmpWindow(Winhandle, 1, TRUE)
-
- SELECT CASE ret
- CASE 0
- PRINT "Return Value = "; ret; "Window controls compared exactly"
- CASE -1
- PRINT "Return Value = "; ret; "Windows compared, but were fuzzy"
- CASE -3
- PRINT "Return Value = "; ret; "Control not found"
- CASE ELSE
- PRINT "Return Value = "; ret; "Return value not in SELECT-CASE block"
- END SELECT
-
- '*** Compare the active window to dialog number 2. This should result in
- '*** an exact match:
-
- ret = CmpWindow(WinHandle, 2, TRUE)
-
- SELECT CASE ret
- CASE 0
- PRINT "Return Value = "; ret; "Window controls compared exactly"
- CASE -1
- PRINT "Return Value = "; ret; "Windows compared, but were fuzzy"
- CASE -3
- PRINT "Return Value = "; ret; "Control not found"
- CASE ELSE
- PRINT "Return Value = "; ret; "Return value not in SELECT-CASE block"
- END SELECT
-
- DoKeys "%{F4}" '*** Send Alt+F4 to exit calculator
-
- END
-
-