1
我试图用这个code sample从C#(.NET 3.5)的WinForms应用控制Windows XP屏幕键盘(OSK.exe):查找屏幕键盘的类名?
[DllImport("User32.dll")]public static extern Int32 SetForegroundWindow(int hWnd);
[DllImport("user32.dll")]public static extern int FindWindow(string lpClassName, string lpWindowName);
private void BringToFront(string className,string CaptionName)
{
SetForegroundWindow(FindWindow(className,CaptionName));
}
private void Form1_Load(object sender, EventArgs e)
{
BringToFront("Notepad", "Untitled - Notepad");
}
如何确定准确的className?我假设CaptionName是'屏幕键盘'。