NTK and The NTK Project
are properties of Jn Dechereux
Home | Documentation | FAQ.

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentTimeOct 12th 2012
    Hi there
    In my NTK app, I would like to get the path of Windows special folders: My Documents, My Pictures, My Music, ect. Unfortunately, they can be different from system to system. Does anyone know a reliable and system independant way to retrieve these special paths??
    • CommentTimeOct 15th 2012 edited
    Hi newbie1

    IMO, you can use the NTKCore api:
    NTK SHGetSpecialFolderPath( hWndOwner, nCSIDL, lCreate ) -> cSpecialPathFolder

    So, you just have to call it with the right CSIDL and the requested special folder path is
    returned. e.g. CSIDL_WINDOWS for Windows directory, CSIDL_PERSONAL for My Documents, CSIDL_MYMUSIC
    CSIDL_MYPICTURES, and so on (see complete list in NTKSHELL.CH)

    Here is a little snippet that fetches the path of Desktop directory:
    // Get the special folder path.
    cStrPath := NTK_SHGetSpecialFolderPath(hWwnd,;
                                           CSIDL_DESKTOPDIRECTORY,; // CSLID of folder
                                           .F. ) // Create if doesn't exists?

    Hope this helps.
    Btw, this function is very well doc'ed in NTKCore_Part2.pdf :wink:

    • CommentTimeOct 17th 2012
    Thanks for that - NTK_SHGetSpecialFolderPath() is exactly what I needed. :bigsmile: