issamdnn
06-12-2009, 09:34 AM
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,shellapi, StdCtrls, ActiveX, ComObj, CommCtrl, FileCtrl,ToolWin, ShlObj;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
g_pMalloc:^IMalloc;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
bi:BROWSEINFO;
lpbuffer:PChar;
pidlprograms:pITEMIDLIST; //pidl for programs folder
pidlBrouse:pITEMIDLIST; //pidl selected by user
begin
GetMem(lpbuffer,500);
//lpbuffer:=pchar(g_pMalloc^.alloc(MAX_PATH));
// get pidl for the program folder
SHGetSpecialFolderLocation(Handle,CSIDL_COMMON_STA RTMENU,pidlprograms) ;
bi.hwndOwner:= Handle ;
bi.ulFlags:= 0 ;
bi.pidlRoot:=pidlprograms;
bi.pszDisplayName:=lpbuffer;
bi.lpszTitle:='الرجاء البحث عن المجلد المطلوب هنا من برمجة المهندس عصام المبسبس';
bi.lpfn:=nil;
bi.lParam:=0;
//pidlBrouse:=
pidlBrouse:=SHBrowseForFolder(bi);
//Label1.Caption:=FormatCurr('', pidlBrouse.mkid.cb );
SHGetPathFromIDList(pidlBrouse,lpbuffer);
Label1.Caption:=lpbuffer;
end;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,shellapi, StdCtrls, ActiveX, ComObj, CommCtrl, FileCtrl,ToolWin, ShlObj;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
g_pMalloc:^IMalloc;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
bi:BROWSEINFO;
lpbuffer:PChar;
pidlprograms:pITEMIDLIST; //pidl for programs folder
pidlBrouse:pITEMIDLIST; //pidl selected by user
begin
GetMem(lpbuffer,500);
//lpbuffer:=pchar(g_pMalloc^.alloc(MAX_PATH));
// get pidl for the program folder
SHGetSpecialFolderLocation(Handle,CSIDL_COMMON_STA RTMENU,pidlprograms) ;
bi.hwndOwner:= Handle ;
bi.ulFlags:= 0 ;
bi.pidlRoot:=pidlprograms;
bi.pszDisplayName:=lpbuffer;
bi.lpszTitle:='الرجاء البحث عن المجلد المطلوب هنا من برمجة المهندس عصام المبسبس';
bi.lpfn:=nil;
bi.lParam:=0;
//pidlBrouse:=
pidlBrouse:=SHBrowseForFolder(bi);
//Label1.Caption:=FormatCurr('', pidlBrouse.mkid.cb );
SHGetPathFromIDList(pidlBrouse,lpbuffer);
Label1.Caption:=lpbuffer;
end;