1. PostMessage(Form1.Edit1.Handle, WM_CHAR, 65, 0);
2. scan code : A code number transmitted to a computer whenever a key is pressed or released. Each key on the keyboard has a unique scan code. This code is not the same as the ASCII code for the letter, number, or symbol shown on the key; it is a special identifier for the key itself and is always the same for a particular key. When a key is pressed, the scan code is transmitted to the computer, where a portion of the read-only memory basic input/output system (ROM BIOS) dedicated to the keyboard translates the scan code into its ASCII equivalent. Because a single key can generate more than one character—lowercase "a" and uppercase "A," for example—the ROM BIOS also keeps track of the status of keys that change the keyboard state, such as the SHIFT key, and takes them into account when translating a scan code.
VK 是一个Windows的设备无关性键值,在Windows单元定义
2. scan code : A code number transmitted to a computer whenever a key is pressed or released. Each key on the keyboard has a unique scan code. This code is not the same as the ASCII code for the letter, number, or symbol shown on the key; it is a special identifier for the key itself and is always the same for a particular key. When a key is pressed, the scan code is transmitted to the computer, where a portion of the read-only memory basic input/output system (ROM BIOS) dedicated to the keyboard translates the scan code into its ASCII equivalent. Because a single key can generate more than one character—lowercase "a" and uppercase "A," for example—the ROM BIOS also keeps track of the status of keys that change the keyboard state, such as the SHIFT key, and takes them into account when translating a scan code.
VK 是一个Windows的设备无关性键值,在Windows单元定义
解决方案 »
- 新手求助
- 如何让电视播放电视节目的同时在屏幕上方或下方显示我程序发送的指定文字或图片信息?
- DBGRID中的LOOKUP字段如何控制
- 请问:RadioGroup如何表示被选中
- 在2000下使用quickrep的问题?
- 关于主从表实现的方法,希望大家给点意见。
- 在DBGRIDEH里面怎么实现下拉单,DX们帮帮忙
- 有关于dll问题
- 当光标移动到按钮上方时, 按钮显示另外一张图片, 移走时又复原. 这是怎样做的?
- 悲哉!!!用delphi做MIS,ERP刚够糊口;而用delphi做网络通信少有人理,没公司要。真是欲哭无泪!!!让人又爱又恨的delphi!!!
- 如何实现在程序关闭时出现提示框选择yes是退出选择no时取消(取消如何做到)???
- 谁会用DELPHI编写WIN 2000中隐藏进程的程序?请帮帮我!快急死了!!!
我的问题是:有六个编辑框,需要随时切换焦点,是否可以直接发键盘消息给窗口,哪个编辑框有焦点就在哪里显示,而不使用编辑框的句柄,这样用PostMessage 可以做到吗?
如果用keybd_event,怎样发送大写或换档字符,谁能详细说明一下。
1 keybd_event(16,16,0,0);
2 keybd_event(186,186,0,0);
3(弹开略去)
哦,Anoa,如果Shift键不放的话会有问题吧,那今后的按键不是Shift一直按着吗?
以小弟之见还是弹开的好,在最后加上keybd_event(16,0,KEYEVENTF_KEYUP,0)
MSDN 里面好象只有名称没有数值,Delphi 的封装又不全,Windows.pas 里的定义缺了好多。
Anoa 是在那里找到的?
当然弹开的好呢,不然就麻烦了:))
你不觉得windows.pas 里的定义不全吗?象, . / ' ; ` - = \ 这些键值我都找不到。里面的键值从165 直接跳到229,186 在哪里呢?
再帮忙一下。