Окно Parse Chrome, похожее на IHTMLDocument2

Используя приведенный ниже код, я могу получить дескриптор окна окна Internet Explorer и преобразовать его в объект IHTMLDocument2 для чтения html. Есть ли что-нибудь подобное, что можно использовать для окон Chrome, кроме включения удаленной отладки?

        IHTMLDocument2 document = null;
        int lRes;
        Trace.WriteLine("About to GetWindowHandleByTitle");
        var hWnd = GetWindowHandleByTitle();
        Trace.WriteLine("About to GetWindowHandleByTitle Complete");
        EnumProc proc = EnumWindows;
        EnumChildWindows(hWnd, proc, ref hWnd);
        Trace.WriteLine("Found Child Window");

        if (hWnd.Equals(IntPtr.Zero))
        {
            return null;
        }

        int lngMsg = RegisterWindowMessage("WM_HTML_GETOBJECT");

        if (lngMsg == 0)
        {
            return null;
        }

        SendMessageTimeout(hWnd, lngMsg, 0, 0, SMTO_ABORTIFHUNG, 1000, out lRes);

        if (lRes == 0)
        {
            return null;
        }

        ObjectFromLresult(lRes, ref IID_IHTMLDocument, 0, ref document);

0 ответов

Другие вопросы по тегам