BSOne.SFC/Tocsg.Module/SunkAssister/EXE_SunkAssister/Shotcut/FShotcutForder.pas

72 lines
1.4 KiB
Plaintext

unit FShotcutForder;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Buttons,
Vcl.Menus, VirtualTrees;
const
WM_FIRST_TASK = WM_USER + 1001;
type
TFrmShotcutForder = class(TFrame)
vtList: TVirtualStringTree;
btnAdd: TSpeedButton;
popFolder: TPopupMenu;
btnModify: TSpeedButton;
btnDelete: TSpeedButton;
miAdd: TMenuItem;
miModify: TMenuItem;
miDelete: TMenuItem;
private
{ Private declarations }
public
{ Public declarations }
Constructor Create(aOwner: TComponent); override;
Destructor Destroy; override;
procedure process_WM_DROPFILES(var msg: TMessage); Message WM_DROPFILES;
end;
implementation
uses
Winapi.ShellAPI;
{$R *.dfm}
const
MAX_PATH = 512;
Constructor TFrmShotcutForder.Create(aOwner: TComponent);
begin
Inherited Create(aOwner);
end;
Destructor TFrmShotcutForder.Destroy;
begin
Inherited;
end;
procedure TFrmShotcutForder.process_WM_DROPFILES(var msg: TMessage);
var
h: THandle;
i, nCnt: integer;
sPath: array[0..MAX_PATH] of Char;
begin
h := msg.wParam;
try
nCnt := DragQueryFile(h, $FFFFFFFF, sPath, MAX_PATH);
for i:= 0 to nCnt - 1 do
begin
DragQueryFile(h, i, sPath, MAX_PATH);
ShowMessage(sPath);
end;
finally
DragFinish(h);
end;
end;
end.