Función SHGetSpecialFolderPath de API...
Publicado por Draker (15 intervenciones) el 09/06/2003 19:38:06
Logré utilizar una función del API interesante, puedes obtener los directorios configurados en Windows no comunes, el código es el siguiente:
FUNCTION GetPicsDir(nHex) && Número Hexadecimal
LOCAL STRING sPathP
Declare Long SHGetSpecialFolderPath In "shell32.dll" ;
Long hWnd, String @sPath, Long Folder, Long Create
sPathP = SPACE(261) && Tamaño del string de 261 espacios en blanco.
= SHGetSpecialFolderPath(1, @sPathP, nHex, .F.) && Llama el valor al API.
*--- NOTA: @variable, pasa el parametro por referencia, es decir para que
*--- sea modificado y retorne su valor.
sPathP = LEFT(sPathP,AT(Chr(0),sPathP) - 1) && Asigna el valor del Path.
RETURN sPathP
ENDFUNC
Espero les sirva. Saludos desde Guatemala.
Draker
FUNCTION GetPicsDir(nHex) && Número Hexadecimal
LOCAL STRING sPathP
Declare Long SHGetSpecialFolderPath In "shell32.dll" ;
Long hWnd, String @sPath, Long Folder, Long Create
sPathP = SPACE(261) && Tamaño del string de 261 espacios en blanco.
= SHGetSpecialFolderPath(1, @sPathP, nHex, .F.) && Llama el valor al API.
*--- NOTA: @variable, pasa el parametro por referencia, es decir para que
*--- sea modificado y retorne su valor.
sPathP = LEFT(sPathP,AT(Chr(0),sPathP) - 1) && Asigna el valor del Path.
RETURN sPathP
ENDFUNC
Espero les sirva. Saludos desde Guatemala.
Draker
Valora esta pregunta


0