FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Retrieve C:\Documents and Settings\<profilename>
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Retrieve C:\Documents and Settings\<profilename>
Posted: Tue May 01, 2007 04:21 PM

C:\Documents and Settings\<profilename>\Application Data\Microsoft\Stationery

What is the function to retrieve the <profilename> as in the path above?

Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Retrieve C:\Documents and Settings\&lt;profilename&gt;
Posted: Wed May 02, 2007 07:32 AM
Ollie,

you can read the environment

#include "FiveWin.ch"

function Main()

   local cValue := Space( 256 )

 //  MsgInfo( GetEnv( "USERPROFILE" ) )
   
   GetEnvironmentVariable( "USERPROFILE", cValue, Len( cValue ) )
   
   MsgInfo( cValue )
   
return nil

DLL32 FUNCTION GetEnvironmentVariable( cName AS LPSTR, ;
                                         cValue AS LPSTR, nLen AS LONG ) ;
   AS LONG PASCAL FROM "GetEnvironmentVariableA" LIB "kernel32.dll"


Stefan
kind regards

Stefan

Continue the discussion