Location of Windows directory (OpenInsight Specific)
At 31 MAY 1999 03:07:01AM Nick Stevenson wrote:
I have an .INI file that is created/updated on printer and font setup selections. I need this file to be placed in the user's Windows directory. 99% of all users have Windows in C:\Windows - but I am now working on an NT Terminal Server system where Windows is loaded into W:\Windows. Clearly, my SP must determine where to find this .INI file. I don't want to hard code anything, I don't want to have to store the location in a user profile table - I want to be able to determine where this .INI file should be at the time I want it. The GetPrivateProfileString function seems to work OK (I use this to get the list of printers).
Any ideas?
At 31 MAY 1999 07:04AM cpates@sprezzatura.com - [url=http://www.sprezzatura.com]Sprezzatura Group[/url] wrote:
Nick,
Use the windows API function GetWindowsDirectory()
It takes 2 arguments , lpWindowsPath and cbWindowsPath, which are a buffer to contain the directory string and the number of bytes in this buffer respectively.
eg
Buffer=Str( \00\, 256 )
RetVal=GetWindowsDirectory( Buffer, Len( Buffer ) )
Begin Case
Case RetVal=0; * FailedCase RetVal ] Len( Buffer ); * Buffer is too smallCase 1WinDir=Buffer1,RetValEnd Case
It should be protyped in DLL_KERNEL as:
USHORT PASCAL GetWindowsDirectory( LPCHAR, USHORT )
cpates@sprezzatura.com
World Leaders in all things RevSoft
At 31 MAY 1999 08:50AM Don Bakke wrote:
Nick,
It's always good to get some answers from Carl, but have you tried to update this INI file without specifying a path at all? I read and udpate WIN.INI and OINSIGHT.INI without a path and it always seems to work just fine.
dbakke@srpcs.com
At 01 JUN 1999 01:55AM Nick Stevenson wrote:
Thanks Carl - works like a dream.