Solved

Windows Info Component?

Posted on 2000-03-12
2
116 Views
Last Modified: 2010-04-04
Trying to use SHGetSpecialFolderLocation and have no clue as to how to use it, so I was wondering if anyone new of a (free) non-visual component that would have properties like "DesktopFolder" "FavoritesFolder" "PrintersFolder" ... you get the idea.

Does any such animal exist?

Thanks
James
0
Comment
Question by:shredman
2 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 25 total points
ID: 2610128
Hi
well i show how to use the SHGetSpecialFolderLocation function :

Var
  SFolder :  pItemIDList;
  SpecialPath : Array[0..MAX_PATH] Of Char;
begin
SHGetSpecialFolderLocation(Form1.Handle, CSIDL_STARTUP, SFolder);
SHGetPathFromIDList(SFolder, SpecialPath);
Label1.Caption := StrPas(SpecialPath);

Other folders :
CSIDL_BITBUCKET
CSIDL_CONTROLS
CSIDL_DESKTOP
CSIDL_DESKTOPDIRECTORY
CSIDL_DRIVES
CSIDL_FONTS
CSIDL_NETHOOD
CSIDL_NETWORK
CSIDL_PERSONAL
CSIDL_PRINTERS
CSIDL_PROGRAMS
CSIDL_RECENT
CSIDL_SENDTO
CSIDL_STARTMENU
CSIDL_STARTUP
CSIDL_TEMPLATES

also maybe want:

procedure TForm1.Button1Click(Sender: TObject);
var
lpBuffer: array[0..255] of char;
SysDir: string;
begin
GetWindowsDirectory(lpBuffer, 255);
SysDir := lpBuffer;
Label1.Caption := sysdir;
end;

{also:
GetSystemDirectory() function used same as above. }



0
 

Author Comment

by:shredman
ID: 2611120
Thanks for the insight on how to use this function. I'm not exactly sure why Delphi would require you to use pItemIDList and a character array when something such as a component or a more Delphi friendly function (i.e. one that uses strings), but nevertheless, thank you... the job is done.

James
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now