Open Mail[Hotmail] w/Webbrowser Control

ludamizleeto

New member
Joined
Oct 7, 2009
Messages
3
Programming Experience
10+
Yes, I'm making a program that signs into Hotmail and auto reads all the messages. I just can't figure out how to invoke, click to open the first message.

I am using the Webbrowser Control which I know is so flexible if you know what your doing. I do see that the whole inbox is in a table so i don't know if I need to approach that in that manner or not. I spent 5 hours last night trying to figure this out.

Here is the html code of the inbox inside of hotmail. The very first emails subject is" Dailymotion registration confirmation.

Html Code:

Code:

VB.NET:
        <div id="messageListScrollableContainer" class="MessageListItems ClearBoth" onscroll="InboxPage.onMessageListScroll(this)">
            <div id="messageListContentContainer">

<table class="InboxTable" cellspacing="0" cellpadding="0"><colgroup><col class="CheckBoxCol"/><col class="IconCol"/><col class="FromCol"/><col class="ImportanceCol"/><col class="AttachmentCol"/><col class="SubjectCol"/><col class="DateCol"/></colgroup><tbody onclick="return Control.invoke('MessageList', '_onBodyClick', event);" ondblclick="return Control.invoke('MessageList', '_onDblClick', event);"><tr  class="InboxContentItemUnread" id="0d8e75ca-f51a-11de-adee-00215ad9df98" msg="msg" mad="0|0|8CC573DF2CB5230||" ><td class="Chk" name="msgChkCell" unselectable="on">

<input type="checkbox" name="msgChk"  title="Select message"/></td><td class="Ico"><img src="./clear.gif" class="i_new" alt="Unread"/></td><td class="Frm"><a>

Dailymotion Notifications</a></td><td class="Imp"></td><td class="Att"></td><td class="Sbj">

<a href="javascript:;">Dailymotion registration confirmation‏</a></td><td class="Dat">8:05 AM</td></tr><tr  class="InboxContentItemUnread" id="5cdbf4fa-efac-11de-a6d1-00237de49116" msg="msg" mad="0|0|8CC51D043CD4210||" ><td class="Chk" name="msgChkCell" unselectable="on"><input type="checkbox" name="msgChk"  title="Select message"/></td><td class="Ico"><img src="./clear.gif" class="i_new" alt="Unread"/></td><td class="Frm"><a>Windows Live Team</a></td><td class="Imp"></td><td class="Att"></td><td class="Sbj"><a href="javascript:;"

>Welcome to Windows Live Hotmail - You picked a great time to join in‏</a></td><td class="Dat">12/23/09</td></tr><tr  class="InboxContentItemUnread" id="cad5465d-6fb2-4bdc-a497-82c293d490d5" msg="msg" mad="10|0|8CC4F5C53D23D30||" ><td class="Chk" name="msgChkCell" unselectable="on"><input type="checkbox" name="msgChk"  title="Select message"/></td><td class="Ico"><img src="./clear.gif" class="i_new" alt="Unread"/></td><td class="Frm"><a>Windows Live Hotmail Member Services</a></td><td class="Imp"></td><td class="Att"></td><td class="Sbj"><a href="javascript:;">Getting started with Windows Live Hotmail‏</a></td><td class="Dat">12/20/09</td></tr></tbody></table></div>
        </div>
        <div class="PaginationContainer BorderTop">
            <div class="PageNavigationMsgRange">3 messages</div><div class="PageNavigation FloatRight" onclick="return Control.invoke('MessageList', '_onNavClick', event);"><ul><li><div >Page</div></li><li pnCur="1" pnAm="0d8e75ca-f51a-11de-adee-00215ad9df98" pnAd="2009-12-30T08:05:13.043Z" pnDir="FirstPage" pnMid="2" pnSkip="0"><a href="javascript:;" title="Go to page 1"  class="PrimaryTextColor BoldText">1</a></li><li ><div><img class="PageNavigationPrev" src="http://gfx1.hotmail.com/mail/w4/pr01/ltr/i_prev_page_disable.gif" alt="Previous page"/></div></li><li ><div><img class="PageNavigationNext" src="http://gfx1.hotmail.com/mail/w4/pr01/ltr/i_next_page_disable.gif" alt="Next page"/></div></li></ul></div>

        </div>
    </div>
</div>
            </div>
        </div>
        <div id="readingPaneSplitter"  class="SplitterBar SplitterBarHidden"></div>
        <div id="readingPaneSplitPane"  class="ReadingPaneSplitPane ReadingPaneSplitPaneFull ReadingPaneSplitPaneHidden">
            <div id="actionBar" class="ActionBar BorderBottom" style="visibility:hidden;" onclick="return Control.invokeStatic('Toolbar', 'onclick', event, Control.lookup(event.srcElement, 'aId'));">
                <div class="Toolbar">
		            <ul>
		                
