VB3 How to Send Keystrokes from VB App to MS-DOS AppLast reviewed: August 11, 1997Article ID: Q77394 |
The information in this article applies to: - Standard and Professional Editions of Microsoft Visual Basic for Windows, versions 2.0 and 3.0- Microsoft Visual Basic programming system for Windows, version 1.0
SUMMARYThe "Microsoft Visual Basic: Language Reference" version 1.0 manual states that the SendKeys function cannot be used to send keystrokes to an MS-DOS-based application from a Windows-based application. This article gives a technique you can use to to send keystrokes to an MS-DOS-based application from a Visual Basic Windows-based application.
MORE INFORMATIONThe Microsoft Visual Basic for Windows SendKeys function can send keystrokes to the currently active window as if the keystrokes had been typed at the keyboard. Although it is not possible to send keystrokes to an application that is not based on Windows by using SendKeys directly, you can place text on the Clipboard and use SendKeys to paste that text into an MS-DOS-based application that is running in a window or minimized as an icon. To run an MS-DOS-based application in a window, you must be running in Windows 386 enhanced mode. You must also make sure that the MS-DOS-based application's .PIF file has been set to display the application in a window rather than full screen. Use the Windows PIF Editor to make this modification, if necessary.
Step-by-Step ExampleThe following shows by example how to send keystrokes to an MS-DOS session running in a window:
Keywords : EnvtRun kbenv kbprg kbtlc Version : 1.0 2.0 3.0 Platform : WINDOWS |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |