如何让鼠标自动产生动作?

xxc1981 2003-08-24 07:58:41
如何让鼠标自动产生动作?如在屏幕上移动,点击?
好象调用系统API可以,不知道.net类库里面有没有办法??
...全文
61 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
雪狼1234567 2003-08-24
  • 打赏
  • 举报
回复
发送消息,用SendMessage
[DllImport("User32.dll",EntryPoint="SendMessage")]
private static extern int SendMessage(
int hWnd, // handle to destination window
int Msg, // message
int wParam, // first message parameter
string lParam // second message parameter
);


[STAThread]
public static void Main()
{
Application.Run(new Form2());
}

private void textBox1_TextChanged(object sender, System.EventArgs e)
{
this.listBox1.SelectedIndex = SendMessage((int)this.listBox1.Handle,LB_FINDSTRING,-1, this.textBox1.Text);

}
zyycode 2003-08-24
  • 打赏
  • 举报
回复
用API呀

110,533

社区成员

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

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

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