/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
Rundll32.exe
Fra : Guillot David


Dato : 20-06-03 16:08

Use Rundll32.exe for runing API, it's OK. But how to have the value returned
by API and not by Shell ?
Example : lngRetour_Ini = Shell("Rundll32.exe
kernel32.dll,GetWindowsDirectoryA strChemin_tmp, 1024)", vbMinimizedNoFocus)
lngRetour_Ini has the value of Shell and not of
GetWindowsDirectoryA



 
 
Tim Sørensen (20-06-2003)
Kommentar
Fra : Tim Sørensen


Dato : 20-06-03 23:16

why are you running RunDll32 instead of just calling the API directly?

Declare Function GetWindowsDirectory Lib "kernel32" _
Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, _
ByVal nSize As Long) As Long

Function WindowsDir() As String
Dim x As Long
Dim sPath As String
strPath = Space$(1024)
x = GetWindowsDirectory(sPath, Len(sPath))
sPath = Left$(sPath, x)
If Right$(strPath, 1) <> "\" Then sPath = sPath & "\"
WindowsDir = sPath
End Function

And please... Next time in Danish :)

--
Mvh.... Tim Sørensen
56º 24'209 N / 10º 55'631 E



Søg
Reklame
Statistik
Spørgsmål : 177557
Tips : 31968
Nyheder : 719565
Indlæg : 6408879
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste