Microsoft KB Archive/135766

= Microsoft Knowledge Base =

Visual Test 4.0 & Property Pages Not Provided by Windows 95
Last reviewed: August 28, 1995

Article ID: Q135766

The information in this article applies to:


 * Visual Test for Windows 95, version 4.0

SUMMARY
Visual Test offers a family of functions that are designed to be useful in interacting with the "property pages" supplied by the Windows 95 operating system. However, property pages that are not implemented by Windows 95 may not react properly when automated by Visual Test using the WTab* Functions.

MORE INFORMATION
Windows 95 property page tabs have the class name "SysTabControl32." To determine the class name of the tabs of a property page, use the Window Information (WInfo) utility. Books Online shipped with Visual Test documents WInfo. Drill down to it by following this hierarchy:

Microsoft Visual Test 4.0

Visual Test Utilities User's Guide Using the Window Information Utility Property pages that do not have tabs containing the SysTabControl32 class name may not respond correctly to the WTab* TestBasic family of functions. However, you may be able to use other TestBasic functions such as WClkWnd, WDblClkWnd, Play, and so on to an extent.

Sample Code to Control Property Pages Not Supplied by Windows 95
The following TestBasic code automates WordPad. WordPad uses a property page that is not supplied by Windows 95. The WordPad property page allows view options to be modified.

NOTE: This sample must be run at a video resolution of 800x600. If a different resolution is necessary, you will need to modify the WClkWnd function parameters:

'$Include 'Recorder' ' This code is dependant on this resolution. CheckResolution 800, 600

' Run WordPad asynchronously. Run "WordPad \MSDEV\ReadVT4.wri", NoWait

' May take a moment for WordPad to load. Wait up to 20 seconds. hwndWordPad = WFndWnd( "ReadVT4", FW_PART or FW_FOCUS, 20 )

' Bring up the View.Options property page. WMenuSelect "&View\&Options..." hwndDialog = WFndWnd( "Options", FindWindowFlags )

' Must determine the handle of the property page. ' It happens to be the first child window. hwndPropPage = GetWindow( CurrentWindow, GW_CHILD )

' Click the 'Write' tab. ' Used WInfo to determine the coordinate relative to the window. WClkWnd hwndPropPage, 285, 10

' Set 'Wrap Mode' to 'Wrap to Window.' WOptionSelect "&Wrap to window"

' Accept the changes. ' The OK button is on the dialog window not the property page. WSetActWnd hwndDialog WButtonClick "OK"

Pause "Notice how the text displayed by WordPadwraps when it hits the " + _

"right side of the window. Click the OK Button to continue"

' Changing the view options, again. WSetActWnd hwndWordPad WMenuSelect "&View\&Options..."

hwndDialog = WFndWnd( "Options", FindWindowFlags )

' The property page is now displayed. ' Must determine the handle of the property page. hwndPropPage = GetWindow( CurrentWindow, GW_CHILD )

' Click the 'Write' tab. WClkWnd hwndPropPage, 285, 10

' Set 'Wrap Mode' to 'No wrap.' WOptionSelect "&No wrap"

' Accept the changes. ' The OK button is on the dialog window not the property page. WSetActWnd hwndDialog WButtonClick "OK"

Pause "Now the text displayed by WordPad no longer wraps. " + _

"Click the OK Button to Continue" WSetActWnd wndWordPad

WMenuSelect "&File\E&xit"