网站首页  词典首页

请输入您要查询的函数:

 

术语 setcursorpos
释义 SetCursorPos
语法:
BOOL SetCursorPos( int X,
int Y
);
SetCursorPos函数
将光标移动到指定的屏幕坐标。如果新的坐标,并不在屏幕矩形最近ClipCursor函数调用设置,系统自动调整坐标,使光标停留在矩形。
参数
X
[in]指定新的x坐标光标在屏幕坐标。
y
[in]指定新的y坐标光标在屏幕坐标。
返回值
如果成功则返回非零或否则为0。为了获得更多错误信息,调用GetLastError。
备注
光标是一个共享资源。阿窗口应该将光标移到只有当光标在窗口的客户区域。
调用进程必须具有WINSTA_WRITEATTRIBUTES访问窗口站。
输入桌面必须是当前的桌面当您调用SetCursorPos。呼叫OpenInputDesktop,以确定是否当前的桌面是输入桌面。如果不是,请与OpenInputDesktop返回切换到该桌面HDESK SetThreadDesktop。
例如
有关示例,请参阅使用键盘来移动光标。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为Unicode版本。
参见
游标概述,ClipCursor,GetCursorPos,SetCaretPos,SetCursor,ShowCursor
==英文原文==SetCursorPos Function
Moves the cursor to the specified screen coordinates. If the new coordinates are not within the screen rectangle set by the most recent ClipCursor function call, the system automatically adjusts the coordinates so that the cursor stays within the rectangle.
Syntax
BOOL SetCursorPos( int X,
int Y
);
Parameters
X
[in] Specifies the new x-coordinate of the cursor, in screen coordinates.
Y
[in] Specifies the new y-coordinate of the cursor, in screen coordinates.
Return Value
Returns nonzero if successful or zero otherwise. To get extended error information, call GetLastError .
Remarks
The cursor is a shared resource. A window should move the cursor only when the cursor is in the window's client area.
The calling process must have WINSTA_WRITEATTRIBUTES access to the window station.
The input desktop must be the current desktop when you call SetCursorPos. Call OpenInputDesktop to determine whether the current desktop is the input desktop. If it is not, call SetThreadDesktop with the HDESK returned by OpenInputDesktop to switch to that desktop.
Example
For an example, see Using the Keyboard to Move the Cursor .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as Unicode version.
See Also
Cursors Overview , ClipCursor , GetCursorPos , SetCaretPos , SetCursor , ShowCursor
==原始网址==http://msdn.microsoft.com/en-us/library/ms648394(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:17:59