BUG: SendKeys.sendKeys() and SendKeys.sendKeysWait() Do Not Work as Expected from Java (282931)
The information in this article applies to:
This article was previously published under Q282931 SYMPTOMS
The sendKeys and sendKeysWait methods that send keystrokes or combinations of keystrokes to an active application do not work as expected.
RESOLUTION
To work around this problem, use the WM_GETTEXT and WM_SETTEXT messages. However, this may only work for certain situations, for example when you enter text into an instance of Notepad. See the "More Information" section for sample code that illustrates this workaround.
Another workaround is to use J/Direct, which allows you to call Win32 Application Programming Interfaces (APIs) from Java. For more information, see the following articles on the Microsoft Developer Network (MSDN):
These APIs are hook procedures that can be used with the SetWindowsHook and SetWindowsHookEx functions.
For additional information about source code that uses these Windows Journal Hooks, click the article number below
to view the article in the Microsoft Knowledge Base:
37138 Journal.exe Contains Windows Journal Hooks Source Code
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCES
For more information on J/Direct, see the SDK for Java documentation at the following Microsoft Web site:
For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:
Modification Type: | Major | Last Reviewed: | 6/14/2006 |
---|
Keywords: | kbBug kbpending kbWFC KB282931 |
---|
|