Visual Basic - Nombre del escritorio

Life is soft - evento anual de software empresarial
 
Vista:

Nombre del escritorio

Publicado por MATIAS (103 intervenciones) el 18/03/2005 18:50:54
mediante el registro yo puedo saber cual es la ruta del escritorio ya sea que mi sistema operativo este en ingles, castellano o el idioma que sea
ahora bien.....como puedo saber como se llama mi escritorio? es decir, si mi SO esta en español obtendré: "Escritorio" y si lo tengo en ingles obtendré: "Desktop"
y con "Mi PC"?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Nombre del escritorio

Publicado por Benjo (679 intervenciones) el 19/03/2005 02:55:32
Puede que exista una forma mucho más sencilla

Const CSIDL_DESKTOP = &H0
Const MAX_PATH = 260
Private Type SHITEMID
cb As Long
abID As Byte
End Type
Private Type ITEMIDLIST
mkid As SHITEMID
End Type
Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Sub Form_Load()
Me.AutoRedraw = True
Dim text As String
text = GetSpecialfolder(CSIDL_DESKTOP)
Me.Print "Se llama : " + Mid(text, InStrRev(text, "\") + 1)
End Sub
Private Function GetSpecialfolder(CSIDL As Long) As String
Dim r As Long
Dim IDL As ITEMIDLIST
r = SHGetSpecialFolderLocation(100, CSIDL, IDL)
If r = NOERROR Then
Path$ = Space$(512)
r = SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal Path$)
GetSpecialfolder = Left$(Path, InStr(Path, Chr$(0)) - 1)
Exit Function
End If
GetSpecialfolder = ""
End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

gracias

Publicado por MATIAS (103 intervenciones) el 19/03/2005 02:59:59
anduvo muy bien!
gracias Benjo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar