From: SunilCM on
Hi,

My application needs to create a shortcut on the desktop,
I am using the registry key "HKEY_CURRENT_USER\Software\Microsoft
\Windows\CurrentVersion\Explorer\Shell Folders\Desktop" to get the
desktop path.
Now, all is fine but the shortcut is not getting created on a couple
of Windows Vista systems,
On investigation I found that the key "Desktop" under
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
\Shell Folders" is missing
Can anybody throw some light on why this key could be missing ?

Regards,
Sunil
From: Serge Wautier on
Why not use the documented way to do it:

SHGetSpecialFolderPath(..., CSIDL_DESKTOP,...)

HTH,

Serge.
http://www.apptranslator.com - Localization tool for your MFC applications



"SunilCM" <sunilcmnitk(a)gmail.com> wrote in message
news:a051a991-1f98-402a-916d-f7ef5eeaa8d7(a)f24g2000prh.googlegroups.com...
> Hi,
>
> My application needs to create a shortcut on the desktop,
> I am using the registry key "HKEY_CURRENT_USER\Software\Microsoft
> \Windows\CurrentVersion\Explorer\Shell Folders\Desktop" to get the
> desktop path.
> Now, all is fine but the shortcut is not getting created on a couple
> of Windows Vista systems,
> On investigation I found that the key "Desktop" under
> "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
> \Shell Folders" is missing
> Can anybody throw some light on why this key could be missing ?
>
> Regards,
> Sunil

From: SunilCM on
I did not use SHGetSpecialFolderPath(..) for the compatibility issues
with other OS like Win NT (may be due to unsupported version of
shell32.dll but could not slove it there) so trying to get the path
from the registry.

Now coming to the issue in hand, what could be the reason for absence
of this "Desktop" key under the "Shell Folders" ?.. Anything related
to the type of user accounts, etc,. ?


On May 20, 7:02 pm, "Serge Wautier" <se...(a)wautier.nospam.net> wrote:
> Why not use the documented way to do it:
>
> SHGetSpecialFolderPath(..., CSIDL_DESKTOP,...)
>
> HTH,
>
> Serge.http://www.apptranslator.com- Localization tool for your MFC applications
>
> "SunilCM" <sunilcmn...(a)gmail.com> wrote in message
>
> news:a051a991-1f98-402a-916d-f7ef5eeaa8d7(a)f24g2000prh.googlegroups.com...
>
>
>
> > Hi,
>
> > My application needs to create a shortcut on the desktop,
> > I am using the registry key "HKEY_CURRENT_USER\Software\Microsoft
> > \Windows\CurrentVersion\Explorer\Shell Folders\Desktop" to get the
> > desktop path.
> > Now, all is fine but the shortcut is not getting created on a couple
> > of Windows Vista systems,
> > On investigation I found that the key "Desktop" under
> > "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
> > \Shell Folders" is missing
> > Can anybody throw some light on why this key could be missing ?
>
> > Regards,
> > Sunil- Hide quoted text -
>
> - Show quoted text -

From: David Ching on
"SunilCM" <sunilcmnitk(a)gmail.com> wrote in message
news:34e9d2df-87aa-4a3e-8af2-7bbaa1742104(a)79g2000hsk.googlegroups.com...
> I did not use SHGetSpecialFolderPath(..) for the compatibility issues
> with other OS like Win NT (may be due to unsupported version of
> shell32.dll but could not slove it there) so trying to get the path
> from the registry.
>

A more robust scheme would be:

if ( SHGetSpecialFolderPath is supported )
{
// Call it;
}
else
{
// Downlevel OS; hard-code registry access, QA thoroughly
}


Why don't you try it on your Vista machine and see what path is returned?
As for why it has changed, who knows? Microsoft changes a lot of things for
no apparent reason, within its right because they certainly don't document
that folder locations such as these will remain the same.

-- David