I am asked to fix a problem. Given is a program written in C / C++, running as a windows-service under LocalSystem user.
On the desktop is a file First.lnk, stored in C:\Users\Public\Desktop. The link points to D:\Second.url.
When the user logs in the contents of Second.url is:
[InternetShortcut]
URL=
During running the service, the program adds a valid url in the second line.
Then I tried using method SHChangeNotify() with different arguments. But nevertheless, a doubleclick on the First.lnk still shows:
The target "" of this Intenet Shortcut is not valid. Go to the Internet Shortcut property sheet and make sure the target is correct.
What do I have to do, that the link on the desktop recognizes, that to targeted .url-file is updates?
Like said above, after a logout / login everything works fine. But that is no solution.
What I have tried:
I have tried
SHChangeNotify()
both on the First.lnk and Second.url. No way.
As arguments I tried: SHCNE_UPDATEITEM, SHCNE_ATTRIBUTES, SHCNE_UPDATEDIR. As 2nd parameter I used
SHCNF_PATHW
or
SHCNF_PATHW | SHCNF_FLUSH
or
SHCNF_PATHW | SHCNF_FLUSH | SHCNF_NOTIFYRECURSIVE