AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

SHFileOperation abbrechen per Code

Ein Thema von Mattze · begonnen am 30. Jul 2013 · letzter Beitrag vom 18. Jan 2024
Antwort Antwort
Benutzerbild von himitsu
himitsu

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

AW: SHFileOperation abbrechen per Code

  Alt 16. Jan 2024, 09: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.
Ein Therapeut entspricht 1024 Gigapeut.

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

Registriert seit: 10. Jul 2023
72 Beiträge
 
#2

AW: SHFileOperation abbrechen per Code

  Alt 18. Jan 2024, 15:36
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)
Tja, ich habe aber leider keine Quellen aus einem aktuelleren Delphi zur Verfügung.


Wie ich schon geschrieben hatte, ich glaube ich bin zu doof dafür - ich hatte da bei meiner Internetsuche leider nichts vernünftiges gefunden.
Auf jeden Fall ist der von Dir gepostete Link auf das GitHub-Projekt Gold wert. Danke!

Da ist alles drin, was das Herz begehrt - ist zwar für FPC/Lazarus geschrieben und sehr verteilt / umfangreich, aber die Umsetzung auf D7 und die Ausdünnung auf meinen Anwendungsfall bekomme ich noch hin

Ist zwar mit den vielen Interfaces und Typen immer noch eine Menge (Fleiss-)Arbeit - aber ich denke, da bin ich jetzt schon auf einem guten Weg, das zu implementieren...
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:33 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz