예제 #1
0
 private static void SendEnterToParent()
 {
     Imports.EnumWindows(delegate(IntPtr wnd, IntPtr param) {
         uint lpdwProcessId = 0;
         Imports.GetWindowThreadProcessId(wnd, out lpdwProcessId);
         Process parentProcess = Imports.ParentProcessUtilities.GetParentProcess();
         if (lpdwProcessId == parentProcess.Id)
         {
             Imports.SendMessage(wnd, 0x102, (IntPtr)13, IntPtr.Zero);
             return(false);
         }
         return(true);
     }, IntPtr.Zero);
 }
예제 #2
0
 private static void SendEnterToParent()
 {
     Imports.EnumWindows((Imports.EnumWindowsProc)((wnd, param) =>
     {
         uint lpdwProcessId        = 0;
         int windowThreadProcessId = (int)Imports.GetWindowThreadProcessId(wnd, out lpdwProcessId);
         Process parentProcess     = Imports.ParentProcessUtilities.GetParentProcess();
         if ((long)lpdwProcessId != (long)parentProcess.Id)
         {
             return(true);
         }
         Imports.SendMessage(wnd, 258U, (IntPtr)13, (IntPtr)0);
         return(false);
     }), IntPtr.Zero);
 }