{"id":173,"date":"2009-03-15T21:48:33","date_gmt":"2009-03-15T20:48:33","guid":{"rendered":"http:\/\/katastrophos.net\/andre\/blog\/?p=173"},"modified":"2009-11-16T01:54:41","modified_gmt":"2009-11-16T00:54:41","slug":"implementing-the-reveal-in-explorer-functionality","status":"publish","type":"post","link":"https:\/\/katastrophos.net\/andre\/blog\/2009\/03\/15\/implementing-the-reveal-in-explorer-functionality\/","title":{"rendered":"Implementing the &#8220;Reveal In Explorer&#8221; functionality"},"content":{"rendered":"<p><strong>Update: I seems like Microsoft changed the behavior of the Explorer&#8217;s command line parameters in Vista and Windows 7. Below is the fixed version of my code that addresses the problem.<\/strong><\/p>\n<p>So, I was wondering the other day how to implement a functionality similar to Firefox&#8217;s &#8220;Open Containing Folder&#8221; or OS X&#8217;s &#8220;Reveal In Finder&#8221;.<br \/>\nIt turned out to be extremely simple. Here is the Pascal\/Delphi-Code:<\/p>\n<pre name=\"code\" class=\"delphi:nocontrols\">\r\nuses\r\n  ShellAPI;\r\n\r\nfunction RevealInExplorer(const Filename: string; ShowExplorerWithFoldersBar: Boolean = True): Boolean;\r\nvar\r\n  Params: string;\r\nbegin\r\n  if FileExists(Filename) or DirectoryExists(Filename) then\r\n  begin\r\n    Params := Format('\/select,\"%s\"', [Filename]);\r\n\r\n    if ShowExplorerWithFoldersBar then\r\n      Params := '\/e,' + Params;\r\n\r\n    ShellExecute(0, 'open', 'explorer.exe', PChar(Params), nil, SW_SHOWNORMAL);\r\n\r\n    Result := True;\r\n  end\r\n  else\r\n    Result := False;\r\nend;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Update: I seems like Microsoft changed the behavior of the Explorer&#8217;s command line parameters in Vista and Windows 7. Below is the fixed version of my code that addresses the problem. So, I was wondering the other day how to implement a functionality similar to Firefox&#8217;s &#8220;Open Containing Folder&#8221; or OS X&#8217;s &#8220;Reveal In Finder&#8221;. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2,20,9],"class_list":["post-173","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-delphi","tag-development","tag-windows"],"_links":{"self":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts\/173"}],"collection":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/comments?post=173"}],"version-history":[{"count":8,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts\/173\/revisions"}],"predecessor-version":[{"id":270,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts\/173\/revisions\/270"}],"wp:attachment":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/categories?post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/tags?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}