Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1683332
  • 博文数量: 584
  • 博客积分: 13857
  • 博客等级: 上将
  • 技术积分: 11883
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-16 09:34

分类: WINDOWS

2011-04-06 17:08:40

Synthesizes keystrokes, mouse motions, and button clicks.

Syntax
UINT WINAPI SendInput(
__in  UINT nInputs,
__in  LPINPUT pInputs,
__in  int cbSize
);

Parameters nInputs [in]

Type: UINT

The number of structures in the pInputs array.

pInputs [in]

Type: LPINPUT

An array of structures. Each structure represents an event to be inserted into the keyboard or mouse input stream.

cbSize [in]

Type: int

The size, in bytes, of an structure. If cbSize is not the size of an INPUT structure, the function fails.

Return Value

Type: UINT

The function returns the number of events that it successfully inserted into the keyboard or mouse input stream. If the function returns zero, the input was already blocked by another thread. To get extended error information, call .

This function fails when it is blocked by UIPI. Note that neither nor the return value will indicate the failure was caused by UIPI blocking.

Remarks

This function is subject to UIPI. Applications are permitted to inject input only into applications that are at an equal or lesser integrity level.

The SendInput function inserts the events in the structures serially into the keyboard or mouse input stream. These events are not interspersed with other keyboard or mouse input events inserted either by the user (with the keyboard or mouse) or by calls to , , or other calls to SendInput.

This function does not reset the keyboard's current state. Any keys that are already pressed when the function is called might interfere with the events that this function generates. To avoid this problem, check the keyboard's state with the function and correct as necessary.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll
阅读(730) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~