Re: Get My Documents folder and Win Systems 9x....
- From: "Ingolf" <Dont_Spam_ingolf@xxxxxxxxxx>
- Date: Mon, 18 Jul 2005 19:10:43 +0200
"Rob Kennedy" <me3@xxxxxxxxxxx> wrote in message
news:3k0u2pFrqs7sU1@xxxxxxxxxxxxxxxxx
> didi wrote:
>> Hi, if someone need the function below it can freely use it..
>
> Please don't.
>
> Here's why.
>
> http://blogs.msdn.com/oldnewthing/archive/2003/11/03/55532.aspx
>
Thanks for the warning!
I have an old function to look up a foldername on the system:
--
function BrowseFolder(aRoot: integer; aCaption,Idir :string): string;
{
System browse for folder
------------------------
0 = All
1 = Internet explorer
2 = Programs
3 = Control panel
4 = Printers
5 = Mydocuments
6 = Favourites
7 = programs\Startup folder
8 = Recent files
9 = Sendto
10=Recycle bin
11=Start menu
}
var
pPrograms,pBrowse: PItemIDList;
hBrowseInfo: TBROWSEINFO;
hPChar: PChar;
begin
if (not SUCCEEDED(SHGetSpecialFolderLocation(Getactivewindow, aRoot,
pPrograms))) then
EXIT;
hPChar := StrAlloc(max_path);
with hBrowseInfo do
begin
hwndOwner := Getactivewindow;
pidlRoot := pPrograms;
pszDisplayName := hPChar;
lpszTitle := pChar(aCaption);
ulFlags := BIF_RETURNONLYFSDIRS;
lpfn := nil;
lParam := 0;
end;
pBrowse := SHBrowseForFolder(hBrowseInfo);
if (pBrowse <> nil) then
if (SHGetPathFromIDList(pBrowse, hPChar)) then Result:= hPChar else
Result:='';
StrDispose(hPChar);
end;
--
I wonder if SHBrowseForFolder will work correctly then. Or is there a better
way to look up a folder?
.
- Follow-Ups:
- Re: Get My Documents folder and Win Systems 9x....
- From: Rob Kennedy
- Re: Get My Documents folder and Win Systems 9x....
- References:
- Get My Documents folder and Win Systems 9x....
- From: didi
- Re: Get My Documents folder and Win Systems 9x....
- From: Rob Kennedy
- Get My Documents folder and Win Systems 9x....
- Prev by Date: Re: making a form transparent
- Next by Date: Re: making a form transparent
- Previous by thread: Re: Get My Documents folder and Win Systems 9x....
- Next by thread: Re: Get My Documents folder and Win Systems 9x....
- Index(es):
Relevant Pages
|