Solved

Windows Info Component?

Posted on 2000-03-12
2
117 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sending Gmail through Delphi 3 91
proper way to parse text with delphi 7 101
Connection between libmysql.dll and MySQL Versions 7 87
Delphi inherited method 6 63
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

18 Experts available now in Live!

Get 1:1 Help Now