{"id":788,"date":"2012-01-05T18:55:11","date_gmt":"2012-01-05T17:55:11","guid":{"rendered":"http:\/\/www.nuonsoft.com\/blog\/?p=788"},"modified":"2012-01-05T18:55:11","modified_gmt":"2012-01-05T17:55:11","slug":"how-to-programmatically-toggle-the-visibilty-of-the-desktop-icons","status":"publish","type":"post","link":"https:\/\/www.nuonsoft.com\/blog\/2012\/01\/05\/how-to-programmatically-toggle-the-visibilty-of-the-desktop-icons\/","title":{"rendered":"How to programmatically toggle the visibilty of the desktop icons"},"content":{"rendered":"<p>The following code will toggle the visibility of the desktop icons, and will update the checkmark in the menu when you right click the desktop.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">HWND GetDesktopHWND()\r\n{\r\n  HWND hProgman = FindWindow(_T(&quot;Progman&quot;), 0);\r\n  if (hProgman)\r\n    return FindWindowEx(hProgman, 0, _T(&quot;SHELLDLL_DefView&quot;), 0);\r\n\r\n  return NULL;\r\n}\r\n\r\nvoid ToggleDesktopIcons()\r\n{\r\n  HWND hWndDesktop = GetDesktopHWND();\r\n  if (hWndDesktop)\r\n    SendMessage(hWndDesktop, WM_COMMAND, 0x7402, 0); \r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The following code will toggle the visibility of the desktop icons, and will update the checkmark in the menu when you right click the desktop. HWND GetDesktopHWND() { HWND hProgman = FindWindow(_T(&quot;Progman&quot;), 0); if (hProgman) return FindWindowEx(hProgman, 0, _T(&quot;SHELLDLL_DefView&quot;), 0); return NULL; } void ToggleDesktopIcons() { HWND hWndDesktop = GetDesktopHWND(); if (hWndDesktop) SendMessage(hWndDesktop, WM_COMMAND, 0x7402, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,17],"tags":[137],"class_list":["post-788","post","type-post","status-publish","format-standard","hentry","category-c","category-software-development","tag-desktop-icons"],"_links":{"self":[{"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/posts\/788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=788"}],"version-history":[{"count":5,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/posts\/788\/revisions"}],"predecessor-version":[{"id":794,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/posts\/788\/revisions\/794"}],"wp:attachment":[{"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}