<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Windows CE Programming &#187; Compact Framework</title>
	<atom:link href="http://www.hjgode.de/wp/tag/compact-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hjgode.de/wp</link>
	<description>Windows Mobile Development and usage</description>
	<lastBuildDate>Fri, 03 Feb 2012 08:53:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<!--CodeProjectFeeder channel--><category>CodeProject</category><generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>All you need to know about unicode</title>
		<link>http://www.hjgode.de/wp/2011/03/18/all-you-need-to-know-about-unicode/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=all-you-need-to-know-about-unicode</link>
		<comments>http://www.hjgode.de/wp/2011/03/18/all-you-need-to-know-about-unicode/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 15:55:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[multibyte]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf]]></category>
		<category><![CDATA[utf-16]]></category>
		<category><![CDATA[utf-8]]></category>
		<category><![CDATA[widebyte]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1085</guid>
		<description><![CDATA[Recently I stumbled about this great article about ASCII, 7 and 8 Bit, codepages, Multi byte, Wide byte and unicode: http://www.joelonsoftware.com/articles/Unicode.html If you ever get in trouble with wrong encoding display of chars, give this article a try to know the backgrounds. As you know, Windows CE and Windows Mobile  is always unicode except for [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I stumbled about this great article about ASCII, 7 and 8 Bit, codepages, Multi byte, Wide byte and unicode: http://www.joelonsoftware.com/articles/Unicode.html</p>
<p>If you ever get in trouble with wrong encoding display of chars, give this article a try to know the backgrounds.</p>
<p>As you know, Windows CE and Windows Mobile  is always unicode except for serial and socket communication. But the truetype fonts available on Windows Mobile devices mostly support only common chars, there file size is about 600K. The file size of Arial Unicode MS is about 22MB.</p>
<p>regards</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;title=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;title=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;title=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;T=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F18%2Fall-you-need-to-know-about-unicode%2F&amp;t=All+you+need+to+know+about+unicode" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/03/18/all-you-need-to-know-about-unicode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Development &#8211; Simple serial communication application</title>
		<link>http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-simple-serial-communication-application</link>
		<comments>http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 14:31:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[SerialPort]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1072</guid>
		<description><![CDATA[Here is a simple application to connect to a serial port. The idea is based on the need of having an application to send demo print files to a virtual comm port connected to a bluetooth printer. Update 16. March 2011: Added dialog to connect to BT printer by BT Address on Intermec devices. New [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple application to connect to a serial port. The idea is based on the need of having an application to send demo print files to a virtual comm port connected to a bluetooth printer.</p>
<p><strong>Update 16. March 2011:</strong> Added dialog to connect to BT printer by BT Address on Intermec devices. New source and binary at code.google.com.</p>
<p><strong>Update 21. March 2011:</strong> Splitted source code and providing three different flavours:<br />
CommAppCFSerial does serial comm only.<br />
CommAppCFbtSearch provides BT connect (Intermec Devices only) and BT discovery<br />
CommAppCF itself is a unstable working release<br />
see code.google.com/p/win-mobile-code &#8230; Executables are in bin subdirs.</p>
<p>You can enter and send texts to or send a whole file to the port. Additionally you are able to send ASCII codes by using \xAB syntax, where AB is the hex code of the byte you would like to send.</p>
<p>There is nothing special with the code except the hex decoding/encoding and the possibility to send a file.</p>
<p><a rel="attachment wp-att-1073" href="http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/commappcf/"><img class="alignnone size-medium wp-image-1073" title="CommAppCF" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/CommAppCF-225x300.png" alt="" width="225" height="300" /></a> <a rel="attachment wp-att-1074" href="http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/commappcf_connect/"><img class="alignnone size-medium wp-image-1074" title="CommAppCF_connect" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/CommAppCF_connect-225x300.png" alt="" width="225" height="300" /></a> <a rel="attachment wp-att-1075" href="http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/commappcf_sendstatus/"><img class="alignnone size-medium wp-image-1075" title="CommAppCF_sendstatus" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/CommAppCF_sendstatus-225x300.png" alt="" width="225" height="300" /></a></p>
<p><span id="more-1072"></span>Here is a short sample how the SendFile is implemented:</p>
<pre lang="csharp">        private void sendFile(string filename)
        {
            try
            {
                updateTxtRcv("Starting sendFile(" + filename + ")");

                System.IO.StreamReader sr = new System.IO.StreamReader(filename);
                int r;
                int blockSize = 4096;
                char[] buf = new char[blockSize];
                //how many blocks to send?
                System.IO.FileInfo fi = new System.IO.FileInfo(filename);
                long lBlocks = (long)(fi.Length / blockSize);
                if (lBlocks == 0)
                    lBlocks = 1;
                updateTxtRcv("Need to send " + lBlocks.ToString() + " blocks...");
                long lBlockNr = 1;
                do
                {
                    updateTxtRcv("Sending block " + lBlockNr.ToString() + " ...");
                    r = sr.Read(buf, 0, blockSize); //r = number of bytes read
                    comport.Write(buf, 0, r);
                }
                while (r!=-1 &amp;&amp; !sr.EndOfStream);
                sr.Close();
                updateTxtRcv("Finished sendFile(" + filename + ")");
            }
            catch (Exception x)
            {
                updateTxtRcv("sendFile exception:" + x.Message);
                System.Diagnostics.Debug.WriteLine(x.Message);
            }
        }</pre>
<p>The application persists choosen settings in the registry. I had to implement classes to convert SerialPort Parity, Handshake, Stopbits etc settings between typed and integer values. Unfortunately the enums for these properties are not defined on base of integer. For example I had to code this class to enable save/restore of the Handshake property:</p>
<pre lang="csharp">    public static class myHandshake
    {
        public static string[] handshakes = { "None", "XOnXOff", "RequestToSend", "RequestToSendXOnXOff" };
        public static Handshake ToHandshake(int i)
        {
            switch (i)
            {
                case 0: return Handshake.None;
                case 1: return Handshake.XOnXOff;
                case 2: return Handshake.RequestToSend;
                case 3: return Handshake.RequestToSendXOnXOff;
            }
            return Handshake.None;
        }
        public static Handshake ToHandshake(string text)
        {
            if (text.Equals("None", StringComparison.OrdinalIgnoreCase))
                return Handshake.None;
            if (text.Equals("XOnXOff", StringComparison.OrdinalIgnoreCase))
                return Handshake.XOnXOff;
            if (text.Equals("RequestToSend", StringComparison.OrdinalIgnoreCase))
                return Handshake.RequestToSend;
            if (text.Equals("RequestToSendXOnXOff", StringComparison.OrdinalIgnoreCase))
                return Handshake.RequestToSendXOnXOff;
            return Handshake.None;
        }
        public static int ToInt(Handshake hs)
        {
            switch (hs)
            {
                case Handshake.None: return 0;
                case Handshake.XOnXOff: return 1;
                case Handshake.RequestToSend: return 2;
                case Handshake.RequestToSendXOnXOff: return 3;
            }
            return 0;
        }
        public static string ToString(Handshake hs)
        {
            switch (hs)
            {
                case Handshake.None: return "None";
                case Handshake.XOnXOff: return "XOnXOff";
                case Handshake.RequestToSend: return "RequestToSend";
                case Handshake.RequestToSendXOnXOff: return "RequestToSendXOnXOff";
            }
            return "None";
        }
        public static string ToString(int i)
        {
            switch (i)
            {
                case 0: return "None";
                case 1: return "XOnXOff";
                case 2: return "RequestToSend";
                case 3: return "RequestToSendXOnXOff";
            }
            return "None";
        }
    }//class myHandshake</pre>
<p>This would have been a lot easier if the Handshake enum was based on integer.</p>
<p>BTW using StopBits.None is not supported: &#8220;This value is not supported. Setting the System.IO.Ports.SerialPort.StopBits property to System.IO.Ports.StopBits.None raises an System.ArgumentOutOfRangeException.&#8221; (see StopBits enumeration).</p>
<p>Source code and binary located at <a href="http://code.google.com/p/win-mobile-code/source/browse/#svn%2Ftrunk%2FCommAppCF" target="_blank">code.google.com</a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;title=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;title=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;title=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;T=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F10%2Fmobile-development-simple-serial-communication-application%2F&amp;t=Mobile+Development+%26%238211%3B+Simple+serial+communication+application" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/03/10/mobile-development-simple-serial-communication-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Development &#8211; subclassing the Camera View (CameraCaptureDialog, SHCameraCapture)</title>
		<link>http://www.hjgode.de/wp/2011/03/08/mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture</link>
		<comments>http://www.hjgode.de/wp/2011/03/08/mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 14:21:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[hook.wndproc]]></category>
		<category><![CDATA[Subclassing]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=1065</guid>
		<description><![CDATA[If you are running a kiosk mode app but need to provide the camercapture dialog on Windows Mobile 5 or later, you may need to disable the one or other click in the CameraCapture dialog. This article uses a technique known as subclassing as already used and decribed in my StartButtonHookWM65 article. For the CameraCapture [...]]]></description>
			<content:encoded><![CDATA[<p>If you are running a kiosk mode app but need to provide the camercapture dialog on Windows Mobile 5 or later, you may need to disable the one or other click in the CameraCapture dialog.</p>
<p>This article uses a technique known as subclassing as already used and decribed in my StartButtonHookWM65 article. For the CameraCapture dialog the code has been revised and you can now subclass any known window class and disable clicks within the Windows Mobile menu bar.</p>
<pre lang="csharp">        private string _winClassName = "HHTaskbar";
        public string winClassName
        {
            get { return _winClassName; }
            set {
                if (this.oldWndProc == IntPtr.Zero) //only allow change before subclassing
                    _winClassName = value;
            }
        }
...
        /// &lt;summary&gt;
        /// SubClassing: Install the wndproc hook
        /// &lt;/summary&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        private bool hookWindow()
        {
            //find the window to hook
            IntPtr hWndHooked = FindWindow(_winClassName, IntPtr.Zero);
            if (hWndHooked == IntPtr.Zero)
                return false;
            //enable the taskbar, not realy necessary
            EnableWindow(hWndHooked, true);
            //already installed?
            if (oldWndProc == IntPtr.Zero)
            {
                //find the menu_worker window
                IntPtr hwndMenu_Worker = FindWindow("menu_worker", IntPtr.Zero);
                if (hwndMenu_Worker != IntPtr.Zero)
                {
                    //get the child window which has the buttons on it
                    IntPtr hwndToolbar = GetWindow(hwndMenu_Worker, GetWindow_Cmd.GW_CHILD);
                    if (hwndToolbar != IntPtr.Zero)
                    {
                        _mHwnd = hwndToolbar;       //store to remember
                        SubclassHWnd(hwndToolbar);  //subclass the wndproc
                    }
                }
            }
            return true;
        }
</pre>
<p>As the call to CameraCaptureDialog will block and you can not subclass it before it is launched, I use a timer that will subclass the dialog assuming it will show after the call to .ShowDialog().</p>
<pre lang="csharp">        private System.Windows.Forms.Timer timer;
        hwndutils subClassUtils;
        private void ShowCamera()
        {
            CameraCaptureDialog cdlg = new CameraCaptureDialog();
            cdlg.DefaultFileName="picture.jpg";
            cdlg.InitialDirectory = "\\My Documents";
            cdlg.Mode = CameraCaptureMode.Still;
            cdlg.Owner = this.pictureBox1;
            cdlg.StillQuality = CameraCaptureStillQuality.High;
            cdlg.Title = "Take a picture and Select";
            cdlg.Resolution = new Size(240, 320);
            cdlg.VideoTypes = CameraCaptureVideoTypes.All;

            //subclass main window with delay
            subClassUtils = new hwndutils();
            timer = new Timer();
            timer.Interval = 1000;
            timer.Tick += new EventHandler(timer_Tick);
            timer.Enabled = true;

            DialogResult dRes = <strong>cdlg.ShowDialog();</strong>
...
        void timer_Tick(object sender, EventArgs e)
        {
            subClassUtils.winClassName = "Camera View";
            <strong>subClassUtils.CloseButtonDisabled = true;</strong>
            System.Threading.Thread.Sleep(500);
            if(subClassUtils.CloseButtonDisabled)
                timer.Enabled = false;

        }
</pre>
<p>In the line &#8220;<strong>subClassUtils.CloseButtonDisabled = true;&#8221; </strong>the subclassing (or the hook) will be activated and clicks on (OK) will not be accepted.<strong></strong></p>
<p><a rel="attachment wp-att-1068" href="http://www.hjgode.de/wp/2011/03/08/mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture/cameracapturedlg/"><img class="alignnone size-medium wp-image-1068" title="CameraCaptureDlg" src="http://www.hjgode.de/wp/wp-content/uploads/2011/03/CameraCaptureDlg-225x300.png" alt="" width="225" height="300" /></a></p>
<p>Code subclassing.cs download: <strong><b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=134" title="Downloaded 156 times">subclassing.cs</a> - subclassing code for C# compact framework (Hits: 156, size: 2.4 kB)<br />
</strong></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;title=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;title=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;title=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;T=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2011%2F03%2F08%2Fmobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture%2F&amp;t=Mobile+Development+%26%238211%3B+subclassing+the+Camera+View+%28CameraCaptureDialog%2C+SHCameraCapture%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2011/03/08/mobile-development-subclassing-the-camera-view-cameracapturedialog-shcameracapture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Mobile: SetSystemTime and DST, Einstein&#8217;s Relativity Theory?</title>
		<link>http://www.hjgode.de/wp/2010/10/08/windows-mobile-setsystemtime-and-dst-einsteins-relativity-theory/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=windows-mobile-setsystemtime-and-dst-einsteins-relativity-theory</link>
		<comments>http://www.hjgode.de/wp/2010/10/08/windows-mobile-setsystemtime-and-dst-einsteins-relativity-theory/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 18:29:04 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[DST]]></category>
		<category><![CDATA[SetLocalTime]]></category>
		<category><![CDATA[SetSystemTime]]></category>
		<category><![CDATA[Time Sync]]></category>
		<category><![CDATA[timezoneinfo-in-windows-mobile]]></category>
		<category><![CDATA[TimeZoneInformation]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=817</guid>
		<description><![CDATA[SetSystemTime and DST, better disable DST before using SetSystemTime]]></description>
			<content:encoded><![CDATA[<p>Wow, as I first saw this issue, I thought I was facing Einstein&#8217;s Relativity Theory.</p>
<p>The issue is simple to explain:<br />
 1) The WinMo device has a local time and date within DST<br />
 2) You use SetSystemTime to set a new system time and date outside the DST frame<br />
 3) The local time changes but DST is still applied!</p>
<p><span id="more-817"></span></p>
<p>In concrete example:</p>
<pre>GetTimeZoneInformation:
 DaylightSaving-Time:

Bias -60  Daylight-Name: W  Daylight-Bias: -60 Standard-Name: W  Standard-Bias: 0
Standard-Date: 00/10/05 03:00:00, Daylight-Date: 00/03/05 02:00:00

1. Set time inside DST +++++++++++
+++++++++++ TstSetTime ++++++++++++
SetSystemTime:  2010/09/21 10:32:00
GetLocalTime:   2010/09/21 <strong>12:32:00</strong>
GetSystemTime:  2010/09/21 10:32:00

------------ TstSetTime ------------
2. Set time outside DST ----------
+++++++++++ TstSetTime ++++++++++++
SetSystemTime:  2010/10/31 01:50:00
GetLocalTime:   2010/10/31 <strong>03:50:00</strong>
GetSystemTime:  2010/10/31 01:50:00
</pre>
<p>As you can see, local time is 2 hours of, although the data/time is outside DST. You can also see, that the device is in GMT+1 time zone.</p>
<p>Ah, you say this is a known issue. OK, lets do it the microsoft way and Sleep() and set system time again:</p>
<pre>3. SLEEP...
4. Set time outside DST 2nd CALL ----------
+++++++++++ TstSetTime ++++++++++++
SetSystemTime:  2010/10/31 01:50:00
GetLocalTime:   2010/10/31 <strong>02:50:00</strong>
GetSystemTime:  2010/10/31 01:50:00
</pre>
<p>You are right, now the local time is correct.</p>
<p>Ok, not clear but a workaround. Now go on and set time back into DST:</p>
<pre>------------ TstSetTime ------------
5. Set time back inside DST +++++++++++
+++++++++++ TstSetTime ++++++++++++
SetSystemTime:  2010/09/21 10:32:00
GetLocalTime:   2010/09/21 <strong>11:32:00</strong>
GetSystemTime:  2010/09/21 10:32:00
</pre>
<p>Again a fault. This time DST is not applied although the date is within DST frame.</p>
<p>Doing the same in Compact Framework is more worst and you will only get valid results with disabled DST.</p>
<p>The best workaround is to disable DST BEFORE you change the system time and then restore DST after changing the system time.</p>
<p>.Net code snippets:</p>
<pre escaped="true" lang="csharp">        private DateTime startDateTime = DateTime.Parse("2010/9/24 11:42:00");

        [DllImport("coredll.dll", SetLastError = true)]
        static extern Int32 GetLastError();

        [DllImport("coredll.dll", SetLastError = true)]
        static extern bool SetSystemTime(ref SYSTEMTIME time);
        [DllImport("coredll.dll", SetLastError = true)]
        static extern void GetSystemTime(out SYSTEMTIME lpSystemTime);

        [DllImport("coredll.dll")]
        static extern bool SetTimeZoneInformation([In] ref TIME_ZONE_INFORMATION lpTimeZoneInformation);
        [DllImport("coredll.dll", CharSet = CharSet.Auto)]
        private static extern int GetTimeZoneInformation(out TIME_ZONE_INFORMATION lpTimeZoneInformation);

        private const int TIME_ZONE_ID_UNKNOWN = 0;
        private const int TIME_ZONE_ID_STANDARD = 1;
        private const int TIME_ZONE_ID_DAYLIGHT = 2;

        [StructLayoutAttribute(LayoutKind.Sequential)]
        public struct SYSTEMTIME
        {
            public short wYear;
            public short wMonth;
            public short wDayOfWeek;
            public short wDay;
            public short wHour;
            public short wMinute;
            public short wSecond;
            public short wMilliseconds;
        }
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
        public struct TIME_ZONE_INFORMATION
        {
            public int bias;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
            public string standardName;
            public SYSTEMTIME standardDate;
            public int standardBias;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
            public string daylightName;
            public SYSTEMTIME daylightDate;
            public int daylightBias;
        }
...
        private bool disableDST(TIME_ZONE_INFORMATION tzi){
            //set wMonth in standardDate to zero
            SYSTEMTIME stStd;
            stStd=tzi.standardDate;
            stStd.wMonth=0;
            //set wMonth in daylightDate to zero
            SYSTEMTIME stDST;
            stDST=tzi.daylightDate;
            stDST.wMonth=0;

            tzi.daylightDate=stDST;
            tzi.standardDate=stStd;
            bool bRes = SetTimeZoneInformation(ref tzi);
            if (bRes)
                addText("*** Disabling DST OK***");
            else
                addText("*** Disabling DST failed***");
            return bRes;
        }
</pre>
<p>Possibly a good information for all that do TimeSync with a server.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F10%2F08%2Fwindows-mobile-setsystemtime-and-dst-einsteins-relativity-theory%2F&amp;title=Windows+Mobile%3A+SetSystemTime+and+DST%2C+Einstein%26%238217%3Bs+Relativity+Theory%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F10%2F08%2Fwindows-mobile-setsystemtime-and-dst-einsteins-relativity-theory%2F&amp;title=Windows+Mobile%3A+SetSystemTime+and+DST%2C+Einstein%26%238217%3Bs+Relativity+Theory%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F10%2F08%2Fwindows-mobile-setsystemtime-and-dst-einsteins-relativity-theory%2F&amp;title=Windows+Mobile%3A+SetSystemTime+and+DST%2C+Einstein%26%238217%3Bs+Relativity+Theory%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F10%2F08%2Fwindows-mobile-setsystemtime-and-dst-einsteins-relativity-theory%2F&amp;T=Windows+Mobile%3A+SetSystemTime+and+DST%2C+Einstein%26%238217%3Bs+Relativity+Theory%3F" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F10%2F08%2Fwindows-mobile-setsystemtime-and-dst-einsteins-relativity-theory%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F10%2F08%2Fwindows-mobile-setsystemtime-and-dst-einsteins-relativity-theory%2F&amp;t=Windows+Mobile%3A+SetSystemTime+and+DST%2C+Einstein%26%238217%3Bs+Relativity+Theory%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2010/10/08/windows-mobile-setsystemtime-and-dst-einsteins-relativity-theory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mobile Development: Easy to use background thread with GUI update</title>
		<link>http://www.hjgode.de/wp/2010/06/01/mobile-development-easy-to-use-background-thread-with-gui-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mobile-development-easy-to-use-background-thread-with-gui-update</link>
		<comments>http://www.hjgode.de/wp/2010/06/01/mobile-development-easy-to-use-background-thread-with-gui-update/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 17:55:06 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Background Thread]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[DotNet]]></category>
		<category><![CDATA[event handler]]></category>
		<category><![CDATA[GUI thread]]></category>
		<category><![CDATA[Invoke]]></category>
		<category><![CDATA[MessageWindow]]></category>
		<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[SendMessage]]></category>
		<category><![CDATA[WM_COPYDATA]]></category>
		<category><![CDATA[WndProc]]></category>
		<category><![CDATA[Worker Thread]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=555</guid>
		<description><![CDATA[How to update GUI elements from inside a worker thread without using Invoke. Uses MessageWindow, WndProc and SendMessage with WM_COPYDATA.]]></description>
			<content:encoded><![CDATA[<p>Although there are well know ways to update the GUI from a background thread not running in the GUI thread, I looked for an easiest to use solution. After some experiments I got a background thread class that is very easy to use. No BeginInvoke or Control.Invoke needed any more to update a GUI element.</p>
<p>The final solution uses a MessageWindow inside a control based class with a worker thread. As the control and the MessageWindow is part of the GUI thread, there is no need to use Invokes.</p>
<p>Inside the thread I use SendMessage to transfer background thread informations to the control, which then fires an event you can subscribe in the GUI thread.</p>
<p>The test app attached shows three threads running independently and all update the GUI frequently without blocking the GUI.</p>
<p><a rel="attachment wp-att-579" href="http://www.hjgode.de/wp/2010/06/01/mobile-development-easy-to-use-background-thread-with-gui-update/threadtest2_demo/"><img class="alignnone size-full wp-image-579" title="ThreadTest2_demo" src="http://www.hjgode.de/wp/wp-content/uploads/2010/06/ThreadTest2_demo.gif" alt="" width="240" height="317" /></a></p>
<p><br class="spacer_" /></p>
<p><span style="font-size: x-large;"><strong>Here is my try to visualize my idea and solution</strong></span></p>
<p><a rel="attachment wp-att-556" href="http://www.hjgode.de/wp/2010/06/01/mobile-development-easy-to-use-background-thread-with-gui-update/bgthread/"><img class="alignnone size-full wp-image-556" title="bgThread" src="http://www.hjgode.de/wp/wp-content/uploads/2010/06/bgThread.png" alt="" width="584" height="411" /></a></p>
<p><span id="more-555"></span>Normally you have to use such a construction:</p>
<pre escaped="true" lang="csharp">// this variable will hold some text set by the worker thread
public string Message = "";

// Create a worker thread and then add items to the ListBox from the
// UI thread
public void DoThreading()
{
    // Create the worker thread and start it
    ThreadStart starter = new ThreadStart(this.UpdateListBox);
    Thread t = new Thread(starter);
    t.Start();

    // Loop 4 times, adding a message to the ListBox each time
    for(int i = 0; i &lt; 4; i++);
    {
        this.listBox1.Items.Add("Message from UI thread");
        this.listBox1.Update();
        // Process any queued events on the UI thread
        Application.DoEvents();
        // Suspend processing for 1 second
        Thread.Sleep(1000);
    }
    this.listBox1.Items.Add("Last message from UI thread");
    this.listBox1.Update();
}

public void UpdateListBox()
{
    for(int j = 0; j &lt; 5; j++)
    {
        // Set the message to be added to the ListBox from the worker
        // thread
        this.Message = "Worker thread loop count = " + j.ToString();
        // Invoke the WorkerUpdate method in the ListBox’s thread
        // context
        this.listBox1.Invoke(new EventHandler(WorkerUpdate));
        Thread.Sleep(700);
    }
}
// The delegate that’s called from the worker thread
// to update the ListBox
public void WorkerUpdate(object sender, EventArgs e)
{
    this.listBox1.Items.Add(this.Message);
    this.listBox1.Update();
}
</pre>
<p>As you can see from the code you need to inform the worker thread about the delegate to use for GUI updates. An GUI update from the worker thread is done with the help of UpdateListBox() and that invokes WorkerUpdate and that function finally updates the GUI. So four places are tight together with function names and definitions.</p>
<p>There are also other  ways to do it. For example with declaring a delegate first and then Invoke from background thread (see <a title="Make Thread-Safe Calls to Windows Forms Controls" href="http://msdn.microsoft.com/en-us/library/ms171728.aspx" target="_blank">here</a>):</p>
<pre lang="csharp">delegate void setText(string sText);
...
private void ThreadProcSafe()
		{
			this.SetText("This text was set safely.");
		}
...
		private void SetText(string text)
		{
			// InvokeRequired required compares the thread ID of the
			// calling thread to the thread ID of the creating thread.
			// If these threads are different, it returns true.
			if (this.textBox1.InvokeRequired)
			{
				SetTextCallback d = new SetTextCallback(SetText);
				this.Invoke(d, new object[] { text });
			}
			else
			{
				this.textBox1.Text = text;
			}
		}
</pre>
<p>But this solution also needs your background thread to know the delegate name (<strong>SetText(string s)</strong>).</p>
<p>I also used this patterns  often, but finally I thought, I need an easy to use class that is independent from the main gui thread code and easy to re-use.</p>
<p>With my bgThread classes (yes there are three predefined ones), you can simply use this construction:</p>
<pre lang="csharp">    public partial class ThreadTest2 : Form
    {
        private bgThread _bgThread;
...
        //start and link the thread
        private void btn_bgThreadTest_Click(object sender, EventArgs e)
        {
            _bgThread = new bgThread("192.168.128.5");
            _bgThread.bgThreadEvent += new bgThread.bgThreadEventHandler(_bgThread_bgThreadEvent);
        }

        void _bgThread_bgThreadEvent(object sender, bgThread.BgThreadEventArgs bte)
        {
            listBox1.Items.Insert(0, "bgThread: " + bte.iStatus.ToString();
        }
...
        //in your exit function you MUST dispose existing threads
            if (_bgThread != null)
                _bgThread.Dispose();
            Application.Exit();
...
</pre>
<p>As you can see, you have only a bgThread object and after creating a new instance just add the eventhandler. From the eventhandler you can directly update the GUI. You don&#8217;t have to define  a delegate.</p>
<p>All three bgThread classes work fine. They differ in the amount and type of data you have to transfer from the background thread to the GUI and so the BgThreadEventArgs differ in there definition.</p>
<p>The first class, bgThread1 class, only uses the IntPtr&#8217;s usable with SendMessage to transfer data. So you can transfer a maximum of two integers or so. That is enough for the most usage scenarios, where you only need to know status codes from the background thread. The attached bgThread1 class only impements one DWORD (or int).</p>
<p>The second class, bgThread class, uses a global lock and can transfer the data you desire. You have to redefine only the bgThreadEventArgs class to include the data types you would like to transfer. This class uses PostMessage and NOT SendMessage. It may happen, that the data and the message will get out of sync as PostMessage works asynchron.</p>
<p>The third class, bgThread2 class, uses WM_COPYDATA to transfer strutured data from the background thread. It is more complicated to use and extend than bgThread1 but uses SendMessage and no lock objects. Your data is delivered with SendMessage and so there will be no problem with data and message syncronization.</p>
<p>All classes define a class based on Component.</p>
<pre lang="csharp">    public class bgThread : Component
    {
        public delegate void bgThreadEventHandler(object sender, BgThreadEventArgs bte);
        public event bgThreadEventHandler bgThreadEvent;
...
        internal BgThreadEventArgs _BGeventArgs;
        private Thread myThread;
...
        internal class bgThreadWndProc : MessageWindow
        {
            public bgThreadWndProc(bgThread Parent)
            {
                this._bgThread = Parent;
                hwndControl = Hwnd;
            }
            protected override void WndProc(ref Message m)
            {
                int iMsg = m.Msg;
                System.Diagnostics.Debug.WriteLine("WndProc called...");
                switch (iMsg)
                {
                    case msgID:
                        {
                            this._bgThread.NotifyData(m.WParam);
                            break;
                        }
                    default:
                        {
                            base.WndProc(ref m);
                            break;
                        }
                }
            }
        }//MsgWnd
</pre>
<p>Within the bgThread class there is a nested class based on MessageWindow.</p>
<p>The bgThread class constructor:</p>
<pre lang="csharp">        public bgThread()
        {
            bgWnd = new bgThreadWndProc(this);
            myThread = new Thread(myThreadStart);
            bRunThread = true;
            myThread.Start();
        }
</pre>
<p>The thread proc itself. It may contain more or less blocking functions  calls.</p>
<pre lang="csharp">       private void myThreadStart()
        {
            try
            {
                do
                {
                    //The blocking function...
                    //sample: call ping and return number of pings answered
                    int iReply = myPing.Ping(System.Net.IPAddress.Parse(_sIP));
                    //create a msg and send it to the messagewindow, the messagewindow will then inform the event subscribers
                    //we only need the number of ping replies (0 or 1) for the ping
                    Microsoft.WindowsCE.Forms.Message msg = Message.Create(bgWnd.Hwnd, msgID, new IntPtr(iReply), IntPtr.Zero);
                    MessageWindow.SendMessage(ref msg); //async Message send
                    Thread.Sleep(1000); //if you have fast 'blocking' functions you should sleep
                } while (bRunThread);
            }
            catch (ThreadAbortException)
            {
                System.Diagnostics.Debug.WriteLine("Thread will abort");
                bRunThread = false;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Exception in ThreadStart: " + ex.Message);
            }
            System.Diagnostics.Debug.WriteLine("ThreadProc ended");
        }
</pre>
<p>The code that fires the event is not called from the thread. Instead it is called from the MessageWindow. The thread itself sends its &#8216;data&#8217; via SendMessage to the bgThread &#8216;Component&#8217; (which is part of the GUI!):</p>
<pre lang="csharp">        private void NotifyData(IntPtr i1)
        {
            BgThreadEventArgs _bgThreadEventArgs;
            //is there any subscriber
            if (this.bgThreadEvent == null)
            {
                return;
            }
            try
            {
                int i = i1.ToInt32();
                _bgThreadEventArgs = new BgThreadEventArgs(i);
                this.bgThreadEvent(this, _bgThreadEventArgs);
            }
            catch (MissingMethodException)
            {
            }
        }
</pre>
<p>The above code snippets are taken from bgThread1 class, the one that only &#8216;transfers&#8217; an integer to the GUI.</p>
<p><strong>Possible extensions</strong></p>
<ul>
<li>extend bgThread to Stop (pause) a bgThread</li>
<li>extend bgThread and let it invoke a eventhandler that does the blocking stuff. Similar to the BackgroundWorker class available in internet. So you can define your background function inside the main code.</li>
</ul>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=100" title="Downloaded 394 times">bgThread classes, a ping class and a demo application (VS2005, target WM6SDK)</a> -  (Hits: 394, size: 20.06 KB)
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 1512px; width: 1px; height: 1px;">
<pre><span style="color: blue;">delegate</span> <span style="color: blue;">void</span> SetTextCallback(<span style="color: blue;">string</span> text);
</pre>
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F06%2F01%2Fmobile-development-easy-to-use-background-thread-with-gui-update%2F&amp;title=Mobile+Development%3A+Easy+to+use+background+thread+with+GUI+update" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F06%2F01%2Fmobile-development-easy-to-use-background-thread-with-gui-update%2F&amp;title=Mobile+Development%3A+Easy+to+use+background+thread+with+GUI+update" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F06%2F01%2Fmobile-development-easy-to-use-background-thread-with-gui-update%2F&amp;title=Mobile+Development%3A+Easy+to+use+background+thread+with+GUI+update" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F06%2F01%2Fmobile-development-easy-to-use-background-thread-with-gui-update%2F&amp;T=Mobile+Development%3A+Easy+to+use+background+thread+with+GUI+update" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F06%2F01%2Fmobile-development-easy-to-use-background-thread-with-gui-update%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F06%2F01%2Fmobile-development-easy-to-use-background-thread-with-gui-update%2F&amp;t=Mobile+Development%3A+Easy+to+use+background+thread+with+GUI+update" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2010/06/01/mobile-development-easy-to-use-background-thread-with-gui-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full Screen Engine to make Compact Framework applications fullscreen</title>
		<link>http://www.hjgode.de/wp/2010/03/18/full-screen-engine-to-make-compact-framework-applications-fullscreen/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=full-screen-engine-to-make-compact-framework-applications-fullscreen</link>
		<comments>http://www.hjgode.de/wp/2010/03/18/full-screen-engine-to-make-compact-framework-applications-fullscreen/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 13:43:50 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[kiosk mode]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[GXOpenInput]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=456</guid>
		<description><![CDATA[A class to make a Windows Mobile compact framework forms fullscreen. Includes code to catch all keys (no more working softkeys)]]></description>
			<content:encoded><![CDATA[<p>Here is my approach to make a compact framework form fullscreen:</p>
<p>A class that enables you to</p>
<ul>
<li>lock/unlock the taskbar</li>
<li>hide/show the taskbar and resize form to occupy the whole screen</li>
<li>hide the menu bar but show/hide SIP</li>
<li>disables OS to capture Function keys like F6/F7 for Volume Up/Down etc and makes these keys available to be used in your app. Also the use of the WinKey does not open the Start Menu</li>
</ul>
<p><a rel="attachment wp-att-457" href="http://www.hjgode.de/wp/2010/03/18/full-screen-engine-to-make-compact-framework-applications-fullscreen/fullscreencstest/"><img class="alignnone size-full wp-image-457" title="fullscreenCStest" src="http://www.hjgode.de/wp/wp-content/uploads/2010/03/fullscreenCStest.gif" alt="" width="240" height="320" /></a></p>
<p>(You are right, you dont see &#8216;fullscreen&#8217; in the screen shot, BUT the taskbar is locked!)</p>
<p><span id="more-456"></span></p>
<pre lang="csharp">using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace myApp{
    class fullScreen
    {
        #region DllImports
        ///
        /// FindWindow will find a window by specifying the WndClass or the Caption
        ///
        ///

        ///

        /// an intPtr to the found window or null, if not found
        [DllImport("coredll.dll")]
        extern private static IntPtr FindWindowW(string lpClassName, string lpWindowName);

        ///
        /// we need this to get the size of the screen
        ///
        ///

        ///
        [DllImport("coredll.dll")]
        extern private static int GetSystemMetrics(int nIndex);
        ///
        /// the used nIndex values for screen width and height
        ///
        private const int SM_CXSCREEN = 0;
        private const int SM_CYSCREEN = 1;

        ///
        /// query a window for his state
        ///
        ///

        /// true if window is visible
        [DllImport("coredll.dll")]
        static extern bool IsWindowVisible(IntPtr hWnd);

        #endregion
        ///
        /// function to modify the window state of a window
        ///
        /// handle to the window
        /// the required window state
        ///
        [DllImport("coredll.dll")]
        static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);

        #region WStyles
        /// Enumeration of the different ways of showing a window using
        /// ShowWindow
        private enum WindowShowStyle : uint
        {
            /// Hides the window and activates another window.
            /// See SW_HIDE
            Hide = 0,
            /// Activates and displays a window. If the window is minimized
            /// or maximized, the system restores it to its original size and
            /// position. An application should specify this flag when displaying
            /// the window for the first time.
            /// See SW_SHOWNORMAL
            ShowNormal = 1,
            /// Activates the window and displays it as a minimized window.
            /// See SW_SHOWMINIMIZED
            ShowMinimized = 2,
            /// Activates the window and displays it as a maximized window.
            /// See SW_SHOWMAXIMIZED
            ShowMaximized = 3,
            /// Maximizes the specified window.
            /// See SW_MAXIMIZE
            Maximize = 3,
            /// Displays a window in its most recent size and position.
            /// This value is similar to "ShowNormal", except the window is not
            /// actived.
            /// See SW_SHOWNOACTIVATE
            ShowNormalNoActivate = 4,
            /// Activates the window and displays it in its current size
            /// and position.
            /// See SW_SHOW
            Show = 5,
            /// Minimizes the specified window and activates the next
            /// top-level window in the Z order.
            /// See SW_MINIMIZE
            Minimize = 6,
            /// Displays the window as a minimized window. This value is
            /// similar to "ShowMinimized", except the window is not activated.
            /// See SW_SHOWMINNOACTIVE
            ShowMinNoActivate = 7,
            /// Displays the window in its current size and position. This
            /// value is similar to "Show", except the window is not activated.
            /// See SW_SHOWNA
            ShowNoActivate = 8,
            /// Activates and displays the window. If the window is
            /// minimized or maximized, the system restores it to its original size
            /// and position. An application should specify this flag when restoring
            /// a minimized window.
            /// See SW_RESTORE
            Restore = 9,
            /// Sets the show state based on the SW_ value specified in the
            /// STARTUPINFO structure passed to the CreateProcess function by the
            /// program that started the application.
            /// See SW_SHOWDEFAULT
            ShowDefault = 10,
            /// Windows 2000/XP: Minimizes a window, even if the thread
            /// that owns the window is hung. This flag should only be used when
            /// minimizing windows from a different thread.
            /// See SW_FORCEMINIMIZE
            ForceMinimized = 11
        }
        #endregion
#region private vars
        private int m_width = 240;
        private int m_height = 320;
        private bool m_SIP_shown = false;
#endregion
        ///
        /// class instantiation
        /// store the screen size
        ///
        public fullScreen()
        {
            m_width = GetSystemMetrics(SM_CXSCREEN);
            m_height = GetSystemMetrics(SM_CYSCREEN);
            //Find SipWndClass
            IntPtr hWndSipWndClass = IntPtr.Zero;
            hWndSipWndClass = FindWindowW("SipWndClass", null);
            if (hWndSipWndClass != IntPtr.Zero)
            {
                m_SIP_shown = IsWindowVisible(hWndSipWndClass);
            }
            GXopen();
        }
        ///
        /// this will open the GX API and all keystrokes, even the softkeys as Vol_Up, Win etc will not be handled by the OS
        /// the gx.dll is only available on Windows Mobile OS, not on WinCE OS devices
        /// The GX class has been ousourced and will only be loaded in gx.dll exists
        /// otherwise you will get missing DLL exceptions
        ///
        private void GXopen(){
            if (System.IO.File.Exists(@"\Windows\gx.dll"))
            {
                GX_WM gxwm = new GX_WM();
                gxwm.GXopen();
            }
        }

        ///
        /// deinit GX API and let wiondows handle the 'softkeys'
        ///
        private void GXclose()
        {
            if (System.IO.File.Exists(@"\Windows\gx.dll"))
            {
                GX_WM gxwm = new GX_WM();
                gxwm.GXopen();
            }
        }
        ///
        /// public vars to get the screen size
        ///
        public int width
        {
            get
            {
                return m_width;
            }
        }
        public int height
        {
            get
            {
                return m_height;
            }
        }
        ///
        /// will enlarge the form to cover the full screen
        /// the taskbar will be hidden
        /// the SIP will be hidden
        ///
        /// the form to make fullscreen
        public void makeFullScreen(System.Windows.Forms.Form f)
        {
            f.Width = m_width;
            f.Height = m_height;
            f.Top = 0; f.Left = 0; // move the form to upper left
            hideTaskBar(true); //hide the taskbar
            showSIP(false); //hide the SIP window, regardless of it is shown or not
        }

        ///
        /// restore previous screen settings
        ///
        public void Unload()
        {
            hideTaskBar(false);
            if (m_SIP_shown)
                showSIP(true);
        }

        ///
        /// Hide or show the SIP
        ///
        ///

        public void showSIP(bool bShow)
        {
            //Find SipWndClass
            IntPtr hWndSipWndClass = IntPtr.Zero;
            hWndSipWndClass = FindWindowW("SipWndClass", null);
            if (hWndSipWndClass != IntPtr.Zero)
            {
                if (bShow)
                    ShowWindow(hWndSipWndClass, (uint)WindowShowStyle.ShowNormal);
                else
                    ShowWindow(hWndSipWndClass, (uint)WindowShowStyle.Minimize);
            }
        }

        ///
        /// Hide or show the TaskBar
        ///
        ///

        ///
        private int hideTaskBar(bool mode)
        {
            IntPtr hWndTaskBar = IntPtr.Zero;
            if (mode)
            {
                hWndTaskBar = FindWindowW("HHTaskBar", null);
                if (hWndTaskBar != IntPtr.Zero)
                    ShowWindow(hWndTaskBar, (uint)WindowShowStyle.Hide);
            }
            else
            {
                hWndTaskBar = FindWindowW("HHTaskBar", null);
                if (hWndTaskBar != IntPtr.Zero)
                    ShowWindow(hWndTaskBar, (uint)WindowShowStyle.ShowNormal);
            }
            return 0;
        }

    }
}</pre>
<p>The GX_WM class:</p>
<pre lang="csharp">using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices; 

namespace myApp
{
	class GX_WM {
		//nice mangled names
		//?GXCloseInput@@YAHXZ or use "#3"
		[DllImport("gx.dll", EntryPoint="?GXCloseInput@@YAHXZ")]
		extern private static Int16 GXOpenInput();
		//?GXOpenInput@@YAHXZ or use "#9"
		[DllImport("gx.dll", EntryPoint="?GXOpenInput@@YAHXZ")]
		extern private static Int16 GXCloseInput(); 

		public void GXopen(){
			GXOpenInput();
			System.Diagnostics.Debug.WriteLine("GXOpenInput()");
		}
		public void GXclose() {
			GXCloseInput();
			System.Diagnostics.Debug.WriteLine("GXCloseInput()");
		}
	}
}
</pre>
<p>To use the classes in your code, declare a new fullScreen object at a central point of your app. For example in Program.cs:</p>
<pre lang="csharp">        public static fullScreen fse;</pre>
<p>The declaration is static to enable you to use this object in all forms of your app. Then before your Run statement place the initialisation of the fullScreen object. At the end of your app, it is a good way to unload the object, so it may restore the taskbar and SIP status.</p>
<pre lang="csharp">static class Program
    {
        ///
        /// The main entry point for the application.
        ///
        public static fullScreen fse;
        [MTAThread]
        static void Main()
        {
            try
            {
                fse = new fullScreen();
                Application.Run(new MyAppForm());
            }
            catch (Exception ex)
            {
                MessageBox.Show("Sorry: " + ex.Message);
            }
            fse.Unload();
        }
    }
</pre>
<p>Now in every form you have, place the line:</p>
<pre lang="csharp">Program.fse.makeFullScreen(this);</pre>
<p>in the _Load event or &#8211; as I do &#8211; in the form constructor after the line &#8220;InitializeComponent();&#8221;</p>
<pre escaped="true" lang="csharp">public myAppForm() {
    if (!InitApp())
        AppShutdown();
    InitializeComponent();
    <strong>Program.fse.makeFullScreen(this);</strong>
}</pre>
<p>If you need to show the SIP, use</p>
<pre>Program.fse.showSIP(true); </pre>
<p>If you want to have a real fullscreen app without a title bar, dont forget to set the borderstyle of your form to None. You can also change the makeFullScreen function and do this for the form given in the argument.</p>
<p>Any comments or enhancements?</p>
<p>Have fun</p>
<p>PS: Key catching works fine in C# with the fullscreen class (either using GXOpenInput() or AllKeys()), see attached c# sample.</p>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=87" title="Downloaded 802 times">FullScreenCStest</a> -  (Hits: 802, size: 44.66 KB)
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;title=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;title=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;title=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;T=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Ffull-screen-engine-to-make-compact-framework-applications-fullscreen%2F&amp;t=Full+Screen+Engine+to+make+Compact+Framework+applications+fullscreen" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2010/03/18/full-screen-engine-to-make-compact-framework-applications-fullscreen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DataMatrix.Net ported to Compact Framework</title>
		<link>http://www.hjgode.de/wp/2010/03/18/datamatrixnet-ported-to-compact-framework/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=datamatrixnet-ported-to-compact-framework</link>
		<comments>http://www.hjgode.de/wp/2010/03/18/datamatrixnet-ported-to-compact-framework/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 08:57:32 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[barcode]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[DataMatrix]]></category>
		<category><![CDATA[DataMatrix.Net]]></category>
		<category><![CDATA[DataMatrixNet]]></category>
		<category><![CDATA[generate]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[SourceForge]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=447</guid>
		<description><![CDATA[DataMatrixNet for Compact Framework 2.0]]></description>
			<content:encoded><![CDATA[<p>(Updated 28. april 2010: see bottom)</p>
<p>If you need to print, show, generate or analyse DataMatrix Barcodes on a Windows Mobile device, you can now use this class library. I have ported the code to be compatible with Compact Framework 2.0 and Visual Studio 2005.</p>
<p>The original full .NET framework source code is located at <a href="http://sourceforge.net/projects/datamatrixnet/" target="_blank">SourceForge</a>.</p>
<p>Here is first a screenshot of the test application running on a Windows Mobile device using the DataMatrixNetCF class:</p>
<p><a rel="attachment wp-att-448" href="http://www.hjgode.de/wp/2010/03/18/datamatrixnet-ported-to-compact-framework/datamatrixnetcf/"><img class="alignnone size-full wp-image-448" title="DataMatrixNetCF" src="http://www.hjgode.de/wp/wp-content/uploads/2010/03/DataMatrixNetCF.gif" alt="Test application screenshot" width="240" height="320" /></a></p>
<p><span id="more-447"></span></p>
<p>The full .NET framework has much more functions or the classes provide more optional arguments than Compact Framework (CF) does. So there some code to be changed to work with CF. BTW: you can run the code on a desktop PC to, as the Full Framework is upwards compatible to CF.</p>
<p>I had to change some constructs which are used initialize a structure directly with some values. Here is one example for DmtxDecode.cs:</p>
<p>Original:</p>
<pre lang="csharp">            DmtxPixelLoc pEmpty = new DmtxPixelLoc() { X = 0, Y = 0 };
</pre>
<p>Visual Studio 2005 / Compact Framework 2:</p>
<pre lang="csharp">            DmtxPixelLoc pEmpty = new DmtxPixelLoc();
            pEmpty.X = 0; pEmpty.Y = 0;
</pre>
<p>Similar changes have to be applied to a lot of code lines:<br />
 Original:</p>
<pre lang="csharp">    follow.Loc = new DmtxPixelLoc() { X = followBeg.Loc.X + DmtxConstants.DmtxPatternX[patternIdx], Y = followBeg.Loc.Y + DmtxConstants.DmtxPatternY[patternIdx] };
</pre>
<p>Visual Studio 2005 / Compact Framework 2:</p>
<pre lang="csharp">    follow.Loc = new DmtxPixelLoc(followBeg.Loc.X + DmtxConstants.DmtxPatternX[patternIdx], followBeg.Loc.Y + DmtxConstants.DmtxPatternY[patternIdx]);
</pre>
<p>To get this working, the structure defined in DmtxPixelLoc.cs had to get a constructor code:</p>
<pre lang="csharp">        public DmtxPixelLoc(int x, int y)
        {
            _x = x;
            _y = y;
        }
</pre>
<p>As the compiler complained about this ugly contruct, I rewrote this:</p>
<pre lang="csharp">    prevPrevValue = (byte)((prevIndex &gt; channel.FirstCodeWord / 12) ? channel.EncodedWords[prevIndex - 1] : 0);
</pre>
<p>to this</p>
<pre lang="csharp">    if (prevIndex &gt; channel.FirstCodeWord / 12)
       prevPrevValue = channel.EncodedWords[prevIndex - 1];
    else
       prevPrevValue = 0;
</pre>
<p>I dont like this short forms of If/else.</p>
<p>Finally it took some time to convert this code of the file DmtxImageEncoder.cs to CF:</p>
<pre lang="csharp">        internal static Bitmap CopyDataToBitmap(byte[] data, int width, int height)
        {
            data = InsertPaddingBytes(data, width, height, 24);
            int stride = 4 * ((width * 24 + 31) / 32);
            GCHandle dataHandle = GCHandle.Alloc(data, GCHandleType.Pinned);
            //Here create the Bitmap to the know height, width and format
            Bitmap bmp = new Bitmap(width, height, stride, PixelFormat.Format24bppRgb, dataHandle.AddrOfPinnedObject());
            return bmp;
        }
</pre>
<p>In compact framework this works:</p>
<pre lang="csharp">        internal static Bitmap CopyDataToBitmap(byte[] data, int width, int height)
        {
            data = InsertPaddingBytes(data, width, height, 24);
            int stride = 4 * ((width * 24 + 31) / 32);
            GCHandle dataHandle = GCHandle.Alloc(data, GCHandleType.Pinned);

            // Create a new bitmap.
            Bitmap msBMP = new Bitmap(width,height,PixelFormat.Format24bppRgb);

            // Lock the bitmap's bits.
            Rectangle rect = new Rectangle(0, 0, msBMP.Width, msBMP.Height);
            System.Drawing.Imaging.BitmapData bmpData =
                msBMP.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite,
                PixelFormat.Format24bppRgb);

            // Get the address of the first line.
            IntPtr ptr = bmpData.Scan0;

            int bytes  = bmpData.Stride * msBMP.Height;
            // Copy the RGB values back to the bitmap
            System.Runtime.InteropServices.Marshal.Copy(data, 0, ptr, bytes);

            // Unlock the bits.
            msBMP.UnlockBits(bmpData);
            return msBMP; // return bmp;
        }
</pre>
<p>Here you can download the source code of the class library and a test application. The code is written in Visual Studio 2005 with Windows Mobile 5 SDK as target: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=85" title="Downloaded 631 times">DataMatrixNetCF: Class Library and TestApp, binary and source</a> -  (Hits: 631, size: 308.35 KB)</p>
<p>If you need some PDF library for Windows Mobile, see my port of <a title="iTextSharpCF" href="http://www.hjgode.de/wp/2009/10/31/itextsharp-running-on-compact-framework-windows-mobile/" target="_blank">iTextSharp</a>. The sourceforge DataMatrixNet code uses iTextSharp too.</p>
<p><span style="text-decoration: underline;"><strong>Update 28.  april 2010:</strong></span></p>
<p>There was a question at CodeProject about ECC200 compatibilty and a barcode test application called bcTester, that does not accept the barcodes generated with this sample app.</p>
<p>So I took a deeper look at the library and found, that my default datamatrixnet options dont fit what bcTester likes. So I changed the code of the sample application and it now offers a Settings dialog:</p>
<p><a rel="attachment wp-att-528" href="http://www.hjgode.de/wp/2010/03/18/datamatrixnet-ported-to-compact-framework/datamatrixnetcf_v2/"><img class="alignnone size-full wp-image-528" title="DataMatrixNetCF_v2" src="http://www.hjgode.de/wp/wp-content/uploads/2010/03/DataMatrixNetCF_v2.gif" alt="" width="240" height="320" /></a></p>
<p>The main changes are the default options:</p>
<pre lang="csharp">            options.ModuleSize = 4;
            options.MarginSize = 4;
            options.BackColor = Color.White;
            options.ForeColor = Color.Black;
            options.SizeIdx = DmtxSymbolSize.DmtxSymbol32x32;// DmtxSymbol96x96;
            options.Scheme = DmtxScheme.DmtxSchemeAscii;// DmtxSchemeAutoBest;
</pre>
<p>Another nice new feature (I think) is that you can use \xHH (HH=hex byte value) to encode control characters. Here is the string parser, that translates the mixed string to byte[]:</p>
<pre lang="csharp">        public static byte[] FromHexedString(string val){
            //replace \xHH with char of before using getbytes
            int iPos = val.IndexOf("\\x");
            while(iPos&gt;=0){
                string s = val.Substring(iPos, 4);
                byte b = byte.Parse(val.Substring(iPos+2,2), NumberStyles.HexNumber);
                //string c = Convert.ToString(b,16);
                char ch = (char)b;
                //test
                //byte[] bTest = Encoding.ASCII.GetBytes(ch.ToString());
                //System.Diagnostics.Debug.WriteLine(string.Format("Encoded {0:x} as '{1}'", bTest,ch));
                string o = val.Substring(0, iPos) + ch + val.Substring(iPos + 4);
                val = o;
                iPos = val.IndexOf("\\x");
            }
            byte[] valAsByteArray = Encoding.ASCII.GetBytes(val);
            return valAsByteArray;
        }
</pre>
<p>I extended my lib HexEncoding.cs to be able to do so. After all, bcTester accepts the barcode:</p>
<p><a rel="attachment wp-att-529" href="http://www.hjgode.de/wp/2010/03/18/datamatrixnet-ported-to-compact-framework/bctester/"><img class="alignnone size-full wp-image-529" title="bctester" src="http://www.hjgode.de/wp/wp-content/uploads/2010/03/bctester.gif" alt="" width="714" height="572" /></a></p>
<p><br class="spacer_" /></p>
<p>Download new version: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=93" title="Downloaded 127 times">DatamatrixNetCF Version 2</a> - Bug fixed (Hits: 127, size: 148.29 KB)</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Fdatamatrixnet-ported-to-compact-framework%2F&amp;title=DataMatrix.Net+ported+to+Compact+Framework" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Fdatamatrixnet-ported-to-compact-framework%2F&amp;title=DataMatrix.Net+ported+to+Compact+Framework" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Fdatamatrixnet-ported-to-compact-framework%2F&amp;title=DataMatrix.Net+ported+to+Compact+Framework" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Fdatamatrixnet-ported-to-compact-framework%2F&amp;T=DataMatrix.Net+ported+to+Compact+Framework" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Fdatamatrixnet-ported-to-compact-framework%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F18%2Fdatamatrixnet-ported-to-compact-framework%2F&amp;t=DataMatrix.Net+ported+to+Compact+Framework" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2010/03/18/datamatrixnet-ported-to-compact-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using ws.geonames.org timezone webservice without WSDL</title>
		<link>http://www.hjgode.de/wp/2010/03/04/using-ws-geonames-org-timezone-webservice-without-wsdl/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-ws-geonames-org-timezone-webservice-without-wsdl</link>
		<comments>http://www.hjgode.de/wp/2010/03/04/using-ws-geonames-org-timezone-webservice-without-wsdl/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 13:08:08 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[blocking]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[timezone]]></category>
		<category><![CDATA[timezone-web-service]]></category>
		<category><![CDATA[windows mobile]]></category>
		<category><![CDATA[ws.geonames.org]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=413</guid>
		<description><![CDATA[How to use ws.geonames.org/timezone and other raw webservices from windows mobile dotnet compact framework]]></description>
			<content:encoded><![CDATA[<p>The great site geonames.org offers some webservices. One of these is called timezone and will give you the timezone information for a given geographic Latitude and Longitude. With a GPS enabled Windows Mobile device you can so query the webservice and get timezone informations for the current location.</p>
<p>Unfortunately the webservice does not offer WSDL and so you have to write your own wrapper class. I wrote a small class that does the HttpWebRequest and decodes the xml reponse for easy use in your application.</p>
<p><span id="more-413"></span></p>
<p>When you query the webservice you have to use the following form:</p>
<pre><a href="http://ws.geonames.org/timezone?lat=47.01&amp;lng=10.2">http://ws.geonames.org/timezone?lat=47.01&amp;lng=10.2</a></pre>
<p>The answer will then be:</p>
<pre>         &lt;geonames&gt;
            &lt;timezone&gt;
                &lt;countryCode&gt;AT&lt;/countryCode&gt;
                &lt;countryName&gt;Austria&lt;/countryName&gt;
                &lt;lat&gt;47.01&lt;/lat&gt;
                &lt;lng&gt;10.2&lt;/lng&gt;
                &lt;timezoneId&gt;Europe/Vienna&lt;/timezoneId&gt;
                &lt;dstOffset&gt;2.0&lt;/dstOffset&gt;
                &lt;gmtOffset&gt;1.0&lt;/gmtOffset&gt;
                &lt;rawOffset&gt;1.0&lt;/rawOffset&gt;
                &lt;time&gt;2010-03-02 12:14&lt;/time&gt;
            &lt;/timezone&gt;
        &lt;/geonames&gt;</pre>
<p>The sample application will use this answer and shows the result:</p>
<p><a rel="attachment wp-att-414" href="http://www.hjgode.de/wp/2010/03/04/using-ws-geonames-org-timezone-webservice-without-wsdl/clipboard02/"><img class="alignnone size-full wp-image-414" title="Get Timezone by GPS" src="http://www.hjgode.de/wp/wp-content/uploads/2010/03/Clipboard02.gif" alt="" width="240" height="320" /></a></p>
<p>The attached Visual Studio 2005 SmartDevice Windows Mobile 5 project has two classes: GeonamesTZ is a blocking class and geonamesTZ is a non-blocking class.</p>
<p>A blocking code is never good and so I implemented the class with an event. To use the class include a using statement for the geonames namespace and then initialize a new geonamesTZ object. Then add an event handler for the object’s event delegate. Finally add a event handler function that will get the timezone data.</p>
<pre lang="CSHARP">using geonames;
    public partial class Form1 : Form
    {
        geonamesTZ myGeoTZ;
        geonamesTZfields tzFields;

        public Form1()
        {
            InitializeComponent();
            myGeoTZ = new geonamesTZ();
            myGeoTZ.geonamesEventHandler += new geonamesEvent(myGeoTZ_geonamesEvent);
        }

        void myGeoTZ_geonamesEvent(object sender, geonamesEventArgs e)
        {
            //Cursor.Current = Cursors.Default;
            //MessageBox.Show(e.m_myEventArgumentdata.strCountryName);
            tzFields = e.m_myEventArgumentdata;
            updateUI(tzFields);
        }
</pre>
<p>To get the timezone information you have to call the class function</p>
<pre lang="CSHARP">            myGeoTZ.startRequest(txtLat.Text, txtLng.Text); //the answer should come...</pre>
<p>and after some time the function myGeoTZ_geonamesEvent is called with the received data. Using the event driven approach will give the possibility to write an app that reads GPS data and updates timezone information in the background. Maybe this is usefull for Windows Mobile phones that often ’fly’ between continents. The timezone can then be updated in background.</p>
<p>As updating the UI from a different thread may fail, the updateUI function is implemented like this:</p>
<pre lang="CSHARP">        // see http://blog.opennetcf.com/ctacke/2008/12/03/ControlInvokeWithoutExplicitDelegates.aspx
        public void updateUI(geonames.geonamesTZfields myTZinfos)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new EventHandler(delegate(object o, EventArgs a)
                {
                    txtDSToffset.Text = myTZinfos.dstOffset.ToString();
                    txtGMToffset.Text = myTZinfos.gmtOffset.ToString();
                    txtTimzoneID.Text = myTZinfos.strTimezoneID;
                    txtTime.Text = myTZinfos.tzTime.ToString();
                    txtTZcountryCode.Text = myTZinfos.strCountryCode;
                    lblStatus.Text = myTZinfos.strLastError;
                }));
            }
            else
            {
                txtDSToffset.Text = myTZinfos.dstOffset.ToString();
                txtGMToffset.Text = myTZinfos.gmtOffset.ToString();
                txtTimzoneID.Text = myTZinfos.strTimezoneID;
                txtTime.Text = myTZinfos.tzTime.ToString();
                txtTZcountryCode.Text = myTZinfos.strCountryCode;
                lblStatus.Text = myTZinfos.strLastError;
            }
        }</pre>
<p>That was much easier than doing invokes on every txt field separately.</p>
<p>The raw xml response is parsed by another class called xml_helper. This class makes it easy to extract single values from the raw xml response. Here is one example:</p>
<pre lang="CSHARP">namespace xml_helper{
    public static class xml_helper
    {
        public static string getStrSetting(StringBuilder sb, String sField)
        {
            string sVal = sb.ToString();
            string sFieldString = "&lt;" + sField + "&gt;";
            int iIdx = sVal.IndexOf(sFieldString);
            string sResult = "";
            if (iIdx &gt;= 0)
            {
                string fieldStr = sVal.Substring(iIdx);
                string ssidStr = fieldStr.Remove(0, sFieldString.Length);
                iIdx = ssidStr.IndexOf("&lt;/");
                sResult = ssidStr.Substring(0, iIdx);
            }
            return sResult;
        }</pre>
<p>These simple functions can be easily used on a xml file with single element data. Just call, for example getStrSettings with the xml string and the setting you would like to get.</p>
<p>Download Visual Studio 2005 SmartDevice Windows Mobile 5 project: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=82" title="Downloaded 244 times">TimeZone by GPS demo application</a> -  (Hits: 244, size: 52.09 KB)</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F04%2Fusing-ws-geonames-org-timezone-webservice-without-wsdl%2F&amp;title=Using+ws.geonames.org+timezone+webservice+without+WSDL" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F04%2Fusing-ws-geonames-org-timezone-webservice-without-wsdl%2F&amp;title=Using+ws.geonames.org+timezone+webservice+without+WSDL" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F04%2Fusing-ws-geonames-org-timezone-webservice-without-wsdl%2F&amp;title=Using+ws.geonames.org+timezone+webservice+without+WSDL" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F04%2Fusing-ws-geonames-org-timezone-webservice-without-wsdl%2F&amp;T=Using+ws.geonames.org+timezone+webservice+without+WSDL" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F04%2Fusing-ws-geonames-org-timezone-webservice-without-wsdl%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2010%2F03%2F04%2Fusing-ws-geonames-org-timezone-webservice-without-wsdl%2F&amp;t=Using+ws.geonames.org+timezone+webservice+without+WSDL" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2010/03/04/using-ws-geonames-org-timezone-webservice-without-wsdl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hooking the keyboard message queue in compact framework code</title>
		<link>http://www.hjgode.de/wp/2009/12/04/hooking-the-keyboard-message-queue-in-compact-framework-code/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hooking-the-keyboard-message-queue-in-compact-framework-code</link>
		<comments>http://www.hjgode.de/wp/2009/12/04/hooking-the-keyboard-message-queue-in-compact-framework-code/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 21:26:03 +0000</pubDate>
		<dc:creator>josef</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Keyboard]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cf2]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[hooking]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[message]]></category>
		<category><![CDATA[queue]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=240</guid>
		<description><![CDATA[Hooking the keyboard message queue in CF2]]></description>
			<content:encoded><![CDATA[<p>Here is some nice code to use a keyboard hook implemented in C# for compact framework.</p>
<p>You can use this to catch the funny OS asigned keys like F1, F2, F3, F4, F6 and F7 (Softkey 1 and 2, Phone, End, Volume Up, Volume Down); and last but not least catch the Win Key press.</p>
<p><span id="more-240"></span>The hooking class:</p>
<pre lang="csharp">using System;
using System.Runtime.InteropServices;
/*
In order to use this class in your program, just declare the varialble and hook up into HookEvent:
HookKeys hook = new HookKeys();
hook.HookEvent += new HookKeys.HookEventHandler(HookEvent);
hook.Start();
*/
public class HookKeys
{
#region delegates
    public delegate int HookProc(int code, IntPtr wParam, IntPtr lParam);
    public delegate void HookEventHandler(HookEventArgs e, KeyBoardInfo keyBoardInfo);
    public HookEventHandler HookEvent;
#endregion
#region fields
    private HookProc hookDeleg;
    private static int hHook = 0;
#endregion

    public HookKeys()
    {
    }
    ~HookKeys(){
        if(hHook!=0)
            this.Stop();
    }
    #region public methods
    ///
    /// Starts the hook
    ///
    public void Start()
    {
        if (hHook != 0)
        {
            //Unhook the previouse one
            this.Stop();
        }
        hookDeleg = new HookProc(HookProcedure);
        hHook = SetWindowsHookEx(WH_KEYBOARD_LL, hookDeleg, GetModuleHandle(null), 0);
        if (hHook == 0)
        {
            throw new SystemException("Failed acquiring of the hook.");
        }
        AllKeys(true);
    }
    ///
    /// Stops the hook
    ///
    public void Stop()
    {
        UnhookWindowsHookEx(hHook);
        AllKeys(false);
    }
    #endregion
    #region protected and private methods
    protected virtual void OnHookEvent(HookEventArgs hookArgs, KeyBoardInfo keyBoardInfo)
    {
        if (HookEvent != null)
        {
            HookEvent(hookArgs, keyBoardInfo);
        }
    }

    private int HookProcedure(int code, IntPtr wParam, IntPtr lParam)
    {
       KBDLLHOOKSTRUCT hookStruct =  (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT));
       if (code &lt; 0)
            return CallNextHookEx(hookDeleg, code, wParam, lParam);
       // Let clients determine what to do
       HookEventArgs e = new HookEventArgs();
       e.Code = code;
       e.wParam = wParam;
       e.lParam = lParam;
       KeyBoardInfo keyInfo = new KeyBoardInfo();
       keyInfo.vkCode = hookStruct.vkCode;
       keyInfo.scanCode = hookStruct.scanCode;
       OnHookEvent(e, keyInfo);
       // Yield to the next hook in the chain
       return CallNextHookEx(hookDeleg, code, wParam, lParam);
   }
   #endregion
   #region P/Invoke declarations

   [DllImport("coredll.dll")]
   private static extern int AllKeys(bool bEnable);

   [DllImport("coredll.dll")]
   private static extern int SetWindowsHookEx(int type, HookProc hookProc, IntPtr hInstance, int m);
   [DllImport("coredll.dll")]
   private static extern IntPtr GetModuleHandle(string mod);
   [DllImport("coredll.dll")]
   private static extern int CallNextHookEx(
           HookProc hhk,
           int nCode,
           IntPtr wParam,
           IntPtr lParam
           );
   [DllImport("coredll.dll")]
   private static extern int GetCurrentThreadId();
   [DllImport("coredll.dll", SetLastError = true)]
   private static extern int UnhookWindowsHookEx(int idHook);
   private struct KBDLLHOOKSTRUCT
   {
       public int vkCode;
       public int scanCode;
       public int flags;
       public int time;
       public IntPtr dwExtraInfo;
   }
   const int WH_KEYBOARD_LL = 20;
   #endregion
}
#region event arguments

    public class HookEventArgs : EventArgs
    {
        public int Code;    // Hook code
        public IntPtr wParam;   // WPARAM argument
        public IntPtr lParam;   // LPARAM argument
    }
    public class KeyBoardInfo
    {
        public int vkCode;
        public int scanCode;
        public int flags;
        public int time;
    }
#endregion
</pre>
<p>Here is the download of the Visual Studio 2005 Windows Mobile 6 SDK targeting source code:</p>
<b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=46" title="Downloaded 1029 times">KbdHookCS</a> - Keyboard hooking in compact framework (Hits: 1029, size: 31.69 KB)
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F12%2F04%2Fhooking-the-keyboard-message-queue-in-compact-framework-code%2F&amp;title=Hooking+the+keyboard+message+queue+in+compact+framework+code" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F12%2F04%2Fhooking-the-keyboard-message-queue-in-compact-framework-code%2F&amp;title=Hooking+the+keyboard+message+queue+in+compact+framework+code" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F12%2F04%2Fhooking-the-keyboard-message-queue-in-compact-framework-code%2F&amp;title=Hooking+the+keyboard+message+queue+in+compact+framework+code" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F12%2F04%2Fhooking-the-keyboard-message-queue-in-compact-framework-code%2F&amp;T=Hooking+the+keyboard+message+queue+in+compact+framework+code" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F12%2F04%2Fhooking-the-keyboard-message-queue-in-compact-framework-code%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F12%2F04%2Fhooking-the-keyboard-message-queue-in-compact-framework-code%2F&amp;t=Hooking+the+keyboard+message+queue+in+compact+framework+code" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2009/12/04/hooking-the-keyboard-message-queue-in-compact-framework-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iTextSharp running on Compact Framework &#8211; Windows Mobile</title>
		<link>http://www.hjgode.de/wp/2009/10/31/itextsharp-running-on-compact-framework-windows-mobile/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=itextsharp-running-on-compact-framework-windows-mobile</link>
		<comments>http://www.hjgode.de/wp/2009/10/31/itextsharp-running-on-compact-framework-windows-mobile/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 19:24:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Compact Framework]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[hjgode-itextsharp]]></category>
		<category><![CDATA[iTextSharp]]></category>
		<category><![CDATA[iTextSharpCF]]></category>
		<category><![CDATA[itextsharpcf-download]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[windows mobile]]></category>

		<guid isPermaLink="false">http://www.hjgode.de/wp/?p=231</guid>
		<description><![CDATA[iTextSharp ported to Compact Framework]]></description>
			<content:encoded><![CDATA[<h3>PDF library iTextSharp working in Compact Framework 2: iTextSharpCF</h3>
<p>Recently I needed a tool to combine several pictures into one file.  First I thought about creating a memory bitmap and then BitBlit the source files into this single bitmap. Then I found an entry about iText and iTextSharp. This is a JAVA and .NET class library to create pdf files. As it seems very easy to use I decided to take a closer look. I found one message, where Marco states he has done a port for .NET compact framework and provided a patch to the sourceforge iTextSharp team. Unfortunately the iTextSharp team seems to ignore this port. So I started with iTextSharp and the patch to get iTextSharp running on Compact Framework.</p>
<p>The patch was done against version 4.0.1 of iTextSharp but there were still some rejects and some additional work to do. The main problem was the use of GetInstance where always the general WebRequest.Create(url); and then GetResponseStream() was used. A first workaround is to load the bitmap first and then provide this to doc.Add:</p>
<p><span id="more-231"></span></p>
<pre lang="CSharp">#if !TEST
 Bitmap myBitmap = new Bitmap(sFilename);
 if (sFilename.ToLower().EndsWith("jpg"))
 img = iTextSharp.text.Image.GetInstance(myBitmap, System.Drawing.Imaging.ImageFormat.Jpeg);
 else if (sFilename.ToLower().EndsWith("gif"))
 img = iTextSharp.text.Image.GetInstance(myBitmap, System.Drawing.Imaging.ImageFormat.Gif);
 else if (sFilename.ToLower().EndsWith("bmp"))
 img = iTextSharp.text.Image.GetInstance(myBitmap, System.Drawing.Imaging.ImageFormat.Bmp);
 else if (sFilename.ToLower().EndsWith("png"))
 img = iTextSharp.text.Image.GetInstance(myBitmap, System.Drawing.Imaging.ImageFormat.Png);
 else
 throw new NotSupportedException("Unsupported image format");
#else
 img = iTextSharp.text.Image.GetInstance(sFilename);
#endif
 doc.Add(img);
</pre>
<p>The GetResponseStream() returns a stream or filestream within full framework. But with Comapct Framework you will always get &#8216;NotSupportedException&#8217; for local files. The CF does not support local files within GetResponseStream. The URI for a local file is &#8216;file://&#8230;&#8217; and an easy replacement for getting a filestream was to use &#8216;new FileStream(url.LocalPath, FileMode.Open);&#8217;. I did insert a #ifdef in all source files with GetResponseStream() as I have no real need to build image instances from network files:</p>
<pre lang="CSharp">//NETCF does not know fileWebRequest (file://...)
#if !NETCF
 WebRequest w = WebRequest.Create(url);
 istr = w.GetResponse().GetResponseStream();
#else
 istr = new FileStream(url.LocalPath, FileMode.Open);
#endif
</pre>
<p>There are also some more #if !NETCF inside the source files for everything that differs between full and compact framework.</p>
<p>The attached zip archive has all files you need to compile and use iTextSharp on your windows mobile. The Visual Studio 2005 solution includes a simple demo application that allows you to add some image files and create a PDF with the filenames and images inside. I inserted a new page for every image. The solution is written against the target &#8220;Windows Mobile 6 Prof&#8221;. So you need Windows Mobile 6 SDK installed.</p>
<p><img class="alignnone size-medium wp-image-232" title="Screen01" src="http://www.hjgode.de/wp/wp-content/uploads/2009/10/Screen01-225x300.jpg" alt="Screen01" width="225" height="300" /> <img class="alignnone size-medium wp-image-233" title="Screen02" src="http://www.hjgode.de/wp/wp-content/uploads/2009/10/Screen02-225x300.jpg" alt="Screen02" width="225" height="300" /></p>
<p>The left screen shows the demo application and the right one the created pdf inside Adobe Reader Mobile.</p>
<p>The <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1689935&amp;group_id=72954&amp;atid=536238" target="_blank">incomplete patch source</a></p>
<p>A <a href="http://itextsharp.sourceforge.net/tutorial/" target="_blank">tiny tutorial</a> for iTextSharp usage</p>
<p>The new full source: <b>DOWNLOAD:</b><a href="http://www.hjgode.de/wp/wp-content/plugins/download-monitor/download.php?id=45" title="Downloaded 684 times">iTextSharpCF-4.0.1_CF</a> - Sample source code using the modified iTextSharp library (also included) (Hits: 684, size: 3.23 MB)</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F10%2F31%2Fitextsharp-running-on-compact-framework-windows-mobile%2F&amp;title=iTextSharp+running+on+Compact+Framework+%26%238211%3B+Windows+Mobile" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F10%2F31%2Fitextsharp-running-on-compact-framework-windows-mobile%2F&amp;title=iTextSharp+running+on+Compact+Framework+%26%238211%3B+Windows+Mobile" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F10%2F31%2Fitextsharp-running-on-compact-framework-windows-mobile%2F&amp;title=iTextSharp+running+on+Compact+Framework+%26%238211%3B+Windows+Mobile" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F10%2F31%2Fitextsharp-running-on-compact-framework-windows-mobile%2F&amp;T=iTextSharp+running+on+Compact+Framework+%26%238211%3B+Windows+Mobile" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F10%2F31%2Fitextsharp-running-on-compact-framework-windows-mobile%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fwww.hjgode.de%2Fwp%2F2009%2F10%2F31%2Fitextsharp-running-on-compact-framework-windows-mobile%2F&amp;t=iTextSharp+running+on+Compact+Framework+%26%238211%3B+Windows+Mobile" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.hjgode.de/wp/wp-content/plugins/social-bookmarks0/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.hjgode.de/wp/2009/10/31/itextsharp-running-on-compact-framework-windows-mobile/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

