MB Software Solutions, LLC wrote: > Tracy Pearson wrote: >> You might consider shipping in your main application, and a second >> diagnostic application with a menu option to launch explorer in the desired >> path. I hide the launch menu option as a right click of the about form. >> >> Launching the explorer window the way it's done below, will start it as a >> child of the main thread, instead of a child of your application. It starts >> faster this way too. >> >> [code] >> #DEFINE CSIDL_APPDATA 0x001a >> #DEFINE CSIDL_COMMON_APPDATA 0x0023 >> #DEFINE CSIDL_LOCAL_APPDATA 0x001c >> #DEFINE CSIDL_PERSONAL 0x0005 >> #DEFINE CSIDL_MYPICTURES 0x0027 >> >> DECLARE INTEGER SHGetFolderPath IN SHFolder.dll AS SHGetFolderPath; >> INTEGER hwndOwner, ; >> INTEGER nFolder, ; >> INTEGER hToken, ; >> INTEGER dwFlags, ; >> STRING@ pszPath >> >> DECLARE INTEGER ShellExecute IN Shell32.dll AS ShellExecute; >> INTEGER nWinHandle, ; >> STRING cOperation, ; >> STRING cFileName, ; >> STRING cParameters, ; >> STRING cDirectory, ; >> INTEGER nShowWindow >> >> >> cPath = GetAppDataLocation() >> cCmd = cPath >> cParams = "" >> >> ShellExecute(0, "open", cCmd, cParams, cPath, 1) >> >> PROCEDURE GetPicturesLocation >> Local cPath, nrtn, nhwnd, ntkn, nflags >> STORE 0 TO nrtn, nhwnd, ntkn, nflags >> cPath = REPLICATE(CHR(0),254) >> nrtn = SHGetFolderPath(nhwnd, CSIDL_MYPICTURES, ntkn, nflags, @cPath) >> cPath = ALLTRIM(cPath, CHR(0)) >> RETURN cPath >> ENDPROC >> >> PROCEDURE GetDocumentsLocation >> Local cPath, nrtn, nhwnd, ntkn, nflags >> STORE 0 TO nrtn, nhwnd, ntkn, nflags >> cPath = REPLICATE(CHR(0),254) >> nrtn = SHGetFolderPath(nhwnd, CSIDL_PERSONAL, ntkn, nflags, @cPath) >> cPath = ALLTRIM(cPath, CHR(0)) >> RETURN cPath >> ENDPROC >> >> PROCEDURE GetAppDataLocation >> Local cPath, nrtn, nhwnd, ntkn, nflags >> STORE 0 TO nrtn, nhwnd, ntkn, nflags >> cPath = REPLICATE(CHR(0),254) >> nrtn = SHGetFolderPath(nhwnd, CSIDL_COMMON_APPDATA, ntkn, nflags, @cPath) >> cPath = ALLTRIM(cPath, CHR(0)) >> RETURN cPath >> ENDPROC >> [/code] > > > Very cool...I'll put this one in the KEEP folder. ;-)
I'm going to look into converting this code into Python, and doing it for all 3 platforms I support (Win, Mac, and Linux). Good idea giving the user a menu option or something to launch the os's file explorer showing the appdata dir for the app. Will make my life much easier when I need to ask for information, and I never considered it before. Thanks! Paul _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/4a96b077.6090...@ulmcnett.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.