Ver Mensaje Individual
  #8  
Antiguo 29-09-2008
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Reputación: 20
cHackAll Va por buen camino
Cita:
Empezado por rauros Ver Mensaje
Y exactamente que hace eso?

Voy a ponerte desde mi punto de vista lo que pienso que hace:

Si coges los atributos de archivos de programa (por qué?) y parte desconocida por mí se genera el mensaje LNK.
Tienes mucha razón rauros, creo que me falla la "vista" pues no se desde qué momento me convencí que necesitabas reconocer a un "Symbolic Link", en todo caso "edito"

Código Delphi [-]
uses ActiveX, ComObj, ShlObj;
 
function GetShellLinkPath(FileName: string): string;
var ShellLink: IUnknown;
begin
 ShellLink := CreateComObject(CLSID_ShellLink);
 if (ShellLink as IPersistFile).Load(PWideChar(WideString(FileName)), STGM_READ) = 0 then
  begin
   SetLength(FileName, MAX_PATH);
   (ShellLink as IShellLink).GetPath(@FileName[1], MAX_PATH, PWin32FindData(0)^, SLGP_UNCPRIORITY);
   Result := PChar(@FileName[1]);
  end;
end;
 
procedure TForm1.Button1Click(Sender: TObject);
var FileName: PChar;
begin
 FileName := PChar(GetShellLinkPath('c:\Documents and Settings\666\Desktop\ClubDelphi.lnk'));
 if (FileName <> '') and LongBool(GetFileAttributes(FileName) and FILE_ATTRIBUTE_DIRECTORY) then
  if not SetCurrentDirectory(FileName) then
   MessageBox(Handle, PChar(SysErrorMessage(GetLastError)), nil, MB_ICONERROR);
end;

Saludos
__________________
RTFM > STFW > Foro > Truco > Post > cHackAll > KeBugCheckEx
Responder Con Cita