Ejemplo n.º 1
0
 //Posts a message to the first enumerated window in the first enumerated thread with at least one window, and returns the handle of that window through the hwnd output parameter if such a window was enumerated.  If a window was enumerated, the return value is the return value of the PostMessage call, otherwise the return value is false.
 public static bool PostMessage(this Process p, out IntPtr hwnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
 {
     hwnd = p.WindowHandles().FirstOrDefault();
     if (hwnd != IntPtr.Zero)
     {
         return(Win32Helpers.PostMessage(hwnd, msg, wParam, lParam));
     }
     else
     {
         return(false);
     }
 }