Jump to content
FPiette

Feature request: "Show in Explorer"

Recommended Posts

Hello,

 

An interesting feature (IMO): add a popup menu item to the source indexer to show a file in a Windows Explorer window (Much like you have in Delphi project manager).

 

 

Regards,

 

Edited by FPiette
  • Like 5

Share this post


Link to post
3 hours ago, Ondrej Kelle said:

FWIW, as a workaround I use external tool setting (to launch explorer to show the current editor file).

 

The "Console in ..." entries don't work for me. I had to add a /d to the cd command:

e.g. Parameters: /k cd /d $PATH($EDNAME)

because my sources are on a different drive.

  • Thanks 1

Share this post


Link to post

Hmm..

 

I use SHOpenFolderAndSelectItems with ILCreateFromPath to open Explorer and select a file in a new Explorer window:

 

unit USelectFileE;

interface

function OpenFolderAndSelectFile(const FileName: string): boolean;

implementation

uses
  Windows, ShellAPI, ShlObj;

const
  OFASI_EDIT = $0001;
  OFASI_OPENDESKTOP = $0002;

{$IFDEF UNICODE}
function ILCreateFromPath(pszPath: PChar): PItemIDList stdcall; external shell32
  name 'ILCreateFromPathW';
{$ELSE}
function ILCreateFromPath(pszPath: PChar): PItemIDList stdcall; external shell32
  name 'ILCreateFromPathA';
{$ENDIF}
procedure ILFree(pidl: PItemIDList) stdcall; external shell32;
function SHOpenFolderAndSelectItems(pidlFolder: PItemIDList; cidl: Cardinal;
  apidl: pointer; dwFlags: DWORD): HRESULT; stdcall; external shell32;

function OpenFolderAndSelectFile(const FileName: string): boolean;
var
  IIDL: PItemIDList;
begin
  result := false;
  IIDL := ILCreateFromPath(PChar(FileName));
  if IIDL <> nil then
    try
      result := SHOpenFolderAndSelectItems(IIDL, 0, nil, 0) = S_OK;
    finally
      ILFree(IIDL);
    end;
end;

end.

 

Share this post


Link to post
3 hours ago, dummzeuch said:

The "Console in ..." entries don't work for me. I had to add a /d to the cd command:

e.g. Parameters: /k cd /d $PATH($EDNAME)

because my sources are on a different drive.

Sure. Also, enclose the path in quotes if it contains spaces.

Share this post


Link to post

You may simple enable Add "Open in Explorer" in Editor's Popupmenu option in CnPack "Editor Enhancements" Wizard

2019-01-09_06h32_08.png

2019-01-09_06h32_14.png

2019-01-09_06h32_21.png

2019-01-09_06h24_03.png

2019-01-09_06h24_09.png

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×