BUG: Num Lock Turned Off After Sending Keystrokes to DOS App. (118818)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
- Microsoft Visual Basic Standard Edition for Windows 1.0
This article was previously published under Q118818 SYMPTOMS
After you activate an MS-DOS application in a window and send keystrokes to
it, the Num Lock key, which had been turned on, is turned off.
WORKAROUND
You can use the KeyStat control to work around the problem. The following
code fixes the example in the "MORE INFORMATION" section, below:
' Add a KeyStat control (KeyStat1 by default)
' Set the Style property to 1 - Num Lock
' Set the visible property to False
Sub Command1_Click ()
NumLockStatus = KeyStat1.Value
Clipboard.SetText "DIR" + Chr(13)
AppActivate "MS-DOS Prompt" ' Title of Windowed MS-DOS Session
SendKeys "% ep"
KeyStat1.Value = NumLockStatus
End Sub
NOTE: The KeyStat control does not fix the problem if you specify True for
the Wait parameter in the SendKeys statement.
STATUS
Microsoft has confirmed this to be a bug in the Standard and Professional
Editions of Visual Basic versions 2.0 and 3.0 for Windows and in the Visual
Basic Programming System version 1.0 for Windows. We are researching this
problem and will post new information here in the Microsoft Knowledge Base
as it becomes available.
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbbug KB118818 |
---|
|