{"id":175,"date":"2007-07-18T01:23:38","date_gmt":"2007-07-18T01:23:38","guid":{"rendered":"http:\/\/dalelane.co.uk\/blog\/?p=175"},"modified":"2007-07-19T17:52:25","modified_gmt":"2007-07-19T17:52:25","slug":"a-delicious-plugin-for-windows-mobile-or-c-is-a-pain","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=175","title":{"rendered":"A del.icio.us plugin for Windows Mobile (or C++ is a pain)"},"content":{"rendered":"<p><img decoding=\"async\" src=\"post-images\/070717-delicious1.gif\" align=\"right\" hspace=\"10\" alt=\"screenshot\"\/>Increasingly, I&#8217;m doing more of my (non-work) web browsing on my PDA. <\/p>\n<p>And as a big fan of using <a target=\"_blank\" href=\"http:\/\/del.icio.us\/\">del.icio.us<\/a> to store and share interesting sites that I come across, I&#8217;ve missed the tools you can get for desktop browsers (like <a href=\"http:\/\/del.icio.us\/help\/ie\/extension\" target=\"_blank\">Internet Explorer<\/a> or <a href=\"http:\/\/del.icio.us\/help\/firefox\/extension\" target=\"_blank\">Firefox<\/a>) that let you throw your current page at your del.icio.us list. <\/p>\n<p>If you&#8217;ve not used them before, the idea is to have a popup window that gets prefilled with the URL and name of the page you are looking at in your browser, lets you add a few tags, then submit it to del.icio.us when you hit &#8216;Save&#8217;. <\/p>\n<p>So I thought I&#8217;d have a go at creating something similar for Pocket Internet Explorer &#8211; the browser you get with Windows Mobile. <\/p>\n<p>To cut a long story short, I&#8217;ve put something together and it seems to work. If you have a Windows Mobile PDA and fancy giving it a try, <strong><a href=\"http:\/\/dalelane.co.uk\/files\/posttodelicious.zip\">feel free to give it a go<\/a><\/strong>. <\/p>\n<p><!--more-->To go into a little more detail&#8230; it was more of a pain than I expected. \ud83d\ude42<\/p>\n<p><img decoding=\"async\" src=\"post-images\/070717-delicious0.gif\" align=\"left\" hspace=\"10\" alt=\"screenshot\"\/>Internet Explorer really isn&#8217;t the most friendly beast to the plugin writer! Basically, I needed to write a DLL in C++ that hooked into one of the menu extensions in Pocket Internet Explorer. <\/p>\n<p>This is not as trivial as I expected &#8211; it took hundreds and hundreds of lines of code just to get a new entry in the Internet Explorer&#8217;s menu that gets me access to the web browser object as an <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/bb159694.aspx\" target=\"_blank\">IWebBrowser2<\/a>. And (perhaps especially so for someone who has been getting a little lazy with Java and C#! \ud83d\ude09 ), some of it is a little intricate and complex. <\/p>\n<p>Still, once done I could use my access to the browser to launch my &#8220;post to del.icio.us&#8221; form and prefill it with the URL and page name of PIE&#8217;s current page. From there, the form uses the public del.icio.us API to send all the info off to my del.icio.us list. <\/p>\n<p>I should say a few thanks&#8230; I was helped out in my hacking from a few places:<\/p>\n<ul>\n<li><a href=\"http:\/\/blogs.msdn.com\/iemobile\/attachment\/570375.ashx\" target=\"_blank\">A Microsoft presentation on developing for Pocket Internet Explorer as a platform<\/a> &#8211; with a list of the extension points you can get into with a DLL<\/li>\n<li><a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms880651.aspx\" target=\"_blank\">A code sample from Microsoft on context menu extensions<\/a> &#8211; it&#8217;s a nice start that helped me get up to speed on writing code to hook into them<\/li>\n<li><a href=\"http:\/\/forums.microsoft.com\/MSDN\/ShowPost.aspx?PostID=1851828&#038;SiteID=1\" target=\"_blank\">A pointer I got from an MSDN forum on building projects with IWebBrowser2 in Visual Studio<\/a><\/li>\n<li><a href=\"http:\/\/sourceforge.net\/projects\/netlicious\/\" target=\"_blank\">The .NET del.icio.us API code I found on SourceForge<\/a> &#8211; modified a bit to be able to run on the .NET Compact Framework you get on Windows Mobile, but still saved me some time in having to prepare the web request and reading the response<\/li>\n<li><a href=\"http:\/\/del.icio.us\/help\/api\/\">The official del.icio.us API documentation<\/a><\/li>\n<\/ul>\n<p><strong>Update 19\/07\/2007:<\/strong> The <a href=\"http:\/\/dalelane.co.uk\/files\/posttodelicious.zip\">zip file<\/a> is now packaged as a CAB file which you can run on your PDA. This handles the registering of the DLL for you. (<em>I really should have done it this way to start with&#8230; sorry!<\/em>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Increasingly, I&#8217;m doing more of my (non-work) web browsing on my PDA. And as a big fan of using del.icio.us to store and share interesting sites that I come across, I&#8217;ve missed the tools you can get for desktop browsers (like Internet Explorer or Firefox) that let you throw your current page at your del.icio.us [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-175","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=175"}],"version-history":[{"count":0,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/175\/revisions"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}