FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GetUserProfileDirectoryA
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
GetUserProfileDirectoryA
Posted: Wed Jan 15, 2020 01: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 March-April 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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: GetUserProfileDirectoryA
Posted: Wed Jan 15, 2020 02:26 PM
There is no documentation of this on Harbour.

Code (fw): Select all Collapse
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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: GetUserProfileDirectoryA
Posted: Thu Jan 16, 2020 08:01 AM

How Convert it into fwh ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: GetUserProfileDirectoryA
Posted: Thu Jan 16, 2020 11:52 AM
Code (fw): Select all Collapse
FUNCTION GetDesktopDir()
LOCAL Result:=""
    Result := GETENV("USERPROFILE")+"\Desktop"
RETURN Result
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: GetUserProfileDirectoryA
Posted: Thu Jan 16, 2020 01:05 PM

thanks

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion