![]() |
Drag Drop funktioniert nicht ;(
Nicht jedesmal kann ich auf mein Programm Objecte zB vom Desktop ziehen. Dann Programm beenden neustarten - dann geht es (oder auch nicht) woran könnt das liegen bzw. wie kann ich das beheben?!
|
Re: Drag Drop funktioniert nicht ;(
Ohne Code, wie du es machst, wird es schwierig dir zu helfen.
|
Re: Drag Drop funktioniert nicht ;(
hmm sorry - verwende diesen Code.
in der OnCreate steht noch das DragAcceptFiles(Form1.Handle, True);
Delphi-Quellcode:
interface procedure WMDROPFILES(var Msg: TMessage); implementation procedure TForm1.WMDROPFILES(var Msg: TWMDropFiles); var pcFileName: PChar; i, iSize, iFileCount: integer; begin pcFileName := ''; // to avoid compiler warning message iFileCount := DragQueryFile(Msg.wParam, $FFFFFFFF, pcFileName, 255); for i := 0 to iFileCount - 1 do begin iSize := DragQueryFile(Msg.wParam, i, nil, 0) + 1; pcFileName := StrAlloc(iSize); DragQueryFile(Msg.wParam, i, pcFileName, iSize); if FileExists(pcFileName) then AddFile(pcFileName); // method to add each file StrDispose(pcFileName); end; DragFinish(Msg.wParam); end; |
Re: Drag Drop funktioniert nicht ;(
Du musst die Windows-Message abfangen.
Delphi-Quellcode:
procedure Name(var Msg: TMessage); message WM_DROPFILES;
... procedure Name(var Msg: TMessage); begin end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:48 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