Re: Determining System Directories ??
From: songie D (songie_at_d.com)
Date: 05/21/04
- Next message: songie D: "Re: Icons increase EXE size...NO!!!"
- Previous message: songie D: "Re: Which is the proper way of coding?"
- In reply to: Wes Spikes: "Re: Determining System Directories ??"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 21 May 2004 19:35:57 +0100
You don't need 'String * 255' AND WinDir = Space(255).
"Wes Spikes" <MornThdr@NOSPAMverizon.net> wrote in message
news:rnbrc.6970$dq4.457@nwrddc01.gnilink.net...
> I don't know of such in VB, but I do know of an API call that works for
it!
>
> Declare Function GetWindowsDirectory Lib "kernel32" Alias
> "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
> Long
>
> You can use it like this:
>
> Dim WinDir As String * 255
> Dim gwdRet As Long
>
> WinDir = Space(255)
>
> gwdRet = GetWindowsDirectory(WinDir,Len(WinDir))
>
> If gwdRet = 0 Then
> 'there is an error using the API call that you must deal with, to get
more
> info
> ' you should be able to use GetLastError, but I'm not sure on what errors
> ' GetWindowsDirectory returns!
> End If
>
> WinDir = Trim(WinDir)
>
> Hope this helps, and sorry to any potential repliers who might say that
> something might be redundant, i'm improving this (except for the API
> declaration, I'm not a genius <g>)!
>
> -Wes
>
>
> "JSE" <john@nospam.conwayinfo.ca> wrote in message
> news:E7arc.517475$Pk3.173476@pd7tw1no...
> > Hello everyone.
> >
> > Is there a function or variable available in Visual Basic that an
> > application
> > can read to determine the name of the current Windows directory. We
want
> > the application to be able to search for a file in the windows root
> > directory, but
> > what is its name? c:\winnt c:\windows c:\mysys it could be
> anything.
> >
> > Is there a VB option for finding this?
> >
> > (something App.Path giving the current application directory).
> >
> > Thanks very much.
> >
> > John Edgar
> >
> >
> >
>
>
- Next message: songie D: "Re: Icons increase EXE size...NO!!!"
- Previous message: songie D: "Re: Which is the proper way of coding?"
- In reply to: Wes Spikes: "Re: Determining System Directories ??"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|