<li aId="ReplyButton" class="ToolbarItem "  style="display:none;"><a  title="Reply (Ctrl+R)" href="javascript:;" id="ReplyButton"  onclick="PerfRecorder.startTimer(false, 'COR');">
    <span class="Label">Reply</span></a></li>

Thank you so much this means so much to me, so much!
 
Call To An IFrame Within A Webbrowser Control

I am using a Webbrowser control to sign into Hotmail. Then once it is signed in then I'll just use this navigate code to open the inbox:

I think that the problem is that the actual inbox(mail window) is within an iframe. I have to figure out how to call within the iframe.

If you can goto hotmail and sign in and you'll see once your in the inbox when you view source it isn't the inbox's source but then when you right click then goto this frame then view the source to the frame it is.

VB.NET:
WebBrowser1.Navigate("http://g.live.com/9uxp9en-us/hdr_main4??su=http://shared.live.com/Live.Mail")

Now my problem from this point on is how to open the very first email. I have tried using my click link code that I have, I have tried everything. I have spent 3 days searching the net and trying different stuff. I know that it's 100 percent possible. I am praying that someone that is a Webbrowser Control Genius can help me!

Maybe this can help, this is some html to the page where the inbox is. This isn't the inbox's source but thought that this could help. This is what is calling to the iframe :

VB.NET:
function loadIM(q)
    {
        if (gLoadIM &&
            (!q || q.indexOf('nwi=1') < 0)) 
        {
            gLoadIM = false;
            var win = getUiWindow(), loc = win.location;
            gUIFrameBaseUrl = loc.host;
            var imFrame = document.getElementById("IMFrame");
            if (imFrame)
            {
                imFrame.src = [loc.protocol, "//", gUIFrameBaseUrl, "/im/pages/im.aspx"].join("");
            }
            imFrame = null;
        }
   }


    function uiFrameLoad()
    {
        //
        try
        {
            if(!isPersistenceInline)
            {
                document.title = window.frames[0].document.title;
            }

            if (gLoadIM)
            {
                loadIM(getUiWindow().location.search); 
            }

        }
        catch(e)
        {
        }
    }
    function beforeUnloadHandler()
    {
        try
        {
            var frameUrl = getUiWindow().document.location.href;
            document.cookie = "afu=" + escape(frameUrl) + ";path=/;domain=.mail.live.com;";
        }
        catch(e)
        {
        }
    }
    function getUiFrame()
    {
        return document.getElementById("UIFrame");
    }
    function getUiFrameOrBody()
    {
        return isPersistenceInline ? document.body : getUiFrame();
    }
    function getUiWindow()
    {
        return isPersistenceInline ? window : getUiFrame().contentWindow;
    }
    function makePersistenceStandalone()
    {
        isPersistenceInline = false;

        var imFrame = document.getElementById("IMFrame");
        if(imFrame && imFrame.contentWindow.updateUIFrameRef)
        {
            imFrame.contentWindow.updateUIFrameRef();
        }

    }
    function redirectToLandingPage()
    {
        if(!isPersistenceInline)
        {
            getUiFrame().src = 'http\x3a\x2f\x2fbl136w.blu136.mail.live.com\x2fmail\x2fInboxLight.aspx\x3fFolderID\x3d00000000-0000-0000-0000-000000000001\x26InboxSortAscending\x3dFalse\x26InboxSortBy\x3dDate\x26n\x3d74874372';
        }
    }
</script>

</head>
<body style="padding:0;margin:0;overflow:visible;height:100%;width:100%;position:absolute;" onbeforeunload="beforeUnloadHandler()">

    
<div id="appDiv" style="position:absolute;height:100%;width:100%;">
    <iframe id="UIFrame" name="UIFrame"  src="http://bl136w.blu136.mail.live.com/mail/InboxLight.aspx?FolderID=00000000-0000-0000-0000-000000000001&InboxSortAscending=False&InboxSortBy=Date&n=74874372" onload="uiFrameLoad();"
        frameborder="0"
        width="100%"
        height="100%"
        marginheight="0"
        marginwidth="0">
    </iframe>

    <iframe id="IMFrame" frameborder="0" width="0" height="0" src=""></iframe>

</div>

This is the source to inbox which is within the iframe:

