Вам задачу ещё реализовывать надо? и я надеюсь Вы #include подключали?
//---------------------------------------------------------------------------
#define NO_WIN32_LEAN_AND_MEAN
#include
#include
#include
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
BROWSEINFO info;
char szDir[MAX_PATH];
char szDisplayName[MAX_PATH];
LPITEMIDLIST pidl;
LPMALLOC pShellMalloc;
if(SHGetMalloc(&pShellMalloc) == NO_ERROR)
{
memset(&info, 0x00,sizeof(info));
//info.hwndOwner = Handle;
info.pidlRoot = 0;
info.pszDisplayName = szDisplayName;
info.lpszTitle = "Browse Title";
info.ulFlags = BIF_BROWSEFORCOMPUTER;
info.lpfn = 0;
pidl = SHBrowseForFolder(&info);
if(pidl)
{
if(SHGetPathFromIDList(pidl, szDir))
{
Label1->Caption = szDir;
}
Label2->Caption = info.pszDisplayName;
pShellMalloc->Free(pidl);
}
pShellMalloc->Release();
}
}
//---------------------------------------------------------------------------