如何获取chrome ver 29的当前URL [英] how to get current URL for chrome ver 29

查看:94
本文介绍了如何获取chrome ver 29的当前URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是c ++程序初学者。



我使用函数FindWindows(),EnumChildWindow()和GetWindowText()获取chrome的当前URL,但现在不能正常工作。



通过使用spy ++,我无法找到带有chrome的URL窗口的句柄和类版本29 ...所以我的旧解决方案不再起作用。



我搜索了谷歌,但我仍然找不到解决方案。



谁能为我提供解决方案?谢谢...

Hi,
I am a c++ program beginner.

I used functions FindWindows() , EnumChildWindow() and GetWindowText() to get the current URL of chrome, but it is not work now.

By using spy++, I can't find the handle and class for the URL window with chrome ver 29...so my old solution doesn't work anymore.

I have searched google , but I still not find a solution.

Can anyone give a solution for me? thanks...

推荐答案

您好Shawn.Liao

此主题/问题已在此网站获得

请看这里:

帮助我获取Google Chrome中当前标签的所有网址 [ ^ ]

如何从任何网页浏览器获取URL(如firefox,即google) C#中的chrome,...) [ ^ ]



问候,

Alex
Hi Shawn.Liao
This topic/question has already been on this site
Please see here:
Help me to get all url of current tabs in google chrome[^]
how to get URL form any web browser (like firefox,ie,google chrome,...) in C#[^]

Regards,
Alex


在这个例子中,有许多有用的功能!!

它们很容易使用main();



http://msdn.microsoft.com/en-us/library/windows/desktop/dd373640(v = vs.85).aspx [ ^ ]



With this Example,there are many useful functions!!
And they are easy to use in main();

http://msdn.microsoft.com/en-us/library/windows/desktop/dd373640(v=vs.85).aspx[^]

#include <Windows.h>
#include <Oleacc.h>
HWINEVENTHOOK g_hook;
#pragma comment( lib,"Oleacc.lib")

int main()
{
     MSG msg;

     InitializeMSAA();

     while ( GetMessage(&msg, NULL, 0, 0) )
     {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
     }

     ShutdownMSAA();
     return 0;
}





在SetWinEventHook()...

你最好得到首先是chrome.exe的进程ID。(你可以从任务管理器获得PID)

我选择从EVENT_OBJECT_VALUECHANGE到EVENT_OBJECT_VALUECHANGE的事件



并在void CALLBACK HandleWinEvent()

您将看到get_accName()。它将获得对象名称

但是还有另一个函数get_accValue(),你会在使用后看到url。



get_accName()将获得对象名称。

示例:地址和搜索栏

get_accValue()将获得对象值....

此值为URL。示例:http://www.google.com/



In SetWinEventHook()...
You'd better to get the "Process ID" of chrome.exe first.(you can get PID from task manager)
I choice the event from EVENT_OBJECT_VALUECHANGE to EVENT_OBJECT_VALUECHANGE

And in void CALLBACK HandleWinEvent()
You will see get_accName(). It will get the Object Name
But there is another function get_accValue() , you will see url after use it.

get_accName() will get the Object Name.
Example:Address and search bar
get_accValue() will get the Object Value....
This value is URL. Example: http://www.google.com/


Hallo,我有同样的问题。

似乎谷歌在Chrome设计中做了一些改动从谷歌浏览器获取网址是不可能的。

。更改来自版本28或29.

我也尝试通过IAccessible接口,通过EnumChildWindow,FindWindowEx

我搜索了所有互联网但没有成功。

我还需要
Hallo, I have same problem.
It seems that google made some changes in the chrome design and it is not more possible
to get url from google chrome. Change is from version 28 or 29.
I tried also via IAccessible interface, via EnumChildWindow, FindWindowEx
I searched all the Internet with no success.
I need IT ALSO


这篇关于如何获取chrome ver 29的当前URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