Solved

Windows Info Component?

Posted on 2000-03-12
2
124 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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