{"id":1910,"date":"2014-03-26T20:33:34","date_gmt":"2014-03-26T18:33:34","guid":{"rendered":"http:\/\/www.hjgode.de\/wp\/?p=1910"},"modified":"2014-03-26T20:33:34","modified_gmt":"2014-03-26T18:33:34","slug":"mobiledevelopment-using-shfullscreen-api-to-show-hide-start-icon","status":"publish","type":"post","link":"https:\/\/www.hjgode.de\/wp\/2014\/03\/26\/mobiledevelopment-using-shfullscreen-api-to-show-hide-start-icon\/","title":{"rendered":"MobileDevelopment: Using shFullScreen API to show hide Start icon"},"content":{"rendered":"<p>Uuups, sometimes we are looking for a way to do simple things and do not remeber how easy it was.<\/p>\n<p>Question: How can one hide\/show the start icon in taskbar of Windows Mobile 6.1 (and before)?<\/p>\n<p>Answer: Use the API provided by Microsoft for this: SHFullScreen! No need to use FindWindow and subclass, very simple use.<\/p>\n<p>Ah, remeber that this will NOT work on Windows Enbedded Handheld 6.5.3 or Windows Mobile 6.5.3 or whatever you call it. The API will simply not do it&#8217;s work.<\/p>\n<p>Here is a C# example for SHFullScreen usage.<\/p>\n<p><!--more-->create a class file (ie SHFullScreen.cs) and insert the following:<\/p>\n<pre>using System;\r\nusing System.Drawing;\r\nusing System.Collections;\r\nusing System.Windows.Forms;\r\nusing System.Data;\r\nusing System.Runtime.InteropServices;\r\n\r\nnamespace KioskTest\r\n{\r\n\u00a0\u00a0\u00a0 public class SHAPI\r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public const int SHFS_SHOWTASKBAR = 1;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public const int SHFS_HIDETASKBAR = 2;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public const int SHFS_SHOWSIPBUTTON = 4;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public const int SHFS_HIDESIPBUTTON = 8;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public const int SHFS_SHOWSTARTICON = 16;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public const int SHFS_HIDESTARTICON = 32;\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [DllImport(\"aygshell.dll\")]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 private extern static bool SHFullScreen(IntPtr hWnd, int dwState);\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public static bool showStart(IntPtr wHandle, bool bShowHide)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bool bRet = false;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IntPtr hwnd = wHandle;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (!bShowHide)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bRet = SHFullScreen(hwnd, SHFS_HIDESTARTICON);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 else\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bRet = SHFullScreen(hwnd, SHFS_SHOWSTARTICON);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return bRet;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public static bool FullScreen(IntPtr hWnd)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return SHFullScreen(hWnd, SHFS_HIDESTARTICON | SHFS_HIDETASKBAR);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n    }\r\n}<\/pre>\n<p>Now in your form code just use the following call to hide the Start Icon:<\/p>\n<pre>    KioskTest.SHAPI.showStart(this.Handle, false);<\/pre>\n<p>That is all, see here:<\/p>\n<p><a href=\"http:\/\/www.hjgode.de\/wp\/wp-content\/uploads\/2014\/03\/with_starticon.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1911\" alt=\"with_starticon\" src=\"http:\/\/www.hjgode.de\/wp\/wp-content\/uploads\/2014\/03\/with_starticon-225x300.gif\" width=\"225\" height=\"300\" srcset=\"https:\/\/www.hjgode.de\/wp\/wp-content\/uploads\/2014\/03\/with_starticon-225x300.gif 225w, https:\/\/www.hjgode.de\/wp\/wp-content\/uploads\/2014\/03\/with_starticon-112x150.gif 112w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a>\u00a0\u00a0 <a href=\"http:\/\/www.hjgode.de\/wp\/wp-content\/uploads\/2014\/03\/without_starticon.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1912\" alt=\"without_starticon\" src=\"http:\/\/www.hjgode.de\/wp\/wp-content\/uploads\/2014\/03\/without_starticon-225x300.gif\" width=\"225\" height=\"300\" srcset=\"https:\/\/www.hjgode.de\/wp\/wp-content\/uploads\/2014\/03\/without_starticon-225x300.gif 225w, https:\/\/www.hjgode.de\/wp\/wp-content\/uploads\/2014\/03\/without_starticon-112x150.gif 112w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>No full project source code for this easy one.<\/p>\n<p>Have fun!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Uuups, sometimes we are looking for a way to do simple things and do not remeber how easy it was. Question: How can one hide\/show the start icon in taskbar of Windows Mobile 6.1 (and before)? Answer: Use the API provided by Microsoft for this: SHFullScreen! No need to use FindWindow and subclass, very simple [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[178,6,3,194],"tags":[169,283,236,534,503,504,233],"class_list":["post-1910","post","type-post","status-publish","format-standard","hentry","category-codeproject","category-kiosk-mode","category-programming","category-tips","tag-compact-framework","tag-dotnet","tag-fullscreen","tag-kiosk-mode","tag-start-icon","tag-start-symbol","tag-taskbar"],"_links":{"self":[{"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/posts\/1910"}],"collection":[{"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/comments?post=1910"}],"version-history":[{"count":2,"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/posts\/1910\/revisions"}],"predecessor-version":[{"id":1914,"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/posts\/1910\/revisions\/1914"}],"wp:attachment":[{"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/media?parent=1910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/categories?post=1910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hjgode.de\/wp\/wp-json\/wp\/v2\/tags?post=1910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}