使用c ++访问Internet Explorer

时间:2022-06-15 18:04:30

Well as the topic says, I want to know if there is a tool or a tutorial that can help me access IE, get in a certain URL, do some action on that website. So I would have a program to do that for me instead of doing it myself every time.

正如主题所说,我想知道是否有工具或教程可以帮助我访问IE,获取某个URL,在该网站上执行某些操作。所以我会有一个程序为我做这个,而不是每次都这样做。

5 个解决方案

#1


Here is a project on Internet Explorer automation with C++

这是一个使用C ++进行Internet Explorer自动化的项目

#2


you should really rephrase your question.. you said what you want to do is login to hotmail programatically, check the pidgin code, they do it.

你应该真正改写你的问题..你说你想要做的是以编程方式登录hotmail,检查pidgin代码,他们这样做。

Documentation found here , here and you can I think navigate through the code and tutorials at will until you have your understanding of how the pidgin contributors did it.

在这里找到文档,在这里您可以随意浏览代码和教程,直到您了解了pidgin贡献者是如何做到的。

You can find the main page for pidgin here

你可以在这里找到pidgin的主页

Code sample to get you started:

代码示例可帮助您入门:

00362 static void
00363 msn_show_hotmail_inbox(PurplePluginAction *action)
00364 {
00365       PurpleConnection *gc;
00366       MsnSession *session;
00367 
00368       gc = (PurpleConnection *) action->context;
00369       session = gc->proto_data;
00370 
00371       if (session->passport_info.file == NULL)
00372       {
00373             purple_notify_error(gc, NULL,
00374                                       _("This Hotmail account may not be active."), NULL);
00375             return;
00376       }
00377 
00378       purple_notify_uri(gc, session->passport_info.file);
00379 }


00652 void *
00653 purple_notify_uri(void *handle, const char *uri)
00654 {
00655       PurpleNotifyUiOps *ops;
00656 
00657       g_return_val_if_fail(uri != NULL, NULL);
00658 
00659       ops = purple_notify_get_ui_ops();
00660 
00661       if (ops != NULL && ops->notify_uri != NULL) {
00662 
00663             void *ui_handle = ops->notify_uri(uri);
00664 
00665             if (ui_handle != NULL) {
00666 
00667                   PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
00668                   info->type = PURPLE_NOTIFY_URI;
00669                   info->handle = handle;
00670                   info->ui_handle = ui_handle;
00671 
00672                   handles = g_list_append(handles, info);
00673 
00674                   return info->ui_handle;
00675             }
00676       }
00677 
00678       return NULL;
00679 }

#3


Rather than using IE for such things, look into appropriate screen scraping libraries for your language of choice. You can google and search Stack Overflow to find many such libraries. From here, you'll use your language's web APIs to send data to the server.

不要使用IE进行此类操作,而是根据您选择的语言查看适当的屏幕抓取库。您可以谷歌搜索Stack Overflow以查找许多此类库。从这里开始,您将使用语言的Web API将数据发送到服务器。

#4


Don't know of any tool.

不知道任何工具。

I use an embedded browser for such things. It is possible to connect to a running instance of IE. See Connect to Running Instance of IE Once you get an instance of IWebBrowser2, the coding is the same.

我使用嵌入式浏览器来做这些事情。可以连接到正在运行的IE实例。请参阅连接到IE的运行实例获得IWebBrowser2的实例后,编码是相同的。

 1. Get the Document Interface
     pWebBrowser->Document->QueryInterface(
          IID_IHTMLDocument2,(LPVOID*)&Doc);
 2. Get all the elements on the Document
     Doc->get_all(&Elements);
 3. enum the Elements
     Elements->get_length(&ulLen);
     for_each 
        Elements->item(item, index, &ppvElement);
 4. Detemine what element is desired. 
     * by classname
     * by ID etc.. here I used the classname
       ppvElement->get_className (&bstrElement);
 5. Insert Text for user / password
    ppvElement->put_innerText(wsUreser_or_Psswd)
 6. Find the Sign in button and click it.
    ppvElement->Click();

Your results may vary.

您的结果可能会有所不

--

