Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.048 Beiträge
 
Delphi 12 Athens
 
#16

AW: SHFileOperation abbrechen per Code

  Alt 16. Jan 2024, 10:01
Jupp, ich hab z.B. auf dem NAS ein Verzeichnis mit Fremdprojekten, u.A. welche von Microsoft (Downlaods oder z.B. aus GitHub)
Dann eben die beiden CatalogRepository-Verzeichnisse vom Delphi, dessen Quellcode-Verzeichnisse, meine Quellcodeverzeichnisse usw.

Wie gesagt, schon kann man im Delphi, oder mit einem externen Tool, schön darin suchen
Dann kann man auch den Suchbegriff im Internet wuchen (eventuell noch zwei " drumrum und womöglich noch Delphi davor schreiben)

und findet z.B.
C:\Program Files (x86)\Embarcadero\Studio\23.0\source\rtl\win\Winapi.ShlObj.pas (witzig, wie ein etwas aktuelleres Delphi hilfreich sein kann)
oder
C:\Users\%username%\Documents\Embarcadero\Studio\23.0\CatalogRepository\WindowsAPIfromWinMD-1.0\Windows.UI.Shell.pas
Delphi-Quellcode:
  ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nn-shobjidl_core-ifileoperation</summary>
  ///<remarks>
  ///<para>Supported since: <i>windows6.0.6000</i></para>
  ///</remarks>
  IFileOperation = interface(IUnknown)
  ['{947AAB5F-0A5C-4C13-B4D6-4BF7836FC9F8}']
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-advise</summary>
    function Advise(pfops: IFileOperationProgressSink; out pdwCookie: Cardinal): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-unadvise</summary>
    function Unadvise(dwCookie: Cardinal): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-setoperationflags</summary>
    function SetOperationFlags(dwOperationFlags: Cardinal): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-setprogressmessage</summary>
    function SetProgressMessage(pszMessage: PWSTR): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-setprogressdialog</summary>
    function SetProgressDialog(popd: IOperationsProgressDialog): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-setproperties</summary>
    function SetProperties(pproparray: IPropertyChangeArray): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-setownerwindow</summary>
    function SetOwnerWindow(hwndOwner: HWND): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-applypropertiestoitem</summary>
    function ApplyPropertiesToItem(psiItem: IShellItem): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-applypropertiestoitems</summary>
    function ApplyPropertiesToItems(punkItems: IUnknown): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-renameitem</summary>
    function RenameItem(psiItem: IShellItem; pszNewName: PWSTR; pfopsItem: IFileOperationProgressSink): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-renameitems</summary>
    function RenameItems(pUnkItems: IUnknown; pszNewName: PWSTR): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-moveitem</summary>
    function MoveItem(psiItem: IShellItem; psiDestinationFolder: IShellItem; pszNewName: PWSTR; pfopsItem: IFileOperationProgressSink): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-moveitems</summary>
    function MoveItems(punkItems: IUnknown; psiDestinationFolder: IShellItem): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-copyitem</summary>
    function CopyItem(psiItem: IShellItem; psiDestinationFolder: IShellItem; pszCopyName: PWSTR; pfopsItem: IFileOperationProgressSink): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-copyitems</summary>
    function CopyItems(punkItems: IUnknown; psiDestinationFolder: IShellItem): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-deleteitem</summary>
    function DeleteItem(psiItem: IShellItem; pfopsItem: IFileOperationProgressSink): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-deleteitems</summary>
    function DeleteItems(punkItems: IUnknown): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-newitem</summary>
    function NewItem(psiDestinationFolder: IShellItem; dwFileAttributes: Cardinal; pszName: PWSTR; pszTemplateName: PWSTR; pfopsItem: IFileOperationProgressSink): HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-performoperations</summary>
    function PerformOperations: HRESULT; stdcall;
    ///<summary>Documentation: https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-getanyoperationsaborted</summary>
    function GetAnyOperationsAborted(out pfAnyOperationsAborted: BOOL): HRESULT; stdcall;
  end;
oder
https://github.com/CMCHTPC/WindowsAP...2.ShObjIdl.pas
uvm.
Neuste Erkenntnis:
Seit Pos einen dritten Parameter hat,
wird PoSex im Delphi viel seltener praktiziert.

Geändert von himitsu (16. Jan 2024 um 10:13 Uhr)
  Mit Zitat antworten Zitat