delphi4ever
01-04-2008, 09:42 PM
السلام عليكم ورحمة الله
يمكننا أن نتعرف برمجيا عن مسار المجلد MyDocuments أي في أي جزء من القرص الصلب موجود بالضبط مع مساره الكامل،
في الأول نضيف ShlObj إلى قائمة Uses ثم نكتب ما يلي:
function GetMyDocuments: string;
var
r: Bool;
path: array[0..Max_Path] of Char;
begin
r := ShGetSpecialFolderPath(0, path, CSIDL_Personal, False) ;
if not r then raise Exception.Create('Could not find MyDocuments folder location.') ;
Result := Path;
end;
ثم نقوم بالضغط مرتين على Form ونكتب الكود التالي:
var
myDocFolder : string;
begin
myDocFolder := GetMyDocuments;
label2.caption:=(Format(' "%s"',[myDocFolder])) ;
Label2 هنا تعني لنا المكون الذي سيظهر لنا فيه مسار MyDocuments .
وللمزيد من المعلومات حمل السورس في المرفقات
يمكننا أن نتعرف برمجيا عن مسار المجلد MyDocuments أي في أي جزء من القرص الصلب موجود بالضبط مع مساره الكامل،
في الأول نضيف ShlObj إلى قائمة Uses ثم نكتب ما يلي:
function GetMyDocuments: string;
var
r: Bool;
path: array[0..Max_Path] of Char;
begin
r := ShGetSpecialFolderPath(0, path, CSIDL_Personal, False) ;
if not r then raise Exception.Create('Could not find MyDocuments folder location.') ;
Result := Path;
end;
ثم نقوم بالضغط مرتين على Form ونكتب الكود التالي:
var
myDocFolder : string;
begin
myDocFolder := GetMyDocuments;
label2.caption:=(Format(' "%s"',[myDocFolder])) ;
Label2 هنا تعني لنا المكون الذي سيظهر لنا فيه مسار MyDocuments .
وللمزيد من المعلومات حمل السورس في المرفقات