In the IDE's Tool Properties dialog (Tools -> Configure Tools -> Add or Edit), it should be possible to drop a file from Explorer onto the Program, Working Dir and Parameters fields to enter its name there.
What was tried already
The Tool Properties enhancer (Source/IDE/GX_IdeToolPropertiesEnhancer.pas, TToolPropertiesEnhancer.EnhanceForm) already registers the three edits (edProgram, edWorkingDir, edParameters) with TWinControl_ActivateDropFiles, i.e. DragAcceptFiles and WM_DROPFILES, and HandleFilesDropped puts the file into the edit, for the Program field also its folder into Working Dir. According to the comment in EnhanceForm, this only works in Delphi 6 and 7: the newer IDEs apparently do something that keeps the edits from getting WM_DROPFILES, and registering the handler again on every change of the active control did not help. Dropping a file anywhere on the dialog opens that file in the code editor instead.
Probable cause (not verified)
That the file is opened in the editor suggests that the IDE has registered an OLE drop target (RegisterDragDrop) for the dialog or a window it is in. In an OLE drag, Windows looks for the nearest window up the parent chain that has a registered drop target, and only falls back to WM_DROPFILES for a window with WS_EX_ACCEPTFILES if there is none, so the edits' WM_DROPFILES handler is never reached.
Possible solution
Register an OLE drop target on each of the three edits themselves, as the Expert Manager and Open File already do with TDropFileTarget (ExternalSource/DropTarget.pas). Being further down the parent chain, the edit's target should be found before the IDE's. The existing HandleFilesDropped logic can stay. The target has to be revoked again before the dialog's window handles are destroyed.
To check first: which windows of the dialog have an OLE drop target registered (window property OleDropTargetInterface, see GxInspect ticket #23), and in which Delphi versions the problem occurs. Once GxInspect has a DROPFILES command (GxInspect ticket #23), the fix can be tested in a test IDE.
Cause, measured with real drags on the Tool Properties dialog and with GxInspect's new
DROPFILEScommand:Windows first looks for an OLE drop target (
RegisterDragDrop), starting at the window under the cursor and going up through its parents and, for a dialog, its owners. Only if there is none, or it refuses the drop, does the nearest window that calledDragAcceptFilesgetWM_DROPFILES.WM_DROPFILEShandler on the edits is never reached.WM_DROPFILESand the existing code works. A real drag on the Program field worked.So the fix for the versions where it fails is to register OLE drop targets (
TDropFileTarget) on the three edits themselves, so Windows finds them before it reaches the IDE main window. That can be tested withDROPFILES, which hands the files to the same window a real drag would.