Alex Rivera | Logout

How to open windows explorer when I click a button?

Asked 2009-08-11T16:25:43.127
11

I have a form in a Delphi project. There is a button on the form. When the user clicks the button, I want it to open Windows Explorer.

What code will I need to achieve this?

Edit
Report

1 Answer

3

According to http://msdn.microsoft.com/en-us/library/bb762153%28VS.85%29.aspx, ShellExecute also supports the 'explore' verb, which 'explores' a folder specified by lpFile, so this should work:

ShellExecute(Application.Handle, 'explore', '.', nil, nil, SW_NORMAL);
answered 2009-08-14T14:49:41.220

Your Answer