请教键盘输入响应

mobileman 2001-08-03 03:40:36
小弟这两天在为公司写一个触摸屏查询程序.该程序一个模块中用Twebbrowser控件调用了公司的一个增值业务页面,该页面是有输入响应的,由于触摸屏查询程序的特殊性只能在查询程序中用按钮单击事件来代替键盘输入响应,请教各位大虾如何在查询程序中用按钮单击事件来完成对WEB页面的键盘输入响应,谢谢!

...全文
89 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tjf1117 2001-08-03
  • 打赏
  • 举报
回复
描述的不清楚,
是在该页面里面有个键盘么?
如果全是web的形式,用javascript不就可以了?
ddeng 2001-08-03
  • 打赏
  • 举报
回复
用API,具体的给你切出来瞧瞧吧:

VOID keybd_event(
BYTE bVk, // virtual-key code
BYTE bScan, // hardware scan code
DWORD dwFlags, // flags specifying various function options
DWORD dwExtraInfo // additional data associated with keystroke
);

Parameters

bVk

Specifies a virtual-key code. The code must be a value in the range 1 to 254.

bScan

Specifies a hardware scan code for the key.

dwFlags

A set of flag bits that specify various aspects of function operation. An application can use any combination of the following predefined constant values to set the flags:

Value Meaning
KEYEVENTF_EXTENDEDKEY If specified, the scan code was preceded by a prefix byte having the value 0xE0 (224).
KEYEVENTF_KEYUP If specified, the key is being released. If not specified, the key is being depressed.


dwExtraInfo

Specifies an additional 32-bit value associated with the key stroke.



Return Values

This function has no return value.

Remarks

Although keybd_event passes an OEM-dependent hardware scan code to Windows, applications should not use the scan code. Windows converts scan codes to virtual-key codes internally and clears the up/down bit in the scan code before passing it to applications.
An application can simulate a press of the PRINTSCREEN key in order to obtain a screen snapshot and save it to the Windows clipboard. To do this, call keybd_event with the bVk parameter set to VK_SNAPSHOT, and the bScan parameter set to 0 for a snapshot of the full screen or set bScan to 1 for a snapshot of the active window.
tibetty 2001-08-03
  • 打赏
  • 举报
回复
使用SendMessage函数来发相应的消息.

5,927

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