Collector
پنج شنبه 27 بهمن 1390, 21:22 عصر
سلام
من با این کد میخوام فوکوس را به فرم Form1 که یک پروسه جدا هست بدم.اما این کد کار نمیکنه؟
[DllImport("User32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("User32.dll")]
public static extern IntPtr SetFocus(IntPtr hWnd);
SetFocus(FindWindow(null, "Form1"));
من با این کد میخوام فوکوس را به فرم Form1 که یک پروسه جدا هست بدم.اما این کد کار نمیکنه؟
[DllImport("User32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("User32.dll")]
public static extern IntPtr SetFocus(IntPtr hWnd);
SetFocus(FindWindow(null, "Form1"));