Ver Mensaje Individual
  #3  
Antiguo 19-09-2011
Avatar de escafandra
[escafandra] escafandra is offline
Miembro Premium
 
Registrado: nov 2007
Posts: 2.197
Reputación: 20
escafandra Tiene un aura espectacularescafandra Tiene un aura espectacular
Me gustaría añadir algo a mi mensaje anterior. El segundo enlace está equivocado, me refería al truco titulado Monitorizando el Shell sólo con la API.

En ese truco publico y subo una pequeña aplicación de ejemplo que monitoriza las acciones en un Memo. Para el caso que pretendes, fíjate en esta parte del código:
Código Delphi [-]
procedure TForm1.WMShellChanged(var Msg: TMessage);
var
  i: integer;
  ppidl: PPITEMIDLIST;
  Path: array [0..MAX_PATH] of CHAR;
begin
  ppidl:= PPITEMIDLIST(Msg.WParam);
  SHGetPathFromIDList(ppidl^, Path);
  if Path[0] = #0 then exit;
  case Msg.LParam and $7FFFFFF of
    ...............................................
    SHCNE_CREATE:
       Memo1.Lines.Add('Archivo nuevo: ' + String(Path));
    SHCNE_DELETE:
       Memo1.Lines.Add('Archivo borrado: ' + String(Path));
    ...............................................
    SHCNE_RENAMEITEM:
    begin
       i:=1;
       lstrcat(Path, ' a ');
       SHGetPathFromIDList(PAPITEMIDLIST(ppidl)[i], Path + lstrlen(Path));
       Memo1.Lines.Add('Archivo renombrado: ' + String(Path));
    end;
    ...............................................
       Memo1.Lines.Add(Path);
  end;
end;

También dispones del código en C++Builder, no se que lenguaje estás usando.

Juega con el código.


Saludos.
Responder Con Cita