日期:2014-05-18 浏览次数:21019 次
[DllImport("User32.dll", CharSet = CharSet.Auto)]
private static extern int SetWindowPos(IntPtr win_handle, IntPtr win_handle_insert_after, int x, int y, int width, int height, uint flags);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
private const int SWP_NOSIZE = 0x0001;
private void button1_Click(object sender, EventArgs e)
{
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "rundll32.exe";
psi.Arguments = "shell32.dll, Control_RunDLL main.cpl";
Process proc = Process.Start(psi);
Thread.Sleep(100);
SetWindowPos(FindWindow("#32770", "鼠标 属性"), IntPtr.Zero, 0, 10, 0, 0, SWP_NOSIZE);
}