Special folders
Moderator: Rathinagiri
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Special folders
Hi
A little work to obtain paths of special folders of windows.
Thanks to inspiration by friend Dave
Happy HMG'ing
A little work to obtain paths of special folders of windows.
Thanks to inspiration by friend Dave
Happy HMG'ing
Viva INTERNATIONAL HMG
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Special folders
Hi Esgici.
Very good !!!
Regards,
Claudio.
Very good !!!
Regards,
Claudio.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: Special folders
Very nice amigo Esgici ! Thank for your sharing !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Special folders
Very useful Esgici.
I am very particular about the fonts folder for HMG_HPDF. Thanks.
I am very particular about the fonts folder for HMG_HPDF. Thanks.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Special folders
Hi
Found a more sophisticated and useful sample :
http://www.hexcentral.com/articles/foxpro-folders.htm
This is a foxpro function and seems could be adapt to Harbour.
But require a bit low-level expertness; because include something like shell32, ole32
I hope that my amigo Pablo Cesar could achieve this task.
TIA
Found a more sophisticated and useful sample :
http://www.hexcentral.com/articles/foxpro-folders.htm
This is a foxpro function and seems could be adapt to Harbour.
But require a bit low-level expertness; because include something like shell32, ole32
I hope that my amigo Pablo Cesar could achieve this task.
TIA
Viva INTERNATIONAL HMG
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Special folders
Hi Esgici.
I hope you find it useful.
GET_FOLDER_LINK (id_SHGFP_TYPE, id_CSIDL) ---> Return cFolder
Best regards,
Claudio.
I hope you find it useful.
GET_FOLDER_LINK (id_SHGFP_TYPE, id_CSIDL) ---> Return cFolder
Best regards,
Claudio.
Code: Select all
// (c) Dr. Claudio Soto, 6 Mayo 2010
// see CSIDL_XXX description in ---> http://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx
// define CSIDL_XXX in file ---> shlobj.h
//**********
// id_CSIDL
//**********
#define CSIDL_DESKTOP 0
#define CSIDL_INTERNET 1
#define CSIDL_PROGRAMS 2
#define CSIDL_CONTROLS 3
#define CSIDL_PRINTERS 4
#define CSIDL_PERSONAL 5
#define CSIDL_FAVORITES 6
#define CSIDL_STARTUP 7
#define CSIDL_RECENT 8
#define CSIDL_SENDTO 9
#define CSIDL_BITBUCKET 10
#define CSIDL_STARTMENU 11
#define CSIDL_MYMUSIC 13
#define CSIDL_MYVIDEO 14
#define CSIDL_DESKTOPDIRECTORY 16
#define CSIDL_DRIVES 17
#define CSIDL_NETWORK 18
#define CSIDL_NETHOOD 19
#define CSIDL_FONTS 20
#define CSIDL_TEMPLATES 21
#define CSIDL_COMMON_STARTMENU 22
#define CSIDL_COMMON_PROGRAMS 23
#define CSIDL_COMMON_STARTUP 24
#define CSIDL_COMMON_DESKTOPDIRECTORY 25
#define CSIDL_APPDATA 26
#define CSIDL_PRINTHOOD 27
#define CSIDL_LOCAL_APPDATA 28
#define CSIDL_ALTSTARTUP 29
#define CSIDL_COMMON_ALTSTARTUP 30
#define CSIDL_COMMON_FAVORITES 31
#define CSIDL_INTERNET_CACHE 32
#define CSIDL_COOKIES 33
#define CSIDL_HISTORY 34
#define CSIDL_COMMON_APPDATA 35
#define CSIDL_WINDOWS 36
#define CSIDL_SYSTEM 37
#define CSIDL_PROGRAM_FILES 38
#define CSIDL_MYPICTURES 39
#define CSIDL_PROFILE 40
#define CSIDL_SYSTEMX86 41
#define CSIDL_PROGRAM_FILESX86 42
#define CSIDL_PROGRAM_FILES_COMMON 43
#define CSIDL_PROGRAM_FILES_COMMONX86 44
#define CSIDL_COMMON_TEMPLATES 45
#define CSIDL_COMMON_DOCUMENTS 46
#define CSIDL_COMMON_ADMINTOOLS 47
#define CSIDL_ADMINTOOLS 48
#define CSIDL_CONNECTIONS 49
#define CSIDL_COMMON_MUSIC 53
#define CSIDL_COMMON_PICTURES 54
#define CSIDL_COMMON_VIDEO 55
#define CSIDL_RESOURCES 56
#define CSIDL_RESOURCES_LOCALIZED 57
#define CSIDL_COMMON_OEM_LINKS 58
#define CSIDL_CDBURN_AREA 59
#define CSIDL_COMPUTERSNEARME 61
#define CSIDL_FLAG_DONT_VERIFY 16384 // 0x4000
#define CSIDL_FLAG_CREATE 32768 // 0x8000
#define CSIDL_FLAG_MASK 65280 // 0xFF00
//***************
// id_SHGFP_TYPE
//***************
#define SHGFP_TYPE_CURRENT 0 // Retrieve the folder's current path.
#define SHGFP_TYPE_DEFAULT 1 // Retrieve the folder's default path.
// If the folder has not been redirected, then SHGFP_TYPE_DEFAULT and SHGFP_TYPE_CURRENT retrieve the same path.
#include "hmg.ch"
Function Main
MsgInfo (GET_FOLDER_LINK (SHGFP_TYPE_CURRENT, CSIDL_FAVORITES))
Return Nil
#pragma begindump
#include <windows.h>
#include <shlobj.h>
#include "hbapi.h"
//************************************************************************************************************
// GET_FOLDER_LINK (id_SHGFP_TYPE, id_CSIDL) ---> Return cFolder
//************************************************************************************************************
HB_FUNC (GET_FOLDER_LINK)
{
TCHAR pszPath [MAX_PATH];
DWORD id_SHGFP_TYPE = (DWORD) hb_parnl (1);
INT id_CSIDL = (INT) hb_parnl (2);
if(SUCCEEDED (SHGetFolderPath (NULL, id_CSIDL, NULL, id_SHGFP_TYPE, pszPath)))
hb_retc (pszPath);
else
hb_retc ("ERROR: The folder does not exist");
}
#pragma enddump
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Special folders
Hi Esgici.
See application of the GET_FOLDER_LINK function in viewtopic.php?p=10535#p10535
Search recent open projects of the HMG.
Regards,
Claudio.
See application of the GET_FOLDER_LINK function in viewtopic.php?p=10535#p10535
Search recent open projects of the HMG.
Regards,
Claudio.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Special folders
Hola Dr.
Thanks
You are a real treasure
Are you sure that you are programming only as hobby
Saludos and gracias cordiales
Thanks
You are a real treasure
Are you sure that you are programming only as hobby
Saludos and gracias cordiales
Viva INTERNATIONAL HMG
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Special folders
Hi Brother Esgici.
(*) I did my first virus (memory-resident Trojan in C) when he was 16 years old, all I did was clear the screen every 5 seconds and display the message: "This computer is with diarrhea", was very fun to see the cries of my friends... "teacher, teacher, teacher, the computer is with diarrhea?" and the professor responded: "computer with diarrhea? you all are crazy !!!"
Best Regards,
Claudio.
Thank you very much, you are very kind.esgici wrote:You are a real treasure
Yes, I'm only programming by hobby and fun (*)esgici wrote:Are you sure that you are programming only as hobby
(*) I did my first virus (memory-resident Trojan in C) when he was 16 years old, all I did was clear the screen every 5 seconds and display the message: "This computer is with diarrhea", was very fun to see the cries of my friends... "teacher, teacher, teacher, the computer is with diarrhea?" and the professor responded: "computer with diarrhea? you all are crazy !!!"
Best Regards,
Claudio.