返回鼠标位置,怎么没有回答啊!~~~~~~~~?

libertysigil 2003-08-21 10:18:59
[DllImport("user32.dll")]
private static extern int GetCursorPos([MarshalAs(UnmanagedType.Struct)] ref POINTAPI lpPoint);

返回鼠标在显示器整个屏幕的位置,这个API怎么用?
有实例吗?

...全文
76 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
ArLi2003 2003-08-23
  • 打赏
  • 举报
回复
u can download apiExplorer from:

http://zpcity.com/arli
ArLi2003 2003-08-23
  • 打赏
  • 举报
回复
[DllImport("user32.dll", EntryPoint="GetCursorPos")]
public static extern int GetCursorPos (
ref POINTAPI lpPoint
);

[StructLayout(LayoutKind.Sequential)]
public struct POINTAPI {
public int x;
public int y;
}
libertysigil 2003-08-23
  • 打赏
  • 举报
回复
我看看帮助吧~~~~~~~谢谢了
liduke 2003-08-22
  • 打赏
  • 举报
回复
Cursor.Position是最方便的
pretender1982 2003-08-22
  • 打赏
  • 举报
回复
文档理由说明的,Cursor.Position
TheAres 2003-08-22
  • 打赏
  • 举报
回复
你看看帮助是如何写的。

Cursor.Position 属性 [C#]请参见
Cursor 类 | Cursor 成员 | System.Windows.Forms 命名空间 | Point | Cursor 成员(Visual J# 语法) | C++ 托管扩展编程
要求
平台: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 系列
获取或设置光标位置。

[C#]
public static Point Position {get; set;}


属性值
代表光标位置的 Point(采用屏幕坐标)。

libertysigil 2003-08-22
  • 打赏
  • 举报
回复
我可要返回的是鼠标在整个显示器上的位置,不是窗体上的坐标
TheAres 2003-08-21
  • 打赏
  • 举报
回复
直接使用Cursor.Position就是,不要调用API了。

110,500

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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