Hola Gente!
Quisiera saber si existe alguna funcion que me devuelva la carpeta Escritorio del Usuario activo en Windows; o al menos la carpeta raiz que contiene estas carpetas
Gracias!
Carpeta Escritorio en Windows
- karinha
- Posts: 7948
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Carpeta Escritorio en Windows
Mira se és esto:
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=36234&p=216104&hilit=cGetFile#p216104
http://fivewin.com.br/index.php?/topic/27966-escolher-caminho-onde-ser%C3%A1-salvo-o-arquivo-gerado-pelo-sistema-txtdec-etc/&tab=comments#comment-285157
Saludos.
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=36234&p=216104&hilit=cGetFile#p216104
http://fivewin.com.br/index.php?/topic/27966-escolher-caminho-onde-ser%C3%A1-salvo-o-arquivo-gerado-pelo-sistema-txtdec-etc/&tab=comments#comment-285157
Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Carpeta Escritorio en Windows
Code: Select all | Expand
Desde PRG:
MsgInfo( DesktopFolder() )
#pragma BEGINDUMP
#include <windows.h>
#include <shlobj_core.h>
#include <hbapi.h>
HB_FUNC( DESKTOPFOLDER )
{
char path[ MAX_PATH + 1 ] = { 0 };
SHGetSpecialFolderPath( NULL, path, CSIDL_DESKTOP, FALSE );
hb_retc( path );
}
#pragma ENDDUMP
- karinha
- Posts: 7948
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
- MarioG
- Posts: 1380
- Joined: Fri Oct 14, 2005 1:28 pm
- Location: Resistencia - Chaco - AR
- Been thanked: 2 times
Re: Carpeta Escritorio en Windows
Muchas gracias por las respuestas!
Resistencia - "Ciudad de las Esculturas"
Chaco - Argentina
Chaco - Argentina
Re: Carpeta Escritorio en Windows
Hola,
Yo uso esto:
Así:
GETSPECIALFOLDER( CSIDL_PERSONAL )
GETSPECIALFOLDER( CSIDL_PROGRAM_FILES )
GETSPECIALFOLDER( CSIDL_FAVORITES )
GETSPECIALFOLDER( CSIDL_COMMON_FAVORITES )
GETSPECIALFOLDER( CSIDL_DESKTOPDIRECTORY )
GETSPECIALFOLDER( CSIDL_COMMON_DESKTOPDIRECTORY )
GETSPECIALFOLDER( CSIDL_PROGRAMS )
GETSPECIALFOLDER( CSIDL_COMMON_STARTMENU )
GETSPECIALFOLDER( CSIDL_PROFILE )
Como ves la info está todo en este foro!!!!
Yo uso esto:
Code: Select all | Expand
*---------------------------------------------------------------*
Function GETSPECIALFOLDER(nCSIDL) // Contributed By Ryszard Rylko
*---------------------------------------------------------------*
RETURN C_getspecialfolder(nCSIDL)
*---------------------------------------------------------------*
#pragma BEGINDUMP
#include <windows.h>
#include <shlobj.h>
#include "hbapi.h"
#include "hbapiitm.h"
HB_FUNC( C_GETSPECIALFOLDER ) // Contributed By Ryszard RyRko
{
char *lpBuffer = (char*) hb_xgrab( MAX_PATH+1);
LPITEMIDLIST pidlBrowse; // PIDL selected by user
SHGetSpecialFolderLocation(GetActiveWindow(), hb_parni(1), &pidlBrowse)
;
SHGetPathFromIDList(pidlBrowse, lpBuffer);
hb_retc(lpBuffer);
hb_xfree( lpBuffer);
}
#pragma ENDDUMP
*---------------------------------------------------------------*
Así:
GETSPECIALFOLDER( CSIDL_PERSONAL )
GETSPECIALFOLDER( CSIDL_PROGRAM_FILES )
GETSPECIALFOLDER( CSIDL_FAVORITES )
GETSPECIALFOLDER( CSIDL_COMMON_FAVORITES )
GETSPECIALFOLDER( CSIDL_DESKTOPDIRECTORY )
GETSPECIALFOLDER( CSIDL_COMMON_DESKTOPDIRECTORY )
GETSPECIALFOLDER( CSIDL_PROGRAMS )
GETSPECIALFOLDER( CSIDL_COMMON_STARTMENU )
GETSPECIALFOLDER( CSIDL_PROFILE )
Code: Select all | Expand
/* ***************************************** */
// Pres del foro de FiveTechSoft el 20/11/2010.
#define CSIDL_PROGRAMS 0x0002 // Start Menu\Programs
#define CSIDL_DESKTOPDIRECTORY 0x0010 // <user name>\Desktop
#define CSIDL_COMMON_STARTMENU 0x0016 // <All Users>\Start Menu
#define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 // <All Users>\Desktop
#define CSIDL_PROFILE 0x0028 // C:\Documents and Settings\<user name>
#define CSIDL_PROGRAM_FILES 0x0026 // C:\Program Files
#define CSIDL_FAVORITES 0x0006 // "C:\Documents and Settings\User\Favorites"
#define CSIDL_COMMON_FAVORITES 0x001F // "C:\Documents and Settings\All Users\Favorites"
#define CSIDL_MYDOCUMENTS 0x000C // Virtual "C:\Documents and Settings\username\My Documents"
#define CSIDL_PERSONAL 0x0005 // "C:\Documents and Settings\user\My Documents"
Como ves la info está todo en este foro!!!!

Un Saludo
Carlos G.
FiveWin 24.02 + Harbour 3.2.0dev (r2403071241), BCC 7.7 Windows 10
Carlos G.
FiveWin 24.02 + Harbour 3.2.0dev (r2403071241), BCC 7.7 Windows 10
- MarioG
- Posts: 1380
- Joined: Fri Oct 14, 2005 1:28 pm
- Location: Resistencia - Chaco - AR
- Been thanked: 2 times
Re: Carpeta Escritorio en Windows
Muchas gracias!
Lo probaré
Lo probaré
Resistencia - "Ciudad de las Esculturas"
Chaco - Argentina
Chaco - Argentina