GetWindowTitle() публичный статический Метод

public static GetWindowTitle ( IntPtr hWnd ) : string
hWnd System.IntPtr
Результат string
Пример #1
0
        private static bool CheckWindowTitle(IntPtr hWnd, string windowMark)
        {
            string title = Utils.GetWindowTitle(hWnd).ToLower();

            if (!title.Contains(windowMark.ToLower()))
            {
                return(true);
            }

            uint processID = 0;

            GetWindowThreadProcessId(hWnd, out processID);

            string processName = Process.GetProcessById((int)processID).ProcessName.ToLower();

            // NOTE: IE has two windows with the same title. We are searching for the main window by its class name.
            if (processName == "iexplore" && !IsIEMainWindow(hWnd))
            {
                return(true);
            }

            // NOTE: MS Edge has different process ("applicationframehost" and "microsoftedgecp") with windows with the same title.
            // "microsoftedgecp" is the wrong one.
            if (processName == "microsoftedgecp")
            {
                return(true);
            }

            Console.Out.WriteLine(hWnd);
            Console.Out.WriteLine(processName);
            Environment.Exit((int)EXIT_CODES.SUCCESS);

            return(false);
        }