Sayfayı Yazdır | Pencereyi Kapat

Masaüstü Yolu!

Nereden Yazdırıldığı: Datakent
Kategori: Diğer bölümler
Forum Adı: Borland Delphi
Forum Tanımlaması: Borland Delphi ile ilgili soru / sorun / paylaşım bölümü
URL: http://forum.datakent.com/forum_posts.asp?TID=1670
Tarih: 27.Nisan.2024 Saat 21:28


Konu: Masaüstü Yolu!
Mesajı Yazan: Deadly_scorpion
Konu: Masaüstü Yolu!
Mesaj Tarihi: 22.Ocak.2009 Saat 22:25

{uses
ActiveX,ShlObj}

 

unit Unit1;
interface
uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,ShlObj, ActiveX;
function GetSystemPath(Folder: Integer): string;

implementation
function GetSystemPath(Folder: Integer): string;
var
PIDL: PItemIDList;
  Path: LPSTR;
AMalloc: IMalloc;
begin
Path := StrAlloc(MAX_PATH);
  SHGetSpecialFolderLocation(Application.Handle, Folder, PIDL);
  if SHGetPathFromIDList(PIDL, Path) then
    Result := Path;
  SHGetMalloc(AMalloc);
  AMalloc.Free(PIDL);
  StrDispose(Path);
end;
end.


{Kullanım}

var
yol:string;
begin
yol:=GetSystemPath(CSIDL_DESKTOP);
showmessage(yol);

 
Derlenmiş örnek için  http://rapidshare.com/files/187845104/Masauestue_Yolu.rar.html - tıklayınız


-------------
Belki bir parça tuhafım...



Sayfayı Yazdır | Pencereyi Kapat