GetUserProfileDirectoryA

GetUserProfileDirectoryA

Postby Silvio.Falconi » Wed Jan 15, 2020 1:05 pm

How Use this in fwh ?

https://docs.microsoft.com/en-us/windows/win32/api/userenv/nf-userenv-getuserprofiledirectorya

GetUserProfileDirectoryA function of Windows 10

I wish Know the right directory of \users\nameuser\
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Re: GetUserProfileDirectoryA

Postby karinha » Wed Jan 15, 2020 2:26 pm

There is no documentation of this on Harbour.

Code: Select all  Expand view

Dim sBuffer As String, Ret As Long, hToken As Long
 
Declare Function GetUserProfileDirectory Lib "userenv.dll" Alias "GetUserProfileDirectoryA" (ByVal hToken As Long, ByVal lpProfileDir As String, ByVal lpcchSize As Long) As Boolean
 
Sub Main()
Dim SpecialFolder As String
Dim fs As Object
Dim oldPath As String, newPath As String, specialPath As String
specialPath = GetUserProfileDirectory(hToken, sBuffer, 255)
oldPath = "H:\"
newPath = "
specialPath"
fs = CreateObject("
Scripting.FileSystemObject")
fs.CopyFile(oldPath & "
\" & "January2009.txt", newPath & "\" & "January2009.txt")
fs = Nothing
End Sub


Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7610
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: GetUserProfileDirectoryA

Postby Silvio.Falconi » Thu Jan 16, 2020 8:01 am

How Convert it into fwh ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Re: GetUserProfileDirectoryA

Postby Horizon » Thu Jan 16, 2020 11:52 am

Code: Select all  Expand view
FUNCTION GetDesktopDir()
LOCAL Result:=""
    Result := GETENV("USERPROFILE")+"\Desktop"
RETURN Result
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1301
Joined: Fri May 23, 2008 1:33 pm

Re: GetUserProfileDirectoryA

Postby Silvio.Falconi » Thu Jan 16, 2020 1:05 pm

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6897
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 58 guests