界面库

gtk实现文件拖拽打开
This commit is contained in:
JianjunLiu
2023-09-26 17:41:20 +08:00
parent 209b5d93d6
commit 2180824362
3 changed files with 199 additions and 23 deletions
+1 -19
View File
@@ -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);