var
  sFolder:string;

procedure OpenFolder;
begin
  ShellExecute(0,'open',sFolder,'','',1);
end;

//--- Widget初始化事件，当打开Widget时会触发此事件 ---
procedure OnWidgetInit;
begin
  sFolder:=GetSetting('Folder','');
  imgFolder.hint:='打开文件夹" ' +sFolder+ ' "';
  if sFolder='' then
    ShowWidgetSetting;
end;

//--- 文件拖放到事件，当文件拖放到Widget中时会触发此事件 ---
procedure OnWidgetDropFiles(Files:string);
var
  lst:TStrings;
begin
  if trim(Files)='' then exit;
  lst:=TStringList.create;
  try
    lst.text:=Files;
    if lst.count>0 then
    begin
      for i:=0 to lst.count-1 do
        FileMove(lst.strings[i],sFolder,false);
    end;
  finally
    lst.free;
  end;
end;

