Results 1 to 3 of 3

Thread: Windows folder

  1. #1

    Thread Starter
    Junior Member Barkruk's Avatar
    Join Date
    Apr 2001
    Location
    Holland
    Posts
    27

    Windows folder

    I have made a program that uses an ini-file. I want the ini-file to be placed in the Windows folder, but how do I know what folder the Windows folder is? I am workin under NT, so my Windows Folder is \WINNT\ , but people who re running 9x have the folder \WINDOWS\ . So how can my program know wich folder the Windows folder is?

  2. #2
    AIS_DK
    Guest
    Use the following API call:

    Code:
    Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
    
    private sub GetPath() as string
    dim strRes as string
    
    strRes = space(255)
    strRes = left(strRes, getWindowsDirectory(strRes, len(strRes)))
    GetPath = strRes
    
    end sub

  3. #3
    MerryVIP
    Guest
    Code:
    Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" _
        (ByVal lpBuffer As String, ByVal nSize As Long) As Long
    
    Public Function GetWindowsFolder() As String
        Dim Temp As String * 260
        GetWindowsFolder = Left(Temp, GetWindowsDirectory(Temp, 260))
    End Function
    WinDir = GetWindowsFolder


    Hope this helps,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width