Alex
Alex

Reputation:

Use c++ to access internet explorer

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.

Upvotes: 4

Views: 1914

Answers (5)

Codingday
Codingday

Reputation: 855

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

Upvotes: 0

Ric Tokyo
Ric Tokyo

Reputation: 6575

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.

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.

You can find the main page for pidgin here

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 }

Upvotes: 1

Michael
Michael

Reputation: 106

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.

 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

Upvotes: 0

Ric Tokyo
Ric Tokyo

Reputation: 6575

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

Upvotes: 1

Serafina Brocious
Serafina Brocious

Reputation: 30609

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.

Upvotes: 0

Related Questions