Michael

#5


Why don't you make a feed in dapper in two minutes? Apparently some people have already done it as well.

你为什么不在两分钟内用短小精悍的饲料喂养?显然有些人已经做过了。

#1


Here is a project on Internet Explorer automation with C++

这是一个使用C ++进行Internet Explorer自动化的项目

#2


you should really rephrase your question.. you said what you want to do is login to hotmail programatically, check the pidgin code, they do it.

你应该真正改写你的问题..你说你想要做的是以编程方式登录hotmail,检查pidgin代码,他们这样做。

Documentation found here , here and you can I think navigate through the code and tutorials at will until you have your understanding of how the pidgin contributors did it.

在这里找到文档,在这里您可以随意浏览代码和教程,直到您了解了pidgin贡献者是如何做到的。

You can find the main page for pidgin here

你可以在这里找到pidgin的主页

Code sample to get you started:

代码示例可帮助您入门:

00362 static void
00363 msn_show_hotmail_inbox(PurplePluginAction *action)
00364 {
00365       PurpleConnection *gc;
00366       MsnSession *session;
00367 
00368       gc = (PurpleConnection *) action->context;
00369       session = gc->proto_data;
00370 
00371       if (session->passport_info.file == NULL)
00372       {
00373             purple_notify_error(gc, NULL,
00374                                       _("This Hotmail account may not be active."), NULL);
00375             return;
00376       }
00377 
00378       purple_notify_uri(gc, session->passport_info.file);
00379 }


00652 void *
00653 purple_notify_uri(void *handle, const char *uri)
00654 {
00655       PurpleNotifyUiOps *ops;
00656 
00657       g_return_val_if_fail(uri != NULL, NULL);
00658 
00659       ops = purple_notify_get_ui_ops();
00660 
00661       if (ops != NULL && ops->notify_uri != NULL) {
00662 
00663             void *ui_handle = ops->notify_uri(uri);
00664 
00665             if (ui_handle != NULL) {
00666 
00667                   PurpleNotifyInfo *info = g_new0(PurpleNotifyInfo, 1);
00668                   info->type = PURPLE_NOTIFY_URI;
00669                   info->handle = handle;
00670                   info->ui_handle = ui_handle;
00671 
00672                   handles = g_list_append(handles, info);
00673 
00674                   return info->ui_handle;
00675             }
00676       }
00677 
00678       return NULL;
00679 }

#3


Rather than using IE for such things, look into appropriate screen scraping libraries for your language of choice. You can google and search Stack Overflow to find many such libraries. From here, you'll use your language's web APIs to send data to the server.

不要使用IE进行此类操作,而是根据您选择的语言查看适当的屏幕抓取库。您可以谷歌搜索Stack Overflow以查找许多此类库。从这里开始,您将使用语言的Web API将数据发送到服务器。

#4


Don't know of any tool.

不知道任何工具。

I use an embedded browser for such things. It is possible to connect to a running instance of IE. See Connect to Running Instance of IE Once you get an instance of IWebBrowser2, the coding is the same.

我使用嵌入式浏览器来做这些事情。可以连接到正在运行的IE实例。请参阅连接到IE的运行实例获得IWebBrowser2的实例后,编码是相同的。

 1. Get the Document Interface
     pWebBrowser->Document->QueryInterface(
          IID_IHTMLDocument2,(LPVOID*)&Doc);
 2. Get all the elements on the Document
     Doc->get_all(&Elements);
 3. enum the Elements
     Elements->get_length(&ulLen);
     for_each 
        Elements->item(item, index, &ppvElement);
 4. Detemine what element is desired. 
     * by classname
     * by ID etc.. here I used the classname
       ppvElement->get_className (&bstrElement);
 5. Insert Text for user / password
    ppvElement->put_innerText(wsUreser_or_Psswd)
 6. Find the Sign in button and click it.
    ppvElement->Click();

Your results may vary.

您的结果可能会有所不

--

Michael

#5


Why don't you make a feed in dapper in two minutes? Apparently some people have already done it as well.

你为什么不在两分钟内用短小精悍的饲料喂养?显然有些人已经做过了。