|
先看看这篇文章,帮助文件里面也有
Handling login windows in non-Web applications
Although a non-Web application抯 main window is usually displayed first, it is also common for a login or security window to be displayed before the main window.
Use the wStartup constant and the Invoke method
To handle login windows, you need to record a declaration for the login window, set the value of the wStartup constant, and write a new Invoke method for the main window that enters the appropriate information into the login window and dismisses it. This enables the DefaultBaseState routine to perform the actions necessary to get past the login window.
Note You do not need to use this procedure for splash screens, which disappear on their own.
To handle login windows:
1 Activate the login window and record a declaration for it selecting the Record/Declarations menu command. (See
Record menu.) Paste the resulting dialog declaration to the test frame file.
2 In your test frame file, find the stub of the declaration for the wStartup constant, located at the top of the declaration for the main window:
// First window to appear when application is invoked
// const wStartup = ?
3 Complete the declaration for the wStartup constant by:
?Removing the comment characters (the two forward slash characters) at the beginning of the declaration.
?Replacing the question mark with the identifier of the login window, as recorded in the window declaration for the login window.
4 Define an Invoke method in the main window declaration that calls the built-in Invoke method and additionally performs any actions required by the login window, such as entering a name and password.
Example
After following this procedure, your test frame might look like this:
xample |
|