VB.NET:
<table class="InboxTable" cellspacing="0" cellpadding="0"><colgroup><col class="CheckBoxCol"/><col class="IconCol"/><col class="FromCol"/><col class="ImportanceCol"/><col class="AttachmentCol"/><col class="SubjectCol"/><col class="DateCol"/></colgroup><tbody onclick="return Control.invoke('MessageList', '_onBodyClick', event);" ondblclick="return Control.invoke('MessageList', '_onDblClick', event);"><tr  id="fe43dd91-f643-11de-aaa1-00215ad7dbba" msg="msg" mad="40|0|8CC5867E5DB5630||" ><td class="Chk" name="msgChkCell" unselectable="on"><input type="checkbox" name="msgChk"  title="Select message"/></td><td class="Ico"><img src="./clear.gif" class="i_read" alt="Read"/></td><td class="Frm"><a>Dailymotion Notifications</a></td><td class="Imp"></td><td class="Att"></td><td class="Sbj"><a href="javascript:;">Dailymotion registration confirmation‏</a></td><td class="Dat">Yesterday</td></tr><tr  class="InboxContentItemUnread" id="593d12f7-5ca0-4901-b83b-49dc4dbf5cbe" msg="msg" mad="10|0|8CC4F5C59B09E90||" ><td class="Chk" name="msgChkCell" unselectable="on"><input type="checkbox" name="msgChk"  title="Select message"/></td><td class="Ico"><img src="./clear.gif" class="i_new" alt="Unread"/></td><td class="Frm"><a>Windows Live Hotmail Member Services</a></td><td class="Imp"></td><td class="Att"></td><td class="Sbj"><a href="javascript:;">Getting started with Windows Live Hotmail‏</a></td><td class="Dat">12/20/09</td></tr></tbody></table></div>

        </div>
        <div class="PaginationContainer BorderTop">
            <div class="PageNavigationMsgRange">2 messages</div><div class="PageNavigation FloatRight" onclick="return Control.invoke('MessageList', '_onNavClick', event);"><ul><li><div >Page</div></li><li pnCur="1" pnAm="fe43dd91-f643-11de-aaa1-00215ad7dbba" pnAd="2009-12-31T19:38:01.363Z" pnDir="FirstPage" pnMid="2" pnSkip="0"><a href="javascript:;" title="Go to page 1"  class="PrimaryTextColor BoldText">1</a></li><li ><div><img class="PageNavigationPrev" src="http://gfx1.hotmail.com/mail/w4/pr01/ltr/i_prev_page_disable.gif" alt="Previous page"/></div></li><li ><div><img class="PageNavigationNext" src="http://gfx1.hotmail.com/mail/w4/pr01/ltr/i_next_page_disable.gif" alt="Next page"/></div></li></ul></div>

        </div>
    </div>
</div>
            </div>

        </div>
        <div id="readingPaneSplitter"  class="SplitterBar SplitterBarHidden"></div>
        <div id="readingPaneSplitPane"  class="ReadingPaneSplitPane ReadingPaneSplitPaneFull ReadingPaneSplitPaneHidden">
            <div id="actionBar" class="ActionBar BorderBottom" style="visibility:hidden;" onclick="return Control.invokeStatic('Toolbar', 'onclick', event, Control.lookup(event.srcElement, 'aId'));">
                <div class="Toolbar">
		            <ul>
		                
<li aId="ReplyButton" class="ToolbarItem "  style="display:none;"><a  title="Reply (Ctrl+R)" href="javascript:;" id="ReplyButton"  onclick="PerfRecorder.startTimer(false, 'COR');">
    <span class="Label">Reply</span></a></li>

    
<li aId="ReplyAllButton" class="ToolbarItem "  style="display:none;"><a  title="Reply all (Ctrl+Shift+R)" href="javascript:;" id="ReplyAllButton"  onclick="PerfRecorder.startTimer(false, 'COR');">
    <span class="Label">Reply all</span></a></li>
    
<li aId="ForwardButton" class="ToolbarItem "  style="display:none;"><a  title="Forward (Ctrl+Shift+F)" href="javascript:;" id="ForwardButton"  onclick="PerfRecorder.startTimer(false, 'COR');">
    <span class="Label">Forward</span></a></li>
<li id="BeforeNextPrevPipe" class="ToolbarItem"  style="display:none;"><span class="ToolbarPipe">|</span></li>
    
<li aId="NextButton" class="ToolbarItem ToolbarItemThinRightPadding" style="display:none;"><a title="Next message (Ctrl+.)" href="javascript:;"  id="NextButton"><img src="./clear.gif" class="i_next" title="Next message (Ctrl+.)" alt="Next message"/></a></li>
    
<li aId="PreviousButton" class="ToolbarItem ToolbarItemThinLeftPadding" style="display:none;"><a title="Previous message (Ctrl+,)" href="javascript:;"  id="PreviousButton"><img src="./clear.gif" class="i_previous" title="Previous message (Ctrl+,)" alt="Previous message"/></a></li>

                        <li class="ToolbarItem ToolbarItemLast FloatRight CloseButton"><a aId="CloseButton" href="javascript:;"><img src="./clear.gif" class="glyph_close_rest" title="Click here to close the full message view (Esc)" alt="Click here to close the full message view"/></a></li>
                        <li class="ToolbarItem ToolbarItemLast FloatRight FullViewButton"><a aId="FullViewButton" href="javascript:;"><span class="Label">Full view</span></a></li>

I didn't post all the code I just posted what I though was important.

Who every can help me with this, I will do anything for you lol. I would love to give you something for your help. This is how much this means to me and I have just gave it all the sweat and blood that I can :)

Thank you so very much and God Bless,

Thomas
 
Back
Top