1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| public const int SM_CMOUSEBUTTONS = 43;
[DllImport("user32.dll", EntryPoint = "GetSystemMetrics")]
public extern static int GetSystemMetrics(int intcount);
public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { int jishu = GetSystemMetrics(SM_CMOUSEBUTTONS); textBox1.Text = Convert.ToString(jishu); }
|