109,884
社区成员




public partial class Form1 : Form
{
public Form1() {
InitializeComponent();
}
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int uMsg, IntPtr wParam, IntPtr lParam);
public const int WM_LBUTTONDOWN = 0x201;
public const int WM_LBUTTONUP = 0x202;
private void button1_Click(object sender, EventArgs e) {
SendMessage((IntPtr)(0x0005072A), WM_LBUTTONDOWN, IntPtr.Zero, (IntPtr)(0x000F000F));
Thread.Sleep(500);
SendMessage((IntPtr)(0x0005072A), WM_LBUTTONUP, IntPtr.Zero, (IntPtr)(0x000F000F));
}
}
public partial class Form1 : Form
{
public Form1() {
InitializeComponent();
}
private void Form1_MouseDown(object sender, MouseEventArgs e) {
this.Text = "MouseDown" + e.Location.ToString();
}
private void Form1_MouseUp(object sender, MouseEventArgs e) {
this.Text = "MouseUp" + e.Location.ToString();
}
private void button1_Click(object sender, EventArgs e) {
MessageBox.Show("MouseClick");
}
}
private const Int32 WM_LBUTTONDOWN = 0x201;
private const Int32 WM_LBUTTONUP = 0x202;
PostMessage(hWnd, WM_LBUTTONDOWN, 0, 0);
PostMessage(hWnd, WM_LBUTTONUP, 0, 0);