关于mouse_event的示例代码:
setcursorpos(20,132);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0); ...
上面的代码表示鼠标的双击,若要表示单击,用两个mouse_event即可(一次放下,一次松开)。
setcursorpos(20,132);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0); ...
上面的代码表示鼠标的双击,若要表示单击,用两个mouse_event即可(一次放下,一次松开)。
解决方案 »
- 初学问题:ToolBar如何显示Caption值??
- 请教winexecandwait32(filename,***);中的***有多少中,用法分别是?
- 请教一个websnap的问题,高手请进!~~~~~~~~~~~~~~~~~~~~~~~~~~
- 哪位大虾能写段例程如何使用Win32API函数 NetShareAdd()和NetShareDel(),在线...
- 春节来临之际,祝各位大侠 百事可了,万事OK!准备方分400!
- 想做一个杀毒的软件
- 怎样给dxdbgrid或dxdbTreelist的某一个单元格添加背景图片或设置背景颜色?
- ADO 与 BDE 到底有什么异同? 谁好,好在那里?
- 怎样给一个数据表的字段赋空值?
- 请教ListView中的Item排列问题?
- 那里有installshield的使用方法,谢谢
- 怎样缩短Socket连接的时间?
The keybd_event function synthesizes a keystroke. The system can use such a synthesized keystroke to generate a WM_KEYUP or WM_KEYDOWN message. The keyboard driver's interrupt handler calls the keybd_event function. Windows NT: This function has been superseded. Use SendInput instead.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.
sendmessage(button1.handle,wm_lbuttonup,0,0)