IShortCut.Save -> does nothing?

delphi package - easy access to shell apis

IShortCut.Save -> does nothing?

Postby Niki911 » Mon Jun 14, 2004 12:32 pm

Hi,

I tried and tried and tried - but IShortCut.Save does not seem to save any changes to an existing LNK-File ? :(

I am reading the LNK-File (which IShortCut does correctly) and can access all data like params, path etc.
Everything seems fine with that.
But if I change the IShortCut.Path to a new EXE and call SAVE - the LNK-File will not be changed at all....
(even with the TRYTORESOLVE-Param set to false)

Any ideas on that?

Niki
Niki911
 
Posts: 12
Joined: Thu Jun 10, 2004 4:06 pm

Postby madshi » Tue Jun 15, 2004 9:54 am

Can you please give me a piece of code which fails? It seems to work for me.
madshi
Site Admin
 
Posts: 9376
Joined: Sun Mar 21, 2004 5:25 pm

Postby Niki911 » Tue Jun 15, 2004 1:40 pm

// I have tested/used this ONLY on Shortcuts in Startmenu/Autostart
// So please set filename to ANY Shortcut in that directory...

Link: IShortCut;
Filename: String;
Link:=LoadShortCut(filename);
Link.Path:='c:\windows\notepad.exe'; // for testing... makes no sense I know
Link.Save(Link.ShortCutFileName,false);

This SHOULD set the Shortcut-Target to the Notepad (or not?).
But it does nothing - the shortcut will be unchanged after this...

I am running WindowsXP (Pro with SP1) and using Delphi6Pro.

Niki
Niki911
 
Posts: 12
Joined: Thu Jun 10, 2004 4:06 pm

Postby madshi » Sun Jun 20, 2004 1:56 pm

Sorry for the delay, was on journey.

I've tried your code and it works just fine here on my XP. Could you please check whether the shortcut is valid after loading? ("if Link.IsValid then")
madshi
Site Admin
 
Posts: 9376
Joined: Sun Mar 21, 2004 5:25 pm


Return to madShell

Who is online

Users browsing this forum: No registered users and 1 guest

cron