Em Andamento

apiGetSystemDirectory for 64 bit system.

WIN API **GetSystemDirectory()** seems to return the WOW64 directory in 64bit system, ie: **"C:/WINDOWS/SysWOW64**". Is there any way where i can get the native system32 directory? **"C:/WINDOWS/System32"** without changing my existing code to much.? Please advise.

My Code is in VB6?

'GET WINDOWS ANS SYS DIRECTORY

Declare Function apiGetWindowsDirectory& Lib "kernel32" Alias _

? ? "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)

Declare Function apiGetSystemDirectory Lib "kernel32" Alias _

? ? "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize _

? ? As Long) As Long

Private Sub Command1_Click()

Dim lpBuffer As String * 255

Dim Length As Long

Dim Length2 As Long

Length = apiGetWindowsDirectory(lpBuffer, Len(lpBuffer))

GetWinDir = Left(lpBuffer, Length)

Length2 = apiGetSystemDirectory(lpBuffer, Len(lpBuffer))

GetSysDir = Left(lpBuffer, Length2)

MsgBox Trim(GetSysDir)

End Sub

Private Sub Command2_Click()

Dim lpBuffer As String * 255

Dim Length As Long

Dim Length2 As Long

Length = apiGetWindowsDirectory(lpBuffer, Len(lpBuffer))

GetWinDir = Left(lpBuffer, Length)

Length2 = apiGetSystemDirectory(lpBuffer, Len(lpBuffer))

GetSysDir = Left(lpBuffer, Length2)

MsgBox Trim(GetWinDir)

End Sub

Habilidades: .NET, Programação C, Engenharia, Microsoft, MySQL, PHP, Arquitetura de software, Teste de Software, Visual Basic, Visual Basic para Apps, Área de trabalho do Windows

Ver mais: code sys, sub system, len, php function vb6, win api, php 64bit windows, php windows 64bit, bit programming, vb6 programming, 64bit programming, windows bit, lib code, vb6 function php, 64bit php, windows system programming, existing system function, 64bit, vb6 system, system vb6, programming windows api, code trim, sys system

Acerca do Empregador:
( 205 comentários ) Kuala Lumpur, Malaysia

ID do Projeto: #3034934

Premiar a:

meekaah

See private message.

$25.5 USD em 1 dia
(20 Avaliações)
4.3