Problème de dragdrop avec ShelllistView et ShellTreeView

ActiveX Messages postés 32 Date d'inscription jeudi 6 février 2003 Statut Membre Dernière intervention 22 janvier 2008 - 4 févr. 2005 à 23:54
ActiveX Messages postés 32 Date d'inscription jeudi 6 février 2003 Statut Membre Dernière intervention 22 janvier 2008 - 6 févr. 2005 à 08:54
Bonjour j'ai un probleme pouvez-vous m'aider

je veux faire du même principe qu'avec un filelistbox et directoryOutLine

soit :

if Source is TFileListBox then
with DirectoryOutLine1 do
ConfirmChange('Move', FileList.FileName, Items[GetItem(x,y)].FullPath);

mais avec ShellTreeView

il me retour soit un Node out Le Path Source mais pas la cible

ShellTreeView1.GetNodeAt(x,y);

ActiveX

1 réponse

ActiveX Messages postés 32 Date d'inscription jeudi 6 février 2003 Statut Membre Dernière intervention 22 janvier 2008
6 févr. 2005 à 08:54
ok j'ai trouvé

voici

procedure TGlobalFilesForm.ShellTreeView1DragDrop(Sender, Source: TObject;
X, Y: Integer);
var
ax: Integer;
begin
if Source is TShellListview then
begin
if AnsiLastChar(ShellTreeView1.Folders[ShellTreeView1.GetNodeAt (x,y).AbsoluteIndex].PathName)^ <> '\' then
S := ShellTreeView1.Folders[ShellTreeView1.GetNodeAt(x,y).AbsoluteIndex].PathName + '\'
else
S := ShellTreeView1.Folders[ShellTreeView1.GetNodeAt(x,y).AbsoluteIndex].PathName;
for ax := 0 to ShellListView1.Items.Count-1 do
begin
if ShellListView1.Items.Item[ax].Selected then
MoveTo(ShellListView1.Folders[ax].PathName ,S+ExtractFileName(ShellListView1.Folders[ax].PathName));
end;
end
else if Source is TShellTreeview then
begin
UserHasCancelled := true;
MoveDirectory(TmpPath,ShellTreeView1.Folders[ShellTreeView1.GetNodeAt(x,y).AbsoluteIndex].PathName,true,true,true,true,true,UserHasCancelled);
ShellTreeView1.Items.Delete(SelectNode);
ShellTreeView1.Refresh(ShellTreeView1.GetNodeAt(x,y));
end;
end;
0
Rejoignez-nous