Ver Mensaje Individual
  #5  
Antiguo 03-09-2007
jymy788 jymy788 is offline
Miembro
 
Registrado: jun 2004
Posts: 120
Reputación: 20
jymy788 Va por buen camino
desde luego es curioso lo siguiente:

Código Delphi [-]
 
procedure TForm1.Button1Click(Sender: TObject);
var
   IObject : IUnknown;
   ISLink : IShellLink;
   IPFile : IPersistFile;
   PIDL : PItemIDList;
   InFolder : array[0..MAX_PATH] of Char;
   TargetName : String;
   LinkName : WideString;
   Camino, probando: String;
begin
   TargetName := 'c:\windows\calc.exe';
   {Use TargetName:=ParamStr(0) which
   returns the path and file name of the
   executing program to create a link to your
   Application}
   IObject := CreateComObject(CLSID_ShellLink) ;
   ISLink := IObject as IShellLink;
   IPFile := IObject as IPersistFile;
   with ISLink do
   begin
     SetPath(pChar(TargetName)) ;
     SetWorkingDirectory(pChar(ExtractFilePath(TargetName))) ;
   end;
   // if we want to place a link on the Desktop
   SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL) ;
   SHGetPathFromIDList(PIDL, InFolder) ;
   {
    or if we want a link to appear in
    some other, not-so-special, folder:
    InFolder := 'c:\SomeFolder'
   }
//   LinkName := InFolder + '\Delphi Created Link.lnk';
//   IPFile.Save(PWChar(LinkName), false) ;
   SetLength(Camino, MAX_PATH+1);
   SHGetSpecialFolderPath(GetActiveWindow(), PChar(Camino), CSIDL_STARTMENU, False);
   ShowMessage('El menú inicio está en : ' + Camino);
   CreateDirectory(Camino + '\Programas\KK',0);
end;

El showmessage me devuelve bien la ruta pero oh maravilla, el create directory no me crea el puñetero menu
Responder Con Cita