الأستعراض بحثاً عن مجلد
#1
كود :
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_STARTMENU,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;
الرد
#2
PHP كود :
string folder;
    
//------------------------------------------------------------------------------
    
CSIDL_ALTSTARTUP
    CSIDL_APPDATA
    CSIDL_BITBUCKET
    CSIDL_COMMON_ALTSTARTUP
    CSIDL_COMMON_DESKTOPDIRECTORY
    CSIDL_COMMON_FAVORITES
    CSIDL_COMMON_PROGRAMS
    CSIDL_COMMON_STARTMENU
    CSIDL_COMMON_STARTUP
    CSIDL_CONTROLS
    CSIDL_COOKIES
    CSIDL_DESKTOP
    CSIDL_DESKTOPDIRECTORY
    CSIDL_DRIVES
    CSIDL_FAVORITES
    CSIDL_FONTS
    CSIDL_HISTORY
    CSIDL_INTERNET
    CSIDL_INTERNET_CACHE
    CSIDL_NETHOOD
    CSIDL_NETWORK
    CSIDL_PERSONAL
    CSIDL_PRINTERS
    CSIDL_PRINTHOOD
    CSIDL_PROGRAMS
    CSIDL_RECENT
    CSIDL_SENDTO
    CSIDL_STARTMENU
    CSIDL_STARTUP
    CSIDL_TEMPLATES 

كود :
exemple: procedure TForm1.Button2Click(Sender: TObject); var PIDL: PItemIDList; Path: array[0..MAX_PATH] of Char; begin SHGetSpecialFolderLocation(Handle, CSIDL_PROGRAMS, PIDL); SHGetPathFromIDList(PIDL, Path); ShowMessage(Path); end;
الرد


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم