Re: How do i find the start menu path?

2003-10-29 Thread Martin Fuchs
Hello Robert,

 I have a question for my start menu generator, that is almost finished 
 now...
 
 How do I find the path of the wine start menu? (for me it's 
 ~/c/windows/Start Menu, but for someone else it does not have to be like 
 that...)
 
 Any help here?


Ypu should use the function
SHGetSpecialFolderPath():

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shgetspecialfolderpath.asp

Using CSIDL_STARTMENU and CSIDL_COMMON_STARTMENU you get the root path of
the user's respective the common start menu:


#include stdio.h
#include windows.h
#include shlobj.h


void process_startmenu(LPCTSTR path)
{

// process start menu entries

}


int main(int argc, char* argv[])
{
TCHAR path[1024];

if (SHGetSpecialFolderPath(0, path, CSIDL_STARTMENU, FALSE)) {
printf(user start menu root: %s\n, path);

process_startmenu(path);
}

if (SHGetSpecialFolderPath(0, path, CSIDL_COMMON_STARTMENU, FALSE)) {
printf(common start menu root: %s\n, path);

process_startmenu(path);
}

return 0;
}


-- 
Martin Fuchs
[EMAIL PROTECTED]

NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++




RE: How do i find the start menu path?

2003-10-29 Thread Rolf Kalbermatter
Robert van Herk [EMAIL PROTECTED] wrote:

I have a question for my start menu generator, that is almost finished 
now...

How do I find the path of the wine start menu? (for me it's 
~/c/windows/Start Menu, but for someone else it does not have to be like 
that...)

I assume/hope you have a winelib app in which case you can just simply
call

ret = SHGetSpecialFolderPathW(NULL, lpString, CSIDL_PROGRAMS, FALSE);

and unless SHRestricted(REST_NOCOMMONGROUPS) is true also

ret = SHGetSpecialFolderPathW(NULL, lpString, CSIDL_COMMON_PROGRAMS, FALSE);

Rolf Kalbermatter