ALFA.SystemInfo.GetExoAppWindow C# (CSharp) Method

GetExoAppWindow() private static method

Get the Exo main app window.
private static GetExoAppWindow ( ) : IntPtr
return System.IntPtr
        private static IntPtr GetExoAppWindow()
        {
            uint ProcessId = (uint)System.Diagnostics.Process.GetCurrentProcess().Id;
            IntPtr ExoAppWindow = IntPtr.Zero;
            uint WindowProcessId;

            do
            {
                ExoAppWindow = FindWindowEx(IntPtr.Zero, ExoAppWindow, ExoAppClassName, null);

                if (ExoAppWindow == IntPtr.Zero)
                {
                    throw new ApplicationException("Couldn't find ExoAppWindow");
                }

                WindowProcessId = 0;
                GetWindowThreadProcessId(ExoAppWindow, out WindowProcessId);
            } while (WindowProcessId != ProcessId);

            return ExoAppWindow;
        }