From: Joachim Buermann on
Hello,

I'm looking for a plattform independent way, to examinate the path of the
user's current desktop folder. The background: My application has to create a
shortcut desktop icon automatically.

On Linux ::wxGetUserHome() extended with "Desktop" should works with Gnome and
KDE, but within windows I'm very confused by the microsoft documentation
about:

SHGetFolderPath(...)

The dll for this function isn't the same on different versions like win98, NT
or XP (shfolder.dll or shell32.dll), and the function has to be loaded
dynamically by the application.
More complicated: Within Windows, the user also can change the desktop folder
name and the folder also depend on the user's language settings.

I didn't found any functionality in the wxWidget API, but maybe I'm
overlooking something.

Thanks for any help on this,
Joachim

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: =?ISO-8859-9?Q?Nusret_Ta=FE=E7=FD?= on
> within windows I'm very confused by the microsoft documentation
> about:

> SHGetFolderPath(...)

SHGetSpecialFolderPath() with CSIDL_DESKTOPDIRECTORY might work for you.
AFAIR, it's perfectly valid for a user to move it's desktop directory to
somewhere else than the default path. If he moves it with explorer, than
explorer will notice this and calls to SHGetSpecialFolderPath() will
return the new path.

BOOL SHGetSpecialFolderPath(HWND hwndOwner,
LPTSTR lpszPath,
int nFolder,
BOOL fCreate
);

CSIDL_DESKTOPDIRECTORY (0x0010)
The file system directory used to physically store file objects on the
desktop (not to be confused with the desktop folder itself). A typical
path is C:\Documents and Settings\username\Desktop.


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Joachim Buermann on
Hello Nusret,

thank you very much for your response. As far as I understand, also the
SHGetSpecialFolderPath depends on the microsoft windows version. For newer
systems (like win2k and XP or Vista) the shell32 export this function, on
older systems, the function is included by the shfolder.dll.
So an application, running at all systems should have to import this function
dynamically and couldn't linked against on of these.
I'm not a windows specialist, but hoping, there exist another more simplicated
way, to get the users desktop folder.
If the user doesn't change it's desktop folder name, I also can use
the ::wxGetUserHome() function and just add a "Desktop" entry to it's path -
but I'm not sure, if this is the right way to do this (and if 'Desktop' is
the correct name on other language settings).

Anyway, thangs again and best regards
Joachim

Am Tuesday 07 November 2006 11:51 schrieb Nusret Taþçý:
> > within windows I'm very confused by the microsoft documentation
> > about:
> >
> > SHGetFolderPath(...)
>
> SHGetSpecialFolderPath() with CSIDL_DESKTOPDIRECTORY might work for you.
> AFAIR, it's perfectly valid for a user to move it's desktop directory to
> somewhere else than the default path. If he moves it with explorer, than
> explorer will notice this and calls to SHGetSpecialFolderPath() will
> return the new path.
>
> BOOL SHGetSpecialFolderPath(HWND hwndOwner,
> LPTSTR lpszPath,
> int nFolder,
> BOOL fCreate
> );
>
> CSIDL_DESKTOPDIRECTORY (0x0010)
> The file system directory used to physically store file objects on the
> desktop (not to be confused with the desktop folder itself). A typical
> path is C:\Documents and Settings\username\Desktop.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Francesco Montorsi on
Joachim Buermann ha scritto:
> Hello Nusret,
>
> thank you very much for your response. As far as I understand, also the
> SHGetSpecialFolderPath depends on the microsoft windows version. For newer
> systems (like win2k and XP or Vista) the shell32 export this function, on
> older systems, the function is included by the shfolder.dll.
> So an application, running at all systems should have to import this function
> dynamically and couldn't linked against on of these.
> I'm not a windows specialist, but hoping, there exist another more simplicated
> way, to get the users desktop folder.
> If the user doesn't change it's desktop folder name, I also can use
> the ::wxGetUserHome() function and just add a "Desktop" entry to it's path -
> but I'm not sure, if this is the right way to do this (and if 'Desktop' is
> the correct name on other language settings).
I think that a wxStandardPaths::GetDesktopDir() function would be a nice
addition to wxStandardPaths...

making a patch for that shouldn't be difficult specially because
SHGetSpecialFolderPath is already wrapped there:

wxString wxStandardPaths::GetDesktopDir() const
{
return DoGetDirectory(CSIDL_DESKTOPDIRECTORY);
}

Francesco



---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Joachim Buermann on
Hello Francesco,

wow, thanks! That's the hint I'm looking for. I will add a GetDesktopDir()
member to my wxMSW and wxGtk sources and will make some tests.

So, thanks again for your nice assistance.
Best regards
Joachim

Am Tuesday 07 November 2006 13:46 schrieb Francesco Montorsi:
> Joachim Buermann ha scritto:
> > Hello Nusret,
> >
> > thank you very much for your response. As far as I understand, also the
> > SHGetSpecialFolderPath depends on the microsoft windows version. For
> > newer systems (like win2k and XP or Vista) the shell32 export this
> > function, on older systems, the function is included by the shfolder.dll.
> > So an application, running at all systems should have to import this
> > function dynamically and couldn't linked against on of these.
> > I'm not a windows specialist, but hoping, there exist another more
> > simplicated way, to get the users desktop folder.
> > If the user doesn't change it's desktop folder name, I also can use
> > the ::wxGetUserHome() function and just add a "Desktop" entry to it's
> > path - but I'm not sure, if this is the right way to do this (and if
> > 'Desktop' is the correct name on other language settings).
>
> I think that a wxStandardPaths::GetDesktopDir() function would be a nice
> addition to wxStandardPaths...
>
> making a patch for that shouldn't be difficult specially because
> SHGetSpecialFolderPath is already wrapped there:
>
> wxString wxStandardPaths::GetDesktopDir() const
> {
> return DoGetDirectory(CSIDL_DESKTOPDIRECTORY);
> }
>
> Francesco
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org