Yes but SHGetFolderPath is effectively a wrapper for SHGetKnownFolderPath or it at least ends up calling SHGetKnownFolderPath
-----Original Message----- From: ProfoxTech [mailto:[email protected]] On Behalf Of Alan Bourke Sent: 04 May 2017 19:37 To: [email protected] Subject: Re: GetFile() problem (VFP9, Win 10) SHGetFolderPath is apparently deprecated and SHGetKnownFolderPath is apparently the new way. -- Alan Bourke alanpbourke (at) fastmail (dot) fm On Thu, 4 May 2017, at 03:23 PM, Paul Newton wrote: > Hi all > > Users are complaining that when running the following code more than > once, GetFile() displays the contents of the folder the user last > browsed to despite the code changing the default directory to the My > Documents folder before calling GetFile(). I simply do not see how > this could happen but I have had the issue demonstrated to me and I > have seen it with my own eyes .... I am completely stumped and cannot > reproduce the problem myself. > > FWIW this is a VFP9 app running under Windows 10 > > #Define CSIDL_PERSONAL 0x0005 > Local lcDocumentsPath, lcOriginalPath > lcOriginalPath = SET("Default") + SYS(2003) > lcDocumentsPath = Space(255) > Declare SHORT SHGetFolderPath In SHFolder.Dll ; > INTEGER hwndOwner, Integer nFolder, Integer hToken, ; > INTEGER dwFlags, String @pszPath > SHGetFolderPath(0, CSIDL_PERSONAL, 0, 0, @lcDocumentsPath) > lcDocumentsPath = Alltrim(lcDocumentsPath) > Set Default To (lcDocumentsPath) > ? GetFile() > SET DEFAULT TO (lcOriginalPath) > > Any ideas anybody? > > Thanks > > Paul Newton > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/by2pr0201mb17977a5452247973a1653be7a1...@by2pr0201mb1797.namprd02.prod.outlook.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.

