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单元定义
解决方案 »
- 分布式开发不能更新视图数据
- TRichEdit怎样新增的内容到最后一行?
- 一个输入自动触发的问题(急急....)
- 默认端口和其他软件使用过的端口我还可以使用吗?
- 我用servers组件WordDocument1.Range.Paste,不能张贴图像,如何解决?
- 怎样实现自动填写用户名与密码并自动点击提交按钮
- delphi如果调用outlook
- ClientDataSet控件的ProviderName属性问题!!!!!!
- /**********************junglerover(灌木丛)的问题:怎样才能从OLECONTAINER控件中得到WORDDOCUMENT对象?********************/
- 用 TRichEdit编的记事本不能输入中文?
- 如何实现在程序关闭时出现提示框选择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 在哪里呢?
再帮忙一下。