Does VBscript SendKeys support or support Unicode?

I find that VBscript SendKeysdoes not support Unicode. It supports some, such as A-65, but not foreign letters, like the letter Aleph (א) from the Hebrew alphabet. Prob is out of range. Maybe for decimal values ​​128+, it gives "?", And it only supports ASCII range.

I can print and see Hebrew letters on my computer using Windows XP. Thus, OS support for characters exists and is configured. My source code demonstrates that since the line

msgbox Chrw(1488)

displays the Aleph symbol, and I displayed it in Notepad and in MS Word.

It seems to me that he sends a question mark for a character that he does not recognize. I think that MS Word or Notepad, if they have a problem with displaying a character (for example, when the font does not support char), they will display a field, not a question mark. Of course, in the case of Notepad anyway. So it looks like a problem SendKeys. Any ideas? Any workaround?

Dim objShell

Set objShell = CreateObject("WScript.Shell")

objShell.Run "notepad" ''#can change to winword

Wscript.Sleep 2000

msgbox Chrw(1488)  ''#aleph

objShell.SendKeys ("abc" & ChrW(1488) & "abc")  ''#bang, it displays a ? instead of an aleph

WScript.Quit
+3
source share
3 answers

Most likely, you are correct in assuming that VBscript SendKeysdoes not support Unicode .


Windows API, SendKeys ( API- Blade API Monitor Windows XP , ) , SendKeys Unicode. , SendKeys :

  • ANSI ( Unicode) VkKeyScan - VkKeyScanA - key code , . VK_SHIFT + VK_OEM_2, , - ANSI.

  • SendInput VK_SHIFT + VK_OEM_2 Aleph.

, Unicode SendInput KEYEVENTF_UNICODE, - , . , VkKeyScan Unicode, SendInput Unicode.


, Unicode- VBScript - COM-, SendInput / script. (VBScript Windows API.)

barlop

vbscript obj.SendKeys(..) unicode, VB SendKeys.Send(..) .

+3

Dragon Naturally, , SendKeys , , , , , , SendKeys Ctrl-V , , SendKeys, .

Clipboard("טקסט בעברית")
SendKeys("^V")

(Ctrl, Alt, Shift) , .

0

Microsoft Sans Serif .

-2

Source: https://habr.com/ru/post/1753593/


All Articles