界面库
gtk实现文件拖拽打开
This commit is contained in:
@@ -2777,27 +2777,9 @@ type TEditer=class(TCustomcontrol) //
|
||||
inherited;
|
||||
P.ExStyle := P.ExStyle .| WS_EX_ACCEPTFILES;
|
||||
end
|
||||
{$ifdef linux}
|
||||
function DragQueryFileA();
|
||||
{$else}
|
||||
function DragQueryFileA(hDrop:pointer;iFile:integer;lpszFile:string;cch:integer):integer;stdcall;external "Shell32.dll" name "DragQueryFileA";
|
||||
{$endif}
|
||||
function WMDROPFILES(o,e):WM_DROPFILES;
|
||||
begin
|
||||
dn := "";
|
||||
opends := array();
|
||||
for i := 1 to DragQueryFileA(e.wparam,0xFFFFFFFF,"",0) do
|
||||
begin
|
||||
len := DragQueryFileA(e.wparam,i-1,nil,0);
|
||||
if len>0 then
|
||||
begin
|
||||
setlength(dn,len+10);
|
||||
if DragQueryFileA(e.wparam,i-1,dn,len+1)>0 then
|
||||
begin
|
||||
opends[length(opends)]:= dn[1:len];
|
||||
end
|
||||
end
|
||||
end
|
||||
opends := _wapi.get_drage_file_names(e.wparam);
|
||||
for i,v in opends do
|
||||
begin
|
||||
arr := FileList("",v);
|
||||
|
||||
Reference in New Issue
Block a user