C# Process.MainWindowHandle always returns IntPtr Zero

后端 未结 3 889
情歌与酒
情歌与酒 2020-12-01 14:24

this is my code:

            using (Process game = Process.Start(new ProcessStartInfo() { 
        FileName=\"DatabaseCheck.exe\",
        RedirectStandardOu         


        
3条回答
  •  情深已故
    2020-12-01 15:24

    while (!proc.HasExited)
    {
        proc.Refresh();
        if (proc.MainWindowHandle.ToInt32() != 0)
        {
            return proc.MainWindowHandle;
        }
    }
    

提交回复
热议问题