this is my code:
using (Process game = Process.Start(new ProcessStartInfo() {
FileName=\"DatabaseCheck.exe\",
RedirectStandardOu
A workaround is to enumerate through all top-level windows and examine their process ids until you find a match...
[DllImport("user32.dll")]
public static extern IntPtr FindWindowEx(IntPtr parentWindow, IntPtr previousChildWindow, string windowClass, string windowTitle);
[DllImport("user32.dll")]
private static extern IntPtr GetWindowThreadProcessId(IntPtr window, out int process);
private IntPtr[] GetProcessWindows(int process) {
IntPtr[] apRet = (new IntPtr[256]);
int iCount = 0;
IntPtr pLast = IntPtr.Zero;
do {
pLast = FindWindowEx(IntPtr.Zero, pLast, null, null);
int iProcess_;
GetWindowThreadProcessId(pLast, out iProcess_);
if(iProcess_ == process) apRet[iCount++] = pLast;
} while(pLast != IntPtr.Zero);
System.Array.Resize(ref apRet, iCount);
return apRet;
}