//最大化視窗無法使用 using System.Runtime.InteropServices; [DllImport("User32.dll", EntryPoint = "FindWindow")] private static extern int FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")] static extern bool ShowWindow(int hWnd, int nCmdShow); private void SetActiveWindow() { //If the window state of the inactive window is maximize, this code doesn't work. int WINDOW_HANDLER = FindWindow(null, @"Piriform CCleaner"); if (WINDOW_HANDLER == 0) { } else { ShowWindow(WINDOW_HANDLER, 3); } }
2011年7月4日 星期一
用視窗標題激活視窗

訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言