(Gast)
n/a Beiträge
|
AW: [nonVCL]Drag&Drop nach Explorer will nicht (AV)
22. Feb 2011, 20:19
Meine Routine..
Müßtest du dir aber anpassen.
Delphi-Quellcode:
WM_DROPFILES: // Drag & drop
begin
nFilesDropped := DragQueryFile(wP, LongWord(-1), '', 0);
sFileName := '';
PlayListCount := 0;
hList := 0;
SetLength(PlayList, MAX_PATH);
if nFilesDropped > 0 then
begin
// Sichtbare PlayListe nur Titel
hPlaylist := GetMainItem(ID_PLAYLIST);
ListDeleteAll(hPlaylist);
// PlayListe incl. Pfad
hList := GetMainItem(ID_PLAYLISTBOX);
ListDeleteAll(hList);
for K := 0 to nFilesDropped - 1 do
begin
SetLength(sFileName, DragQueryFile(wP, k, nil, 0));
DragQueryFile(wP, K, @sFileName[1], Length(sFileName) + 1);
sFileName := LowerCase(sFileName);
nCheck := BassCheckExtension(sFileName);
if nCheck = 1 then
begin
if ListAdd(hList, sFileName) > -1 then
begin
ListAdd(hPlaylist, ExtractFileName(AnsiLeftStr(sFileName, Length(sFileName) - 4)));
inc(PlayListCount);
end;
end else
if nCheck = 0 then
begin
Files := nil;
Ext := Split(BASSAUDIOEXT, ',');
for IntExt := 0 to Length(Ext)- 1 do
FindAllFiles(sFileName, Ext[IntExt], True);
for IntI := 0 to length(Files) - 1 do
begin
if ListAdd(hList, Files[IntI]) > -1 then
begin
ListAdd(hPlaylist, ExtractFileName(AnsiLeftStr(Files[IntI], Length(Files[IntI]) - 4)));
inc(PlayListCount);
end;
end;
end; // end nCheck
end; // end for K
end; // end nFilesDropped
DragFinish(wP);
SavePlayList(hList, PlayListCount);
PlayListPlay(hList, PlayListCount);
SetForegroundWindow(WinHandle);
// TopItem der Playlist ermitteln
ItemTop := TMPlayList.ListGetTopIndex(TMPlayList.Handle);
// Trackbar Value übergeben
If (ItemTop > 0) Then
SetTrackValue(SkinEngine.GetMainItem(ID_TRACK_VSCROLL), ItemTop - 1)
else
SetTrackValue(SkinEngine.GetMainItem(ID_TRACK_VSCROLL), ItemTop);
end;
gruss
|
|
Zitat
|