示例#1
0
        public static void CloseAllWindowsOfProcess(int processId)
        {
            EnumWindowsCallbackDelegate d = delegate(IntPtr hWnd, UInt32 lParam)
            {
                UInt32 pid;
                ProcessNativeMethods.GetWindowThreadProcessId(hWnd, out pid);
                if ((int)pid == processId)
                {
                    ProcessNativeMethods.PostMessage(hWnd, ProcessNativeConstants.WM_CLOSE, 0, 0);
                }
                return(true);
            };

            ProcessNativeMethods.EnumWindows(d, 0);
        }
示例#2
0
 private static extern int EnumWindows(EnumWindowsCallbackDelegate callback, IntPtr lParam);
示例#3
0
 private static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsCallbackDelegate lpEnumFunc, IntPtr lParam);
 private static extern int EnumWindows(EnumWindowsCallbackDelegate callback, IntPtr lParam);
示例#5
0
 public static extern void EnumWindows(EnumWindowsCallbackDelegate d, UInt32 lParam);
 private static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsCallbackDelegate lpEnumFunc, IntPtr lParam);
示例#7
0
 static extern bool EnumWindows(EnumWindowsCallbackDelegate callback, int parameter);
示例#8
0
 static extern bool EnumChildWindows(IntPtr handle, EnumWindowsCallbackDelegate callback, int parameter);
示例#9
0
 public static extern int EnumChildWindows(IntPtr hWnd, EnumWindowsCallbackDelegate callback, int lParam);
示例#10
0
 public static extern int EnumWindows(EnumWindowsCallbackDelegate callback, int lParam);