■34045 / inTopicNo.3) |
Re[1]: マウスボタンの操作について |
□投稿者/ DELI (17回)-(2009/03/17(Tue) 20:43:24)
|
■No34037 (末永 慎一 さん) に返信
やりたいのはこんな事?
mouse_eventの詳細はこれを見てね。
http://msdn.microsoft.com/ja-jp/library/cc410921.aspx
private const UInt32 MOUSEEVENTF_LEFTDOWN = 0x0002;
private const UInt32 MOUSEEVENTF_LEFTUP = 0x0004;
[DllImport("user32.dll")]
private static extern void mouse_event(
UInt32 dwFlags,
UInt32 dx,
UInt32 dy,
UInt32 dwData,
IntPtr dwExtraInfo
);
private void button1_Click(object sender, EventArgs e)
{
System.Drawing.Point p = new System.Drawing.Point(Int32.Parse(textBox1.Text), Int32.Parse(textBox2.Text));
Cursor.Position = p;
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, IntPtr.Zero);
}
|
|