<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4780780974962088167</id><updated>2011-07-30T21:04:49.702-07:00</updated><category term='NumericTextBox'/><category term='NSIS and MFC Visual Studio 2005'/><category term='JDK 6.0'/><category term='ASCIIEncoding'/><category term='FileAttributes'/><category term='Windows Mobile'/><category term='JDK 5.0'/><category term='msdn'/><category term='User Interface'/><category term='Ubuntu 10.04 64 bit'/><category term='Decoder'/><category term='EventLog'/><category term='Encoding'/><category term='Cursor Position'/><category term='VirtualBox'/><category term='FileVersion'/><category term='Logging'/><category term='Diagnostics'/><category term='Alpha blending'/><category term='codeplex'/><category term='Froyo'/><category term='Ubuntu 10.04'/><category term='c#'/><category term='TextBox IsNumeric'/><category term='UnicodeEncoding'/><category term='Reflection'/><category term='Android 2.2'/><category term='Application Path'/><category term='Assembly'/><category term='File'/><category term='iPhoneUI'/><category term='P/Invoke'/><category term='SpecialFolder'/><category term='Marshal'/><category term='Custom control'/><category term='file attributes'/><category term='Ubuntu 10.04 32 bit'/><category term='FileInfo'/><category term='VirtualBox Guest Additions'/><category term='byte[]'/><category term='mouse_event'/><title type='text'>The Code Is Art</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-5533086912852558181</id><published>2011-03-28T05:18:00.000-07:00</published><updated>2011-03-28T05:29:36.240-07:00</updated><title type='text'>Application install Failed due to INSTALL_FAILED_CONTAINER_ERROR</title><content type='html'>Recently discovered a new error when installing my application on my G1 (with Froyo 2.2.2)&lt;br /&gt;&lt;br /&gt;The eclipse error was:&lt;br /&gt; &lt;blockquote&gt;Installation error: INSTALL_FAILED_CONTAINER_ERROR&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;than I solve it with this steps:&lt;br /&gt;&lt;br /&gt;1. Open adb with shell, type: &lt;blockquote&gt;adb shell&lt;/blockquote&gt; (I get # sing)&lt;br /&gt;   &lt;span style="font-weight:bold;"&gt;NOTE&lt;/span&gt; If you get $ sign type: &lt;blockquote&gt;su&lt;/blockquote&gt; and you'll become a super user (# sign).&lt;br /&gt;2. Remove the nasty (temp) file &lt;blockquote&gt;rm /mnt/secure/asec/smdl2tmp1.asec&lt;/blockquote&gt; &lt;br /&gt;&lt;br /&gt;that's all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-5533086912852558181?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/5533086912852558181/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=5533086912852558181' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/5533086912852558181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/5533086912852558181'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2011/03/application-install-failed-due-to.html' title='Application install Failed due to INSTALL_FAILED_CONTAINER_ERROR'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-8853807036599965791</id><published>2010-07-14T00:06:00.000-07:00</published><updated>2010-07-26T05:20:21.753-07:00</updated><title type='text'>Froyo Build - First Fastboot</title><content type='html'>Now I'm able to build froyo image, but I have an error flashing it.&lt;br /&gt;The error is :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;fastboot update Dream.zip -w&lt;br /&gt;archive does not contain 'boot.sig'&lt;br /&gt;archive does not contain 'recovery.sig'&lt;br /&gt;archive does not contain 'system.sig'&lt;br /&gt;--------------------------------------------&lt;br /&gt;Bootloader Version...: 0.95.3000&lt;br /&gt;Baseband Version.....: 2.22.19.26I&lt;br /&gt;Serial Number........: HT91RL(XXXXXX)&lt;br /&gt;--------------------------------------------&lt;br /&gt;              checking product... OKAY [  0.006s]&lt;br /&gt;             checking serialno... OKAY [  0.009s]&lt;br /&gt;   checking version-bootloader... OKAY [  0.012s]&lt;br /&gt;     checking version-baseband... FAILED&lt;br /&gt;&lt;br /&gt;Device version-baseband is '2.22.19.26I'.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Update requires '2.22.26.07'.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;finished. total time: 0.070s&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The solution is:&lt;br /&gt;Open the board-info.txt and replace &lt;br /&gt;&lt;pre&gt;require version-baseband=2.22.26.07&lt;/pre&gt; with this &lt;pre&gt;require version-baseband=2.22.19.26I&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy flashing&lt;br /&gt;&lt;br /&gt;Dr.Luiji&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-8853807036599965791?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/8853807036599965791/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=8853807036599965791' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8853807036599965791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8853807036599965791'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2010/07/froyo-build-first-fastboot.html' title='Froyo Build - First Fastboot'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-1171289029646368948</id><published>2010-07-12T05:13:00.000-07:00</published><updated>2010-07-12T05:25:36.033-07:00</updated><title type='text'>How to use VirtualBox USB passthrough (Windows host to Ubuntu guest)</title><content type='html'>I've had some problems with the ADB via VirtualBox USB passthrough. My configuration is: Windows 7 (host) to Ubuntu 10.04 64-bit (guest) and my VirtualBox version is 3.2.6.&lt;br /&gt;&lt;br /&gt;This &lt;a href="http://forum.xda-developers.com/showthread.php?t=570452"&gt;article&lt;/a&gt;[&lt;a href="http://forum.xda-developers.com/showthread.php?t=570452" target="_blank" title="New Window"&gt;^&lt;/a&gt;] solve my problem.&lt;br /&gt;&lt;br /&gt;Many thanks commandar&lt;br /&gt;&lt;br /&gt;Dr.Luiji&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-1171289029646368948?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/1171289029646368948/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=1171289029646368948' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/1171289029646368948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/1171289029646368948'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2010/07/how-to-use-virtualbox-usb-passthrough.html' title='How to use VirtualBox USB passthrough (Windows host to Ubuntu guest)'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-4285354229815775857</id><published>2010-07-09T02:15:00.000-07:00</published><updated>2010-07-09T02:38:42.815-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox Guest Additions'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04 32 bit'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04 64 bit'/><title type='text'>How to: Install VirtualBox Guest Additions into Ubuntu</title><content type='html'>If you try to install VirtualBox Guest Additions in Ubuntu 10.04 32-bit or 64-bit, you'll have some problems with administrator privileges.&lt;br /&gt;&lt;br /&gt;The fast way is open it with the autorun prompt. The steps are 2.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Install the VirtualBox Guest Additions from the VirtualBox menu. Now in the Ubuntu's Destop you will find the CD link, something like VBOXADDITIONS_XXXX&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Right click on the VBOXADDITIONS_XXXX icon on Desktop and select 'Open with Autorun Prompt'. Insert your password.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Wait the end of installation (about one minute) and restart your SO. &lt;br /&gt;&lt;br /&gt;Have a nice day&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-4285354229815775857?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/4285354229815775857/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=4285354229815775857' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/4285354229815775857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/4285354229815775857'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2010/07/how-to-install-virtualbox-guest.html' title='How to: Install VirtualBox Guest Additions into Ubuntu'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-1730983834084951939</id><published>2010-07-09T00:02:00.000-07:00</published><updated>2010-07-09T00:50:52.297-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Froyo'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04 32 bit'/><category scheme='http://www.blogger.com/atom/ns#' term='JDK 5.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04 64 bit'/><category scheme='http://www.blogger.com/atom/ns#' term='Android 2.2'/><title type='text'>Froyo Build - 64-bit SO is preferred</title><content type='html'>I found this post on google groups.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://groups.google.com/group/android-building/browse_thread/thread/193332fd6850a2a"&gt;&lt;br /&gt;Build Error during Make&lt;/a&gt;&lt;br /&gt;Where Jean-Baptiste M. "JBQ" Queru said:&lt;br /&gt;&lt;pre&gt;Java6 is not available in 32-bit on all platforms. &lt;br /&gt;Given that all of Google's development and testing happens on builds&lt;br /&gt;created on 64-bit machines, there's some level of risk in letting&lt;br /&gt;device manufacturers use 32-bit environments as we don't know what&lt;br /&gt;happens in those cases. Java6 allows us to standardize on 64-bit and&lt;br /&gt;eliminate that risk. &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And I found an Issue that is exactly mine (10 hours ago).&lt;br /&gt;&lt;a href="http://code.google.com/p/android/issues/detail?id=9605"&gt;Android Build issue with Ubuntu 10.04&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I can't wait the answer I switch to 64 environment.&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-1730983834084951939?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/1730983834084951939/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=1730983834084951939' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/1730983834084951939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/1730983834084951939'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2010/07/froyo-build-64-bit-so-is-preferred.html' title='Froyo Build - 64-bit SO is preferred'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-7635211250303843288</id><published>2010-07-08T23:49:00.000-07:00</published><updated>2010-07-09T08:58:07.681-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JDK 6.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Froyo'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04 32 bit'/><category scheme='http://www.blogger.com/atom/ns#' term='JDK 5.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Android 2.2'/><title type='text'>Froyo Build - JDK 6 is the correct version</title><content type='html'>To build the files you need the java 6. The Android documents are out of date.&lt;br /&gt;This is the error if you build with the java 5&lt;br /&gt;&lt;pre&gt; &lt;br /&gt;You are attempting to build with the incorrect version&lt;br /&gt;of java.&lt;br /&gt;Your version is: java version "1.5.0_19".&lt;br /&gt;The correct version is: 1.6.&lt;/pre&gt;&lt;br /&gt;Jean-Baptiste Queru answer to my question: &lt;a href=https://groups.google.com/group/android-building/browse_thread/thread/f2a3f9d03d63612/ddcd8ed21c28f455?lnk=gst&amp;q=java+6#ddcd8ed21c28f455"&gt; JDK 5 or 6?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So I install &lt;span style="font-weight:bold;"&gt;JDK 6.0&lt;/span&gt; under &lt;span style="font-weight:bold;"&gt;Ubuntu 10.04 32 bi&lt;/span&gt;t with these command-line:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"&lt;br /&gt;sudo apt-get update&lt;br /&gt;sudo apt-get install sun-java6-jdk&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-7635211250303843288?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/7635211250303843288/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=7635211250303843288' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/7635211250303843288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/7635211250303843288'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2010/07/froyo-build-jdk-6-is-correct-version.html' title='Froyo Build - JDK 6 is the correct version'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-3780229324578703052</id><published>2010-07-08T07:23:00.000-07:00</published><updated>2010-07-09T00:51:30.597-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Froyo'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04 32 bit'/><category scheme='http://www.blogger.com/atom/ns#' term='JDK 5.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Android 2.2'/><title type='text'>Froyo Build - Set bin directory is in your path on Ubuntu 10.04</title><content type='html'>If you haven't the bin directory is in your path, add it with these commands&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Open the user .bashrc &lt;br /&gt;&lt;pre&gt;&lt;br /&gt; sudo gedit ~/.bashrc&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add at the end the bin file this line&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; PATH=~/bin:"${PATH}"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Save and exit.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-3780229324578703052?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/3780229324578703052/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=3780229324578703052' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/3780229324578703052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/3780229324578703052'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2010/07/froyo-build-installing-repo-on-ubuntu.html' title='Froyo Build - Set bin directory is in your path on Ubuntu 10.04'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-1477080414214623787</id><published>2010-07-08T07:13:00.000-07:00</published><updated>2010-07-09T00:50:18.071-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Froyo'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04 32 bit'/><category scheme='http://www.blogger.com/atom/ns#' term='JDK 5.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Android 2.2'/><title type='text'>Froyo Build - Intrepid (8.10) on Ubuntu 10.04</title><content type='html'>The third step to set up your Linux development is not needed if you are not a Intrepid ( 8.10) users.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ sudo apt-get install lib32readline5-dev &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-1477080414214623787?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/1477080414214623787/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=1477080414214623787' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/1477080414214623787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/1477080414214623787'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2010/07/froyo-build-intrepid-810-on-ubuntu-1004.html' title='Froyo Build - Intrepid (8.10) on Ubuntu 10.04'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-3184918804633366811</id><published>2010-07-08T02:07:00.000-07:00</published><updated>2010-07-08T07:08:34.212-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.04'/><category scheme='http://www.blogger.com/atom/ns#' term='Froyo'/><category scheme='http://www.blogger.com/atom/ns#' term='JDK 5.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Android 2.2'/><title type='text'>Froyo Build - Install JDK 5.0 on Ubuntu 10.04</title><content type='html'>&lt;h2&gt;Intro&lt;/h2&gt;&lt;br /&gt;Recently I've decided to build the Android system image (Froyo) for my ADP1 from the lastest Android Open Source Project (AOSP).&lt;br /&gt;I try to build it on Ubuntu Linux 10.04 LTS Desktop Edition 32-bit (x86).&lt;br /&gt;&lt;br /&gt;If you'll follow the steps in &lt;a href="http://source.android.com/source/download.html"&gt;Getting the Source&lt;/a&gt; probably you'll find some issues.&lt;br /&gt;The first issue will be in the first step (Setting up your machine), installing the packages for Sun JDK 5.&lt;br /&gt;The command below it gives you an error about JDK 5. &lt;pre lang="cs"&gt;&lt;br /&gt;sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev &lt;br /&gt;&lt;br /&gt;E: Couldn't find package sun.java5.jdk&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, before of this command you have to use the cure to enable JDK5 and below you can find all the instruction.&lt;br /&gt;&lt;h2&gt;Install JDK 5.0 &lt;br&gt;&lt;/h2&gt;&lt;br /&gt;These are the steps to solve the problem. &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Open the sources.list with GEdit or with your preferred editor&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;br /&gt;sudo gedit /etc/apt/sources.list&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Enable the package including in the list the Sun JDK 5. Add this line at the end of file.&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;br /&gt;deb http://ir.archive.ubuntu.com/ubuntu jaunty-updates main multiverse&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Update you package &lt;br /&gt;&lt;pre lang="cs"&gt;&lt;br /&gt;sudo aptitude update&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Now you may install it with all the others packages&lt;br /&gt;&lt;pre lang="cs"&gt;&lt;br /&gt;sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;or alone &lt;br /&gt;&lt;pre lang="cs"&gt;&lt;br /&gt;sudo apt-get install sun-java5-jdk &lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;That's all. Now you can continue with the Android's document. &lt;br /&gt;Have a nice day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-3184918804633366811?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/3184918804633366811/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=3184918804633366811' title='8 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/3184918804633366811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/3184918804633366811'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2010/07/froyo-build-install-jdk-50-on-ubuntu.html' title='Froyo Build - Install JDK 5.0 on Ubuntu 10.04'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-4409985528490645481</id><published>2009-07-09T02:46:00.000-07:00</published><updated>2009-07-09T03:00:22.645-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Assembly'/><category scheme='http://www.blogger.com/atom/ns#' term='Reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='FileVersion'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='FileInfo'/><title type='text'>Get the version information of an extern assembly</title><content type='html'>We have more ways to get the information of an assembly, the most two I use are:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Only for .NET assembly&lt;br /&gt;&lt;pre class="csharp"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.Reflection.&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Assembly&lt;/span&gt; AssemblyFileInfo = System.Reflection.&lt;span style="color: rgb(43, 145, 175);"&gt;Assembly&lt;/span&gt;.Load(FileAppPath);&lt;br /&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(0, 0, 0);"&gt;WriteLine&lt;/span&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;AssemblyFileInfo.&lt;span style="color: rgb(0, 0, 0);"&gt;GetName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;.&lt;span style="color: rgb(43, 145, 175);"&gt;Version&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;For all .NET and native assembly&lt;br /&gt;&lt;pre class="csharp"&gt;FileVersionInfo AssemblyFileVersion = &lt;span style="color: rgb(43, 145, 175);"&gt;&lt;/span&gt;System.Diagnostics.FileVersionInfo.GetVersionInfo(FileAppPath);&lt;br /&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(0, 0, 0);"&gt;WriteLine(&lt;/span&gt;AssemblyFileVersion.FileVersion)&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-4409985528490645481?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/4409985528490645481/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=4409985528490645481' title='6 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/4409985528490645481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/4409985528490645481'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2009/07/get-version-information-of-extern.html' title='Get the version information of an extern assembly'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-7971084044871500231</id><published>2009-06-09T06:12:00.001-07:00</published><updated>2009-07-14T05:04:09.203-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='Application Path'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='FileInfo'/><title type='text'>Application Path</title><content type='html'>Sometime I need to retrieve the application path, here I add the four methods I use frequently.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The simple way   through windows forms:&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;using &lt;/span&gt;System.Windows.Forms;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;String &lt;/span&gt;sAppPath1 = &lt;span style="color: rgb(51, 204, 255);"&gt;Application&lt;/span&gt;.StartupPath;&lt;/li&gt;&lt;li&gt;From the binary over reflection:&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;String &lt;/span&gt;sAppPath2 = System.IO.&lt;span style="color: rgb(51, 204, 255);"&gt;Path&lt;/span&gt;.GetDirectoryName(System.Reflection.&lt;span style="color: rgb(51, 204, 255);"&gt;Assembly&lt;/span&gt;.GetExecutingAssembly().GetName().CodeBase );&lt;/li&gt;&lt;li&gt;Using the file informations:&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;FileInfo &lt;/span&gt;executableFileInfo = new &lt;span style="color: rgb(51, 204, 255);"&gt;FileInfo &lt;/span&gt;(&lt;span style="color: rgb(51, 204, 255);"&gt;Application&lt;/span&gt;.ExecutablePath);&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;String &lt;/span&gt;sAppPath3 = executableFileInfo.DirectoryName;&lt;/li&gt;&lt;li&gt;When my program is started from another:&lt;br /&gt;System.IO.&lt;span style="color: rgb(51, 204, 255);"&gt;Path&lt;/span&gt;.GetDirectoryName(System.Reflection.&lt;span style="color: rgb(51, 204, 255);"&gt;Assembly&lt;/span&gt;.GetExecutingAssembly().Location);&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Happy coding.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-7971084044871500231?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/7971084044871500231/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=7971084044871500231' title='1 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/7971084044871500231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/7971084044871500231'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2009/06/application-path.html' title='Application Path'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-8216745952102399548</id><published>2009-03-17T08:49:00.000-07:00</published><updated>2009-03-17T08:50:42.577-07:00</updated><title type='text'>Creating attractive UIs on Windows Mobile devices</title><content type='html'>Next week Alex Yakhnin will show us how to customize built-in controls that come with .NET CF, such as TextBox, DataGrid, ListView etc...&lt;br /&gt;&lt;br /&gt;The first webcast of the series was great, this second will be better and more interesting. Stay tuned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-8216745952102399548?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/8216745952102399548/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=8216745952102399548' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8216745952102399548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8216745952102399548'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2009/03/creating-attractive-uis-on-windows.html' title='Creating attractive UIs on Windows Mobile devices'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-5579900180879820397</id><published>2009-01-09T16:30:00.000-08:00</published><updated>2009-01-09T16:41:13.925-08:00</updated><title type='text'>iPod touch UI</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ijoL-hTDT9o/SWfuEiOK-KI/AAAAAAAAAEY/vn4rF98FXVc/s1600-h/SampleImage2.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 412px; height: 248px;" src="http://2.bp.blogspot.com/_ijoL-hTDT9o/SWfuEiOK-KI/AAAAAAAAAEY/vn4rF98FXVc/s320/SampleImage2.gif" alt="" id="BLOGGER_PHOTO_ID_5289458049043069090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I continue my journey in the fascinating world of mobile with a new article on TheCodeProject &lt;a href="http://www.codeproject.com/KB/mobile/iPodTouchUI.aspx"&gt;iPod touch UI&lt;/a&gt;[&lt;a href="http://www.codeproject.com/KB/mobile/iPodTouchUI.aspx" target="_blank" title="New Window"&gt;^&lt;/a&gt;].&lt;br /&gt;&lt;br /&gt;Here you can see a new way to work with Alpha blending and a way to work with WMP OCX on mobile. The article focus on&lt;br /&gt;&lt;ul&gt;&lt;li&gt;C#&lt;/li&gt;&lt;li&gt;CF .NET&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Resolution-aware and Orientation-aware  &lt;/li&gt;&lt;li&gt;Dynamic graphic text resize  &lt;/li&gt;&lt;li&gt;Mouse gesture   &lt;/li&gt;&lt;li&gt;Intercepting button  &lt;/li&gt;&lt;li&gt;Work with Windows Media Player OCX on Windows Mobile.   &lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;I hope you enjoy during the reading like me during the develop.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-5579900180879820397?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/5579900180879820397/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=5579900180879820397' title='2 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/5579900180879820397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/5579900180879820397'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2009/01/ipod-touch-ui.html' title='iPod touch UI'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ijoL-hTDT9o/SWfuEiOK-KI/AAAAAAAAAEY/vn4rF98FXVc/s72-c/SampleImage2.gif' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-2915899329810315288</id><published>2008-12-19T13:38:00.000-08:00</published><updated>2009-02-05T12:38:06.938-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='msdn'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhoneUI'/><title type='text'>iPhoneUI on msdn</title><content type='html'>Now you can find my iPhoneUI (codeproject article) on the msdn.&lt;br /&gt;&lt;a href="http://code.msdn.microsoft.com/iPhoneUI"&gt;here&lt;/a&gt;[&lt;a href="http://code.msdn.microsoft.com/iPhoneUI" target="_blank" title="New Window"&gt;^&lt;/a&gt;], take a look.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-2915899329810315288?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/2915899329810315288/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=2915899329810315288' title='3 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/2915899329810315288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/2915899329810315288'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/12/iphoneui-on-msdn.html' title='iPhoneUI on msdn'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-8066823071641383389</id><published>2008-12-19T13:29:00.000-08:00</published><updated>2008-12-19T13:42:44.435-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='codeplex'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhoneUI'/><title type='text'>iPhoneUI on codeplex</title><content type='html'>Many thanks to &lt;span class="SubText"&gt;&lt;a id="ctl00_ctl00_MasterContent_Content_wikiEditByLink" href="http://www.codeplex.com/site/users/view/dkackman"&gt;dkackman&lt;/a&gt;&lt;/span&gt; that add my iPhone UI to codeplex.&lt;br /&gt;He put a modified version up on codeplex and begins a fascinating trip into it.&lt;br /&gt;You can find it directly here: &lt;a href="http://www.codeplex.com/iPhoneUI/"&gt;http://www.codeplex.com/iPhoneUI/&lt;/a&gt;[&lt;a href="http://www.codeplex.com/iPhoneUI/" target="_blank" title="New Window"&gt;^&lt;/a&gt;] take a look.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-8066823071641383389?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/8066823071641383389/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=8066823071641383389' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8066823071641383389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8066823071641383389'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/12/many-thanks-to-dkackman-that-add-iphone.html' title='iPhoneUI on codeplex'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-5837636961492699665</id><published>2008-12-15T04:35:00.000-08:00</published><updated>2008-12-15T14:51:29.558-08:00</updated><title type='text'>OfficeServ Unico is out</title><content type='html'>OfficeServ Unico is one of my last work on mobile.&lt;br /&gt;TELCEN (my company) prepared for Samsung a commercial software that turns smartphone into a single terminal capable of handling all types of communications, GSM-UMTS-HSDPA and VoIP.&lt;br /&gt;&lt;br /&gt;I'll add the direct link to Samsung, where you can see the product,  &lt;a href="http://www.tlc.samsung.it/prodotti/mobilita/OfficeServ-Unico.aspx"&gt;here&lt;/a&gt;[&lt;a href="http://www.tlc.samsung.it/prodotti/mobilita/OfficeServ-Unico.aspx" target="_blank" title="New Window"&gt;^&lt;/a&gt;].&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-5837636961492699665?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/5837636961492699665/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=5837636961492699665' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/5837636961492699665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/5837636961492699665'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/12/officeserv-unico-is-out.html' title='OfficeServ Unico is out'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-2815095968491233093</id><published>2008-12-13T14:35:00.000-08:00</published><updated>2008-12-16T13:23:02.469-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='P/Invoke'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='Alpha blending'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='User Interface'/><title type='text'>iPhone UI</title><content type='html'>&lt;div style="text-align: left;" id="result_box" dir="ltr"&gt;My last effort on Windows Mobile.&lt;br /&gt;&lt;br /&gt;&lt;img id="ctl00_MC_FileUploads_ResourcesRp_ctl03_ArtImage" class="ImagePreview" src="http://www.codeproject.com/KB/mobile/IPhoneUI/iPhoneUI.gif" style="border-width: 0px; height: 550px; width: 362px;" /&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;If I tease your appetite I suggest to see the whole article on codeproject &lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx"&gt;here&lt;/a&gt;[&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx" target="_blank" title="New Window"&gt;^&lt;/a&gt;].&lt;br /&gt;You can find the whole explanation of the program, obviously You find there the source code.&lt;br /&gt;&lt;br /&gt;And this is the article's contents.&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#1"&gt;What is iPhoneUI&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#2"&gt;Introduction&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#3"&gt;Background&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4"&gt;Using the Code&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_1"&gt;The solution&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2"&gt;Home&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_1"&gt;Drawing off screen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_2"&gt;Draw with transparency&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_3"&gt;Initalize the image&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_4"&gt;Drawing all the images&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_5"&gt;Battery level&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_6"&gt;GSM signal strenght&lt;/a&gt; &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_7"&gt;Drawing the animated slide&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_8"&gt;Drawing the time&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_9"&gt;Draw the botton&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_2_10"&gt;Moving the button&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_3"&gt;MainMenu&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_3_1"&gt;Drawing the buttons&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#4_3_2"&gt;Executing the programs or links&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#5"&gt;Links&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#6"&gt;Points of Interest&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeproject.com/KB/mobile/IPhoneUI.aspx#7"&gt;History&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Enjoy.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-2815095968491233093?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/2815095968491233093/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=2815095968491233093' title='8 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/2815095968491233093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/2815095968491233093'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/12/iphone-ui.html' title='iPhone UI'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-3582980439994981464</id><published>2008-12-09T06:25:00.000-08:00</published><updated>2008-12-13T14:31:27.796-08:00</updated><title type='text'>String &amp; P/Invoke with C#</title><content type='html'>Sometime I hear about c# problem with the P/Invoke and string.&lt;br /&gt;Here I add a very simple usage of it, it describe  C++ CString and c# String.&lt;br /&gt;&lt;br /&gt;1. SetWindowText&lt;br /&gt;First I begin with a sample really simple. How to set a string of a dialog. I invoke the SetWindowTextW.&lt;br /&gt;You can define this for mobile app&lt;br /&gt;&lt;pre class="libCScode" style="white-space: pre-wrap;" id="ctl00_rs1_mainContentContainer_ctl02" space="preserve"&gt;[DllImport ("coredll.dll", EntryPoint="SetWindowTextW")]&lt;br /&gt;private static extern void SetWindowText(IntPtr hWnd, string lpString);&lt;/pre&gt;You can define this for desktop app&lt;br /&gt;&lt;pre lang="cs"&gt;[DllImport(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;user32.dll"&lt;/span&gt;), EntryPoint="SetWindowTextW")]&lt;br /&gt;&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;extern&lt;/span&gt; &lt;span class="code-keyword"&gt;bool&lt;/span&gt; SetWindowText(&lt;span class="code-SDKkeyword"&gt;IntPtr&lt;/span&gt; hWnd, &lt;span class="code-keyword"&gt;string&lt;/span&gt; lpString);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Call the function with this code snippet&lt;br /&gt;&lt;pre lang="cs"&gt;public bool SetText(IntPtr hWnd, String text)&lt;br /&gt;{&lt;br /&gt;   System.text.StringBuilder NewWindowText = new System.text.StringBuilder(text);&lt;br /&gt;   return (SetWindowText(hWnd, NewWindowText) != 0);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;GetWindowText&lt;br /&gt;The second example is one that creates more problems. The fault probably is derived from the fact that many people use the String for these conversions instead of the StringBuild. To do this I need two P/Invoke the first for retrieve the lenght the second to retrieve the text.&lt;br /&gt;&lt;br /&gt;You can define this for mobile app&lt;br /&gt;&lt;pre lang="cs"&gt;[DllImport("coredll.dll", CharSet = CharSet.Auto, SetLastError = true), EntryPoint="GetWindowTextW")]&lt;br /&gt;static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);&lt;br /&gt;[DllImport("coredll.dll", SetLastError = true, EntryPoint="GetWindowTextLength")]&lt;br /&gt;static extern int GetWindowTextLength(IntPtr hWnd);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt; You can define this for desktop app&lt;br /&gt;&lt;pre lang="cs"&gt;[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true), EntryPoint="GetWindowTextW")]&lt;br /&gt;static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);&lt;br /&gt;[DllImport("user32.dll", SetLastError = true, EntryPoint="GetWindowTextLength")]&lt;br /&gt;static extern int GetWindowTextLength(IntPtr hWnd);&lt;br /&gt;&lt;/pre&gt;Call the function with this code snippet&lt;pre lang="cs"&gt;public string GetText(IntPtr hWnd)&lt;br /&gt;{&lt;br /&gt;   int length = GetWindowTextLength(hWnd);&lt;br /&gt;    StringBuilder TheWindowText = new StringBuilder(length + 1);&lt;br /&gt;    GetWindowText(hWnd, TheWindowText, TheWindowText.Capacity);&lt;br /&gt;    return TheWindowText.ToString();&lt;br /&gt;}&lt;/pre&gt; If anybody knows any more graceful solution, I'd like to know it.&lt;br /&gt;I hope my suggestions are useful to someone.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-3582980439994981464?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/3582980439994981464/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=3582980439994981464' title='2 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/3582980439994981464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/3582980439994981464'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/12/string-pinvoke-with-c.html' title='String &amp; P/Invoke with C#'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-7685234132870182916</id><published>2008-12-02T00:10:00.000-08:00</published><updated>2008-12-02T02:00:52.384-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EventLog'/><category scheme='http://www.blogger.com/atom/ns#' term='Diagnostics'/><category scheme='http://www.blogger.com/atom/ns#' term='Logging'/><title type='text'>Simple event logging</title><content type='html'>&lt;span style="color:blue;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;With this class your application can write in the event log.&lt;br /&gt;The class use the &lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.Diagnostics &lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;to write the message into the Event log.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;using &lt;span style="color: rgb(0, 0, 0);"&gt;System.Diagnostics;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Logging&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; Source = &lt;span style="color: rgb(163, 21, 21);"&gt;"My Application"&lt;/span&gt;;&lt;/p&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; WriteEventLog(&lt;span style="color:blue;"&gt;string&lt;/span&gt; Message, System.Diagnostics.&lt;span style="color: rgb(43, 145, 175);"&gt;EventLogEntryType&lt;/span&gt; EntryType)&lt;p style="margin: 0px;"&gt;{&lt;span style="color:blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;try&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;    { &lt;/p&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color:blue;"&gt;if&lt;/span&gt; (!&lt;span style="color: rgb(43, 145, 175);"&gt;EventLog&lt;/span&gt;.SourceExists(Source))&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(43, 145, 175);"&gt;EventLog&lt;/span&gt;.CreateEventSource(Source, &lt;span style="color: rgb(163, 21, 21);"&gt;"Application"&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        }&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;       &lt;span style="color: rgb(43, 145, 175);"&gt;EventLog&lt;/span&gt;.WriteEntry(Source, Message, EntryType);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;catch&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Exception&lt;/span&gt; ex)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        System.Diagnostics.&lt;span style="color: rgb(43, 145, 175);"&gt;Debug&lt;/span&gt;.WriteLine(ex.Message);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;     }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;Usage:&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Logging.&lt;/span&gt;WriteEventLog(System.Diagnostics.&lt;span style="color: rgb(43, 145, 175);"&gt;EventLogEntryType&lt;span style="color: rgb(0, 0, 0);"&gt;.Information,&lt;span style="color: rgb(153, 0, 0);"&gt;"Message Error"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;);&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-7685234132870182916?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/7685234132870182916/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=7685234132870182916' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/7685234132870182916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/7685234132870182916'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/12/simple-event-logging.html' title='Simple event logging'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-1212284154515199187</id><published>2008-11-25T03:56:00.000-08:00</published><updated>2008-11-25T04:50:17.209-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FileAttributes'/><category scheme='http://www.blogger.com/atom/ns#' term='file attributes'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='File'/><title type='text'>File attributes with C#</title><content type='html'>The class I've posted shows how to use the fiel attributes with c#.&lt;br /&gt;To get file attributes (in .Net) you need more steps, with this class you have immediatly all you need.&lt;br /&gt;I covered the 4 standard attribute but you can extend the class with other attributes. The file is .called &lt;span style="color: rgb(255, 0, 0);"&gt;FileAttributeEx.cs&lt;/span&gt; and this it the code.&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;br /&gt;using &lt;/span&gt;System;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;using &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;System.IO;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;namespace &lt;/span&gt;FileAttributeEx&lt;br /&gt;{&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;class &lt;/span&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributesEx&lt;/span&gt;&lt;br /&gt; {    &lt;br /&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;private string&lt;/span&gt; filepath = &lt;span style="color: rgb(51, 51, 255);"&gt;string&lt;/span&gt;.Empty;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(51, 51, 255);"&gt;public string&lt;/span&gt; FilePath&lt;br /&gt;     {&lt;br /&gt;         &lt;span style="color: rgb(51, 51, 255);"&gt;get &lt;/span&gt;{ &lt;span style="color: rgb(51, 51, 255);"&gt;return &lt;/span&gt;filepath; }&lt;br /&gt;         &lt;span style="color: rgb(51, 51, 255);"&gt;set &lt;/span&gt;{ &lt;span style="color: rgb(0, 0, 0);"&gt;filepath &lt;/span&gt;= &lt;span style="color: rgb(51, 51, 255);"&gt;value&lt;/span&gt;;}&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;FileAttributesEx() { }&lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;FileAttributesEx(&lt;span style="color: rgb(51, 51, 255);"&gt;string &lt;/span&gt;path)&lt;br /&gt;     {&lt;br /&gt;         FilePath = path;&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;bool &lt;/span&gt;isReadOnly ()&lt;br /&gt;     {&lt;br /&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;return &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;(&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;.GetAttributes(FilePath) &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.ReadOnly) == &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.ReadOnly;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;bool &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;isHidden()&lt;br /&gt;     {&lt;br /&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;return &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.GetAttributes(FilePath) &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.Hidden) == &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.Hidden;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;        &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;bool &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;isArchive()&lt;br /&gt;     {&lt;br /&gt;         &lt;span style="color: rgb(51, 51, 255);"&gt;return &lt;/span&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.GetAttributes(FilePath) &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.Archive) == &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.Archive;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;bool &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;isSystem()&lt;br /&gt;     {&lt;br /&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;return &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.GetAttributes(FilePath) &amp;amp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.System) == &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.System;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;void &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;AddSystem()&lt;br /&gt;     {&lt;br /&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.SetAttributes(FilePath, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.GetAttributes(FilePath) | &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.System);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt; AddReadOnly()&lt;br /&gt;     {&lt;br /&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.SetAttributes(FilePath, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.GetAttributes(FilePath) | &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.ReadOnly);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt; AddHidden()&lt;br /&gt;     {&lt;br /&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.SetAttributes(FilePath, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.GetAttributes(FilePath) | &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.Hidden);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt; AddArchive()&lt;br /&gt;     {&lt;br /&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.SetAttributes(FilePath, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.GetAttributes(FilePath) | &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.Archive);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt; Clear()&lt;br /&gt;     {&lt;br /&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.SetAttributes(filepath, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.GetAttributes(filepath)&lt;br /&gt;             &amp;amp; ~(&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;.Archive | &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.ReadOnly| &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.System|&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;.Hidden));&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;To use it in your project simply, add the file to your project, add a new instance of it and call the metods you need.&lt;br /&gt;Here a sample:&lt;br /&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributesEx &lt;/span&gt;fileAttr = new &lt;span style="color: rgb(51, 153, 153);"&gt;FileAttributesEx&lt;/span&gt;(sFileName);&lt;br /&gt;&lt;br /&gt;if (fileAttr.isArchive())&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;    //Do something&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt; if (fileAttr.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;isHidden&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;())&lt;br /&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;//Do something&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;fileAttr.Clear();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;fileAttr.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;AddReadOnly&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Have fun.&lt;br /&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-1212284154515199187?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/1212284154515199187/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=1212284154515199187' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/1212284154515199187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/1212284154515199187'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/11/file-attributes-with-c.html' title='File attributes with C#'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-177434320924875359</id><published>2008-11-14T03:44:00.000-08:00</published><updated>2008-11-25T04:53:30.424-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASCIIEncoding'/><category scheme='http://www.blogger.com/atom/ns#' term='Encoding'/><category scheme='http://www.blogger.com/atom/ns#' term='UnicodeEncoding'/><category scheme='http://www.blogger.com/atom/ns#' term='Decoder'/><title type='text'>How to convert string to byte array and viceversa</title><content type='html'>The way to convert a string to byte array are a lot. Here I show you one I use over all, &lt;span style="color: rgb(51, 51, 255);"&gt;UnicodeEncoding&lt;/span&gt;.&lt;br /&gt;Sample:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;char&lt;/span&gt;[] arrUnicodeSample = &lt;span style="color: rgb(51, 51, 255);"&gt;new char&lt;/span&gt;[] { &lt;span style="color: rgb(204, 0, 0);"&gt;'\uAAAA'&lt;/span&gt;,&lt;span style="color: rgb(204, 0, 0);"&gt; '\uBBBB'&lt;/span&gt;,&lt;span style="color: rgb(204, 0, 0);"&gt; '\uCCCC'&lt;/span&gt;,  &lt;span style="color: rgb(204, 0, 0);"&gt;'\uDFFF' &lt;/span&gt;};&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;string &lt;/span&gt;strUnicode = &lt;span style="color: rgb(51, 51, 255);"&gt;new string&lt;/span&gt;(arrUnicodeSample);&lt;br /&gt;&lt;br /&gt;{       &lt;br /&gt;                &lt;span style="color: rgb(0, 204, 204);"&gt;UnicodeEncoding &lt;/span&gt;encUnicode = new &lt;span style="color: rgb(0, 204, 204);"&gt;UnicodeEncoding &lt;/span&gt;();&lt;br /&gt;                &lt;span style="color: rgb(51, 51, 255);"&gt;byte&lt;/span&gt;[] encodedBytes = encUnicode.GetBytes(strUnicode);&lt;br /&gt;                &lt;span style="color: rgb(0, 204, 204);"&gt;String &lt;/span&gt;decodedString = encUnicode.GetString(encodedBytes, 0, encodedBytes.Length);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You can also use:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;Encoding&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;ASCIIEncoding&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;UnicodeEncoding&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;and &lt;span style="color: rgb(51, 51, 255);"&gt;Decoder &lt;/span&gt;to come back.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-177434320924875359?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/177434320924875359/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=177434320924875359' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/177434320924875359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/177434320924875359'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/11/how-to-convert-string-to-byte-array-and.html' title='How to convert string to byte array and viceversa'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-6325338780838520522</id><published>2008-11-13T14:07:00.000-08:00</published><updated>2008-11-13T14:26:14.077-08:00</updated><title type='text'>My new article on Code Project: Mobile TouchPad</title><content type='html'>Finally I've found some free time to write a full article.&lt;br /&gt;The article describe how to write a mobile program and show you how it's simple. In particular &lt;span id="ctl00_ArticleTopHeader_ArticleDescr" class="ArticleTopDescr"&gt;Mobile TouchPad lets you control your PC through your touch pad phones.&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.codeproject.com/KB/mobile/MobileTouchPad.aspx"&gt;MobileTouchPad&lt;/a&gt;[&lt;a href="http://www.codeproject.com/KB/mobile/MobileTouchPad.aspx" target="_blank" title="New Window"&gt;^&lt;/a&gt;]&lt;br /&gt;Have fun.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-6325338780838520522?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/6325338780838520522/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=6325338780838520522' title='4 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/6325338780838520522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/6325338780838520522'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/11/finally-ive-found-some-free-time-to.html' title='My new article on Code Project: Mobile TouchPad'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-8379249844136497818</id><published>2008-11-04T05:00:00.000-08:00</published><updated>2008-11-25T04:51:39.779-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Marshal'/><category scheme='http://www.blogger.com/atom/ns#' term='byte[]'/><title type='text'>How to convert class/struct to a byte array</title><content type='html'>With this class you can easy convert your class/struct to a byte array.&lt;br /&gt;Very useful when using the socket.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;using &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;using &lt;/span&gt;System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;using &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.Text;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;using &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.Runtime.InteropServices;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;class &lt;/span&gt;CommonConvertion&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;      &lt;span style="color: rgb(51, 51, 255);"&gt;  public static byte&lt;/span&gt;[] StructureToByteArray(&lt;span style="color: rgb(51, 51, 255);"&gt;object &lt;/span&gt;obj)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;span style="color: rgb(51, 51, 255);"&gt;int &lt;/span&gt;Length = &lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;.SizeOf(obj);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;span style="color: rgb(51, 51, 255);"&gt;byte&lt;/span&gt;[] bytearray = &lt;span style="color: rgb(51, 51, 255);"&gt;new byte&lt;/span&gt;[Length];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;span style="color: rgb(51, 51, 255);"&gt;IntPtr &lt;/span&gt;ptr = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.AllocHGlobal(Length);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.StructureToPtr(obj, ptr, &lt;span style="color: rgb(51, 51, 255);"&gt;false&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Copy(ptr, bytearray, 0, Length);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.FreeHGlobal(ptr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;span style="color: rgb(51, 51, 255);"&gt;return &lt;/span&gt;bytearray;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        public static void ByteArrayToStructure(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;byte&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[] bytearray, &lt;span style="color: rgb(51, 51, 255);"&gt;ref object &lt;/span&gt;obj)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;span style="color: rgb(51, 51, 255);"&gt;int &lt;/span&gt;Length = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.SizeOf(obj);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;IntPtr &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;ptr = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.AllocHGlobal(Length);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Copy(bytearray, 0, ptr, Length);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            obj = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.PtrToStructure(ptr, obj.GetType());&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Marshal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.FreeHGlobal(ptr);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Have fun.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-8379249844136497818?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/8379249844136497818/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=8379249844136497818' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8379249844136497818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8379249844136497818'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/11/with-this-class-you-can-easy-convert.html' title='How to convert class/struct to a byte array'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-2782761438892792933</id><published>2008-11-04T04:52:00.000-08:00</published><updated>2008-11-25T04:52:43.606-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mouse_event'/><category scheme='http://www.blogger.com/atom/ns#' term='P/Invoke'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='Cursor Position'/><title type='text'>Windows Mouse Control</title><content type='html'>With this class you can easy control the mouse from c#. For the click event it's use the P/Invoke of &lt;span style="color: rgb(204, 0, 0);"&gt;mouse_event &lt;/span&gt;API. To move the cursor positon use directly the managed code.&lt;br /&gt;(Only for x86.)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;using &lt;/span&gt;System;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;using &lt;/span&gt;System.Collections.Generic;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;using &lt;/span&gt;System.Text;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;using &lt;/span&gt;System.Runtime.InteropServices;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;namespace &lt;/span&gt;MouseMov&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public class&lt;/span&gt; MouseHook&lt;br /&gt;{&lt;br /&gt;[&lt;span style="color: rgb(0, 204, 204);"&gt;DllImport&lt;/span&gt;(&lt;span style="color: rgb(204, 0, 0);"&gt;"user32.dll"&lt;/span&gt;)]&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;private static extern void&lt;/span&gt; mouse_event(&lt;span style="color: rgb(102, 204, 204);"&gt;UInt32 &lt;/span&gt;dwFlags, &lt;span style="color: rgb(102, 204, 204);"&gt;UInt32 &lt;/span&gt;dx, &lt;span style="color: rgb(102, 204, 204);"&gt;UInt32 &lt;/span&gt;dy, &lt;span style="color: rgb(102, 204, 204);"&gt;UInt32 &lt;/span&gt; dwData, &lt;span style="color: rgb(0, 204, 204);"&gt;IntPtr &lt;/span&gt;dwExtraInfo);&lt;br /&gt; private const &lt;span style="color: rgb(102, 204, 204);"&gt;UInt32 &lt;/span&gt;MOUSEEVENTF_LEFTDOWN = 0x0002;&lt;br /&gt; private const &lt;span style="color: rgb(102, 204, 204);"&gt;UInt32 &lt;/span&gt;MOUSEEVENTF_LEFTUP = 0x0004;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; internal static void&lt;/span&gt; SendDoubleClick()&lt;br /&gt; {&lt;br /&gt;     SendClick();&lt;br /&gt;     SendClick();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; internal static void&lt;/span&gt; SendClick()&lt;br /&gt; {&lt;br /&gt;     SendDown();&lt;br /&gt;     SendUp();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt; internal static void&lt;/span&gt; SendUp()&lt;br /&gt; {&lt;br /&gt;     mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, &lt;span style="color: rgb(51, 51, 255);"&gt;new &lt;/span&gt;System.&lt;span style="color: rgb(0, 204, 204);"&gt;IntPtr&lt;/span&gt;());&lt;br /&gt; }&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;private void &lt;/span&gt;MoveMouse(Point p)&lt;br /&gt;{&lt;br /&gt;Cursor.Position = new Point(Cursor.Position.X + p.X, Cursor.Position.Y + p.Y);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt; internal static void&lt;/span&gt; SendDown()&lt;br /&gt; {&lt;br /&gt;     mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, &lt;span style="color: rgb(51, 51, 255);"&gt;new &lt;/span&gt;System.&lt;span style="color: rgb(0, 204, 204);"&gt;IntPtr&lt;/span&gt;());&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Have fun.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-2782761438892792933?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/2782761438892792933/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=2782761438892792933' title='4 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/2782761438892792933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/2782761438892792933'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/11/mouse-control.html' title='Windows Mouse Control'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-53914685704994515</id><published>2008-09-30T07:18:00.001-07:00</published><updated>2008-10-01T03:53:12.099-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TextBox IsNumeric'/><category scheme='http://www.blogger.com/atom/ns#' term='Custom control'/><category scheme='http://www.blogger.com/atom/ns#' term='NumericTextBox'/><title type='text'>CSharp NumericTextBox control</title><content type='html'>I've post here a simple custom control that it accepts only numeric input.&lt;br /&gt;The only one methods in the OnKeyPress (overrided) and accept only digit or the backspace&lt;br /&gt;&lt;pre class="libCScode" id="ctl00_rs1_mainContentContainer_ctl03CSharp" space="preserve"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows.Forms;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; DrLuiji.Controls&lt;br /&gt;{&lt;span style="color:blue;"&gt;&lt;br /&gt;public class &lt;span style="color: rgb(51, 153, 153);"&gt;NumericTextBox : TextBox&lt;/span&gt;&lt;br /&gt;{     &lt;br /&gt;  protected&lt;/span&gt; override &lt;span style="color:blue;"&gt;void&lt;/span&gt; OnKeyPress(KeyPressEventArgs e)&lt;br /&gt;  {&lt;br /&gt; &lt;span style="color:blue;"&gt;     base&lt;/span&gt;.OnKeyPress(e); &lt;br /&gt;&lt;span style="color:blue;"&gt;      if&lt;/span&gt; (!((&lt;span style="color: rgb(51, 153, 153);"&gt;Char&lt;/span&gt;.IsDigit(e.KeyChar))||(e.KeyChar.Equals(&lt;span style="color: rgb(255, 0, 0);"&gt;'\b'&lt;/span&gt;))))&lt;br /&gt;      {         &lt;br /&gt;          e.Handled = &lt;span style="color: rgb(51, 51, 255);"&gt;true&lt;/span&gt;;     &lt;br /&gt;          ErrorBeep();&lt;br /&gt;      }&lt;br /&gt; }&lt;br /&gt;&lt;span style="color:blue;"&gt;    public void &lt;/span&gt;ErrorBeep()&lt;br /&gt; {&lt;br /&gt;&lt;span style="color:green;"&gt;           //Console.Beep();&lt;/span&gt;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;To use it you just drag &amp;amp; drop the control from the toolbox to your form.&lt;br /&gt;&lt;br /&gt;Have fun.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-53914685704994515?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/53914685704994515/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=53914685704994515' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/53914685704994515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/53914685704994515'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/09/csharp-numerictextbox.html' title='CSharp NumericTextBox control'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-5046225423896546785</id><published>2008-09-22T06:15:00.000-07:00</published><updated>2008-11-25T04:54:09.137-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SpecialFolder'/><title type='text'>Retrieve system folder c#</title><content type='html'>Here you can find a way to retrieve the system folder.&lt;br /&gt;Very simple, call the System.Environment.GetFolderPath with the corrisponding enum System.Environment.SpecialFolder.See the sample below.&lt;br /&gt;&lt;br /&gt;      private string GetSystemSpecialFolderDirectory()&lt;br /&gt;      {&lt;br /&gt;          //Program files&lt;br /&gt;          string sProgramFilesFolder = System.Environment.GetFolderPath(&lt;br /&gt;              System.Environment.SpecialFolder.ProgramFiles);&lt;br /&gt;&lt;br /&gt;          //Personal&lt;br /&gt;          string sPersonalFolder = System.Environment.GetFolderPath (&lt;br /&gt;              System.Environment.SpecialFolder.Personal);&lt;br /&gt;    &lt;br /&gt;          //Desktop&lt;br /&gt;          string sDesktopFolder = System.Environment.GetFolderPath(&lt;br /&gt;              System.Environment.SpecialFolder.DesktopDirectory);&lt;br /&gt;&lt;br /&gt;          //Application Data&lt;br /&gt;          string sApplicationDataFolder = System.Environment.GetFolderPath(&lt;br /&gt;              System.Environment.SpecialFolder.ApplicationData);&lt;br /&gt;&lt;br /&gt;          //System:&lt;br /&gt;          string sSystemFolder = System.Environment.GetFolderPath(&lt;br /&gt;              System.Environment.SpecialFolder.System);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          MessageBox.Show("Program files: " + sProgramFilesFolder +&lt;br /&gt;              "\r\nPersonal: " + sPersonalFolder +              &lt;br /&gt;              "\r\nDesktop: " + sDesktopFolder +&lt;br /&gt;              "\r\nApplication Data: " + sApplicationDataFolder +&lt;br /&gt;              "\r\nSystem: " + sSystemFolder);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;Very simple isn't it ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-5046225423896546785?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/5046225423896546785/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=5046225423896546785' title='2 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/5046225423896546785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/5046225423896546785'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/09/retrieve-system-folder-c.html' title='Retrieve system folder c#'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-3378241998236308690</id><published>2008-08-29T04:18:00.000-07:00</published><updated>2008-09-23T03:41:13.923-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NSIS and MFC Visual Studio 2005'/><title type='text'>NSIS and MFC dependency</title><content type='html'>Hi all, I've post here a way wich NSIS can support an automatic distribution for the MFC ( in my case v8). You can use the Clickonce part with other installer e.g. Inno Setup.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;The NSIS not support an automatic distribution for the MFC program . This post solve this problem.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Backgroung&lt;/span&gt;&lt;br /&gt;First of all I use Visual Studio 2005 to deploy my MCF application and I use NSIS installer to redistribute it. The SO target are Windows Xp and Vista.&lt;br /&gt;&lt;br /&gt;I solve the problem in a very easy way.&lt;br /&gt;I build a ClickOnce setup on my solution, and i use it in silent mode inside the NSIS.&lt;br /&gt;&lt;br /&gt;Info: I use the ClickOnce to install all the redistributable file &lt;span style="cursor: pointer;" onclick="'dr4sdgryt(event,"&gt;&lt;span class="sg"&gt;&lt;span class="se1"&gt;&lt;span class="trn"&gt;instead &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;vcredist_x86.exe becouse with the vcredist_x86.exe you need other istructions, like register some files.&lt;br /&gt;With my solution after install it the program is ready to use.&lt;br /&gt;&lt;br /&gt;The step needed are 2&lt;br /&gt;1 Create the ClickOnce setup and modify it a bit.&lt;br /&gt;2 Add it to NSIS&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1 ClickOnce&lt;/span&gt;&lt;br /&gt;Create the ClickOnce setup on your solution. Simply I add a new project to my solution I use the &lt;b&gt;Setup Wizard Project&lt;/b&gt; inside &lt;b&gt;Other Project Types&lt;/b&gt;. I follow the steps needed and I only add the primary output to the output group at step 3 (&lt;a href="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMERbb9Sl4I/AAAAAAAAADI/5rtYqKdazVU/s1600-h/1_Wizard_Step3.bmp"&gt;Figure 1&lt;/a&gt;).&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMERbb9Sl4I/AAAAAAAAADI/5rtYqKdazVU/s1600-h/1_Wizard_Step3.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMERbb9Sl4I/AAAAAAAAADI/5rtYqKdazVU/s200/1_Wizard_Step3.bmp" alt="" id="BLOGGER_PHOTO_ID_5242490604294936450" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Figure 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;I've left all the other page as default.   At the end the result solution is like this (&lt;a href="http://4.bp.blogspot.com/_ijoL-hTDT9o/SMERqatLfZI/AAAAAAAAADQ/fFqtp4E6_3g/s1600-h/2_ClickOnce_Start.png"&gt;Figure 2&lt;/a&gt;).&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ijoL-hTDT9o/SMERqatLfZI/AAAAAAAAADQ/fFqtp4E6_3g/s1600-h/2_ClickOnce_Start.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_ijoL-hTDT9o/SMERqatLfZI/AAAAAAAAADQ/fFqtp4E6_3g/s200/2_ClickOnce_Start.png" alt="" id="BLOGGER_PHOTO_ID_5242490861656964498" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Figure 2&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;Now I don't need to distribute the the primary output, and I exclude it (&lt;a href="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMESNe1-B1I/AAAAAAAAADY/RShSyvJIuw4/s1600-h/3_ExcludePrimaryOutput.bmp"&gt;Figure 3&lt;/a&gt;), Unfortunatly this not avoid the creation of installation dir.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMESNe1-B1I/AAAAAAAAADY/RShSyvJIuw4/s1600-h/3_ExcludePrimaryOutput.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMESNe1-B1I/AAAAAAAAADY/RShSyvJIuw4/s200/3_ExcludePrimaryOutput.bmp" alt="" id="BLOGGER_PHOTO_ID_5242491464062994258" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Figure 3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;I don't install anything else, and I don' need the &lt;img src="file:///C:/Users/LUIGIB%7E1/AppData/Local/Temp/moz-screenshot-1.jpg" alt="" /&gt;default location for the app. I haven't find a way to delete this key but a way to change it to an existing one, i choose the root, so to do that i change in the File sistem editor the property of the application folder to c:\ (&lt;a href="http://1.bp.blogspot.com/_ijoL-hTDT9o/SMETfvkXzAI/AAAAAAAAADg/z6mbjXUy2k4/s1600-h/4_ChangeDefaultLocation.bmp"&gt;Figure 4&lt;/a&gt;) you can change it with %TEMP% or %APPDATA% or what you want.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ijoL-hTDT9o/SMETfvkXzAI/AAAAAAAAADg/z6mbjXUy2k4/s1600-h/4_ChangeDefaultLocation.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_ijoL-hTDT9o/SMETfvkXzAI/AAAAAAAAADg/z6mbjXUy2k4/s200/4_ChangeDefaultLocation.bmp" alt="" id="BLOGGER_PHOTO_ID_5242492877301861378" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Figure 4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;The last step is to delete all the page inside the wizard. Go to the UI editor (&lt;a href="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMEUS9s04bI/AAAAAAAAADo/0vhq_GdviIg/s1600-h/5_DefaultUI.png"&gt;Figure 5&lt;/a&gt;)&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMEUS9s04bI/AAAAAAAAADo/0vhq_GdviIg/s1600-h/5_DefaultUI.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMEUS9s04bI/AAAAAAAAADo/0vhq_GdviIg/s200/5_DefaultUI.png" alt="" id="BLOGGER_PHOTO_ID_5242493757268746674" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Figure 5&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;and delete all the page (&lt;a href="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMEUVyI07AI/AAAAAAAAADw/Ib3gHC8LVww/s1600-h/6_UI_Without_page.png"&gt;Figure 6&lt;/a&gt;) .&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMEUVyI07AI/AAAAAAAAADw/Ib3gHC8LVww/s1600-h/6_UI_Without_page.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_ijoL-hTDT9o/SMEUVyI07AI/AAAAAAAAADw/Ib3gHC8LVww/s200/6_UI_Without_page.png" alt="" id="BLOGGER_PHOTO_ID_5242493805704571906" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Figure 6&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;2 NSIS&lt;/span&gt;&lt;br /&gt;Silent mode:&lt;br /&gt;Now you have the installation ready but &lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;the progress bar before the start of the installation still appears. T&lt;/span&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;o hide that dialog I use the msiexec comman.     &lt;/span&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;For the Installation command :'msiexec /quiet  /i MicrosoftMFC8Runtime.msi'.For the &lt;/span&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;unistall &lt;/span&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;command 'msiexec /quiet  /x MicrosoftMFC8Runtime.msi'&lt;/span&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;&lt;br /&gt;Adding the command line to NSIS&lt;/span&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The process is very simple. I need to copy the file &lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;MicrosoftMFC8Runtime.msi &lt;/span&gt;&lt;/span&gt;and execute it waiting the installer til the installer finish, after i Delete it.&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;pre class="nsis"&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Section&lt;/span&gt; MFCRUNTIME&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;SetOutPath&lt;/span&gt; "&lt;span style="color: rgb(102, 0, 0);"&gt;$INSTDIR&lt;/span&gt;"&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;File&lt;/span&gt; &lt;span style="color: rgb(102, 0, 102);"&gt;"MicrosoftMFC8Runtime.msi"&lt;/span&gt; "Step 1 Install Microsoft MFC8 Runtime"&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;ExecWait&lt;/span&gt; &lt;span style="color: rgb(102, 0, 102);"&gt;"msiexec /quiet /i&lt;/span&gt;&lt;span style="color: rgb(102, 0, 102);"&gt; MicrosoftMFC8Runtime.msi&lt;/span&gt;&lt;span style="color: rgb(102, 0, 102);"&gt;" &lt;/span&gt;&lt;br /&gt;"Step 2 Install Microsoft MFC 8 Runtime"&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;delete &lt;/span&gt;&lt;span style="color: rgb(102, 0, 102);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(102, 0, 102);"&gt;MicrosoftMFC8Runtime.msi&lt;/span&gt;&lt;span style="color: rgb(102, 0, 102);"&gt;"&lt;/span&gt; #Step 3 Install Microsoft MFC 8 Runtime"&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;SectionEnd&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;For the uninstall section you only need to uninstall the &lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;MicrosoftMFC8Runtime like you can do in the Add/Remove program. You can do this &lt;/span&gt;&lt;/span&gt; with the right GUID of &lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;MicrosoftMFC8Runtime.&lt;br /&gt;The Guid is the &lt;/span&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;'ProductCode'  &lt;/span&gt;&lt;/span&gt;&lt;span id="_ctl0_MainContent_PostFlatView"&gt;&lt;span&gt;In your ClickOnceSetup, is a &lt;/span&gt;&lt;/span&gt;property value.&lt;br /&gt;&lt;br /&gt;In my case I need only this line for unistall it&lt;br /&gt;&lt;pre class="nsis"&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Section&lt;/span&gt; unMFCRUNTIME&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;ExecWait&lt;/span&gt; &lt;span style="color: rgb(102, 0, 102);"&gt;"msiexec /quiet /i&lt;/span&gt;{843A5D8A-2FD3-4E51-AFBA-A1551D8F41B9}&lt;span style="color: rgb(102, 0, 102);"&gt;"&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;SectionEnd&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Well now compile your NSIS file and try it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;I've try it under few Windows Vista and a lot of Windows Xp without problem.&lt;br /&gt;Have fun.&lt;br /&gt;Let me know if you have any problems regarding this short tutorial.&lt;br /&gt;Kind regards.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-3378241998236308690?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/3378241998236308690/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=3378241998236308690' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/3378241998236308690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/3378241998236308690'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/08/nsis-and-mfc-dependency.html' title='NSIS and MFC dependency'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ijoL-hTDT9o/SMERbb9Sl4I/AAAAAAAAADI/5rtYqKdazVU/s72-c/1_Wizard_Step3.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-7281343130909882219</id><published>2008-08-07T01:52:00.000-07:00</published><updated>2008-12-13T14:34:56.178-08:00</updated><title type='text'>Convert string to Hex</title><content type='html'>A chunk of code how to convert string (unicode or not) to long Hexadecimal (base-16)&lt;br /&gt;&lt;br /&gt;CString sUnicode = _T("A123F");&lt;br /&gt;&lt;br /&gt;CStringA sASCII(sUnicode);&lt;br /&gt;&lt;span style="color: rgb(0, 38, 255);"&gt;char&lt;/span&gt; * pNotConverted=NULL;&lt;br /&gt;&lt;span style="color: rgb(0, 38, 255);"&gt;long&lt;/span&gt; lHex = &lt;span style="font-weight: bold;"&gt;strtol &lt;/span&gt;(sASCII.&lt;span style="color: rgb(0, 38, 255);"&gt;operator &lt;/span&gt;LPCSTR(),&amp;amp;pNotConverted,16);&lt;br /&gt;if(strlen(pNotConverted)&gt;0)&lt;br /&gt;&lt;span style="color: rgb(0, 38, 255);"&gt;return false&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;For unicode directly without conversion use &lt;b&gt;wcstol&lt;/b&gt; the wide-character version&lt;/li&gt;&lt;li&gt;For better range (__int64) use &lt;span style="font-weight: bold;"&gt;_strtoi64&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;_wcstoi64&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Remarks    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;Remember the long limits&lt;br /&gt;&lt;/span&gt;&lt;table style="width: 435px; height: 224px;" cellpadding="5" cellspacing="2"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt; &lt;p&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Type Name &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="text-align: center;"&gt; &lt;p&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Bytes &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;  &lt;td style="text-align: center;"&gt; &lt;p&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Range of Values&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top; text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;long&lt;/span&gt;&lt;/td&gt;&lt;td style="vertical-align: top; text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;4&lt;/span&gt;&lt;/td&gt;&lt;td style="vertical-align: top; text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;–2,147,483,648 to 2,147,483,647&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top; text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;__int64&lt;/span&gt;&lt;/td&gt;&lt;td style="vertical-align: top; text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;8&lt;/span&gt;&lt;/td&gt;&lt;td style="vertical-align: top; text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;–9,223,372,036,854,775,808 to 9,223,372,036,854,775,807&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;table width="100%" cellpadding="5" cellspacing="2"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-7281343130909882219?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/7281343130909882219/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=7281343130909882219' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/7281343130909882219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/7281343130909882219'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/08/convert-string-to-hex.html' title='Convert string to Hex'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-8339851090323043494</id><published>2008-08-02T14:06:00.000-07:00</published><updated>2008-08-03T13:23:43.548-07:00</updated><title type='text'>Creating Vista Gadgets</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ijoL-hTDT9o/SJYTt4KcdBI/AAAAAAAAAC4/zfRslRXdAes/s1600-h/Creating+Vista+Gadgets.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_ijoL-hTDT9o/SJYTt4KcdBI/AAAAAAAAAC4/zfRslRXdAes/s200/Creating+Vista+Gadgets.jpg" alt="" id="BLOGGER_PHOTO_ID_5230389696128644114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is my first book review on amazon, take a look &lt;a href="http://www.amazon.com/gp/cdp/member-reviews/AALDFTB74V6PG/ref=cm_pdp_profile_edit_reviews?ie=UTF8&amp;amp;sort_by=MostRecentReview"&gt;here&lt;/a&gt;[&lt;a href="http://www.amazon.com/gp/cdp/member-reviews/AALDFTB74V6PG/ref=cm_pdp_profile_edit_reviews?ie=UTF8&amp;amp;sort_by=MostRecentReview" target="_blank" title="New Window"&gt;^&lt;/a&gt;].&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-8339851090323043494?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/8339851090323043494/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=8339851090323043494' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8339851090323043494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8339851090323043494'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/08/creating-vista-gadgets.html' title='Creating Vista Gadgets'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ijoL-hTDT9o/SJYTt4KcdBI/AAAAAAAAAC4/zfRslRXdAes/s72-c/Creating+Vista+Gadgets.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-8545662149258454909</id><published>2008-08-02T14:02:00.000-07:00</published><updated>2008-08-04T05:10:03.464-07:00</updated><title type='text'>New blog style</title><content type='html'>Before it begins, my presonally arrange (a little bit) to this blog.&lt;br /&gt;Hope you like it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-8545662149258454909?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/8545662149258454909/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=8545662149258454909' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8545662149258454909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/8545662149258454909'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/08/new-blog-style.html' title='New blog style'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4780780974962088167.post-6858550748312390727</id><published>2008-07-31T12:25:00.000-07:00</published><updated>2008-07-31T12:29:55.888-07:00</updated><title type='text'>Hello The Code Is Art!</title><content type='html'>A blog about c and c# coding and some tips and triks found during the programming.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4780780974962088167-6858550748312390727?l=thecodeisart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thecodeisart.blogspot.com/feeds/6858550748312390727/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4780780974962088167&amp;postID=6858550748312390727' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/6858550748312390727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4780780974962088167/posts/default/6858550748312390727'/><link rel='alternate' type='text/html' href='http://thecodeisart.blogspot.com/2008/07/code-is-art.html' title='Hello The Code Is Art!'/><author><name>Dr.Luiji</name><uri>http://www.blogger.com/profile/07217681943866988577</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp3.blogger.com/_ijoL-hTDT9o/SJIqVLyHnmI/AAAAAAAAAA4/AAGdu_hqjRw/S220/OldLogo.png'/></author><thr:total>0</thr:total></entry></feed>
