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. ;-) -- Mike Babcock, MCP MB Software Solutions, LLC President, Chief Software Architect http://mbsoftwaresolutions.com http://fabmate.com http://twitter.com/mbabcock16 _______________________________________________ Post Messages to: [email protected] 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/[email protected] ** 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.

