Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
Exchange Links About this site Links to us 
|
General :: Windows :: Programming :: Windows with Delphi :: Windows Filesystem
File related questions and answers. File operations, attributes, system dialogs, hard disk handling.
Articles:
This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Only the 40 most recently viewed articles are shown. You can see the full list here.
Featured Article
Check whether a user has a shortcut installed
The following routine checks whether a shortcut or a file with a given
name is either on the desktop, in the start menu or in its programs submenu.
It will both check in the user's private desktop/ start menu.. as in
the all-users settings.
The return value shows where the first installation was found,
it may be used as in .FormCreate() at the bottom of the example.
Because shortcuts are just files, it is not case-sensitive.
LinkExists ('SourceCoder') = LinkExists ('sourcecoder')
 | |  | | uses
Registry;
type
TInstallationPlace = (le_None, le_CommonDesktop, le_CommonProgs, le_CommonStart,
le_UserDesktop, le_UserProgs, le_UserStart);
function LinkExists (const s : String) : TInstallationPlace;
var
cDesktop,
cProgs,
cStart,
uDesktop,
uProgs,
uStart : String;
function myExists(const s : String): boolean;
begin
myExists := FileGetAttr(s) >= 0;
end;
begin
cDesktop := '';
cProgs := '';
cStart := '';
uDesktop := '';
uProgs := '';
uStart := '';
with TRegistry.Create do
begin
RootKey:=HKEY_LOCAL_MACHINE;
if OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', false) then
begin
cDesktop := ReadString('Common Desktop');
cProgs := ReadString('Common Programs');
cStart := ReadString('Common Start Menu');
end;
CloseKey;
RootKey:=HKEY_CURRENT_USER;
if OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', false) then
begin
uDesktop := ReadString('Desktop');
uProgs := ReadString('Programs');
uStart := ReadString('Start Menu');
end;
CloseKey;
Free;
end;
Result := le_None;
s := '\' + s;
if myExists(cDesktop + s) then Result := le_CommonDesktop
else
if myExists(cProgs + s) then Result := le_CommonProgs
else
if myExists(cStart + s) then Result := le_CommonStart
else
if myExists(cDesktop + ChangeFileExt(s, '.lnk')) then Result := le_CommonDesktop
else
if myExists(cProgs + ChangeFileExt(s, '.lnk')) then Result := le_CommonProgs
else
if myExists(cStart + ChangeFileExt(s, '.lnk')) then Result := le_CommonStart
else
if myExists(uDesktop + s) then Result := le_UserDesktop
else
if myExists(uProgs + s) then Result := le_UserProgs
else
if myExists(uStart + s) then Result := le_UserStart
else
if myExists(uDesktop + ChangeFileExt(s, '.lnk')) then Result := le_UserDesktop
else
if myExists(uProgs + ChangeFileExt(s, '.lnk')) then Result := le_UserProgs
else
if myExists(uStart + ChangeFileExt(s, '.lnk')) then Result := le_UserStart
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if LinkExists ('SourceCoder') <> le_None then
ShowMessage('yes')
else
ShowMessage('no');
end;
| |  | |  |
|
| Most recent comments
2010-03-21 15:16:10:
by anonymous
in Dating Scams
on Scammer Victoria from Ghana:
The girl above here is also named as Baah Becky of Accra Ghana !
Beware of she but still I like her, she looking good !
|
2010-03-21 15:15:31:
by anonymous
in Dating Scams
on Is this Russian girl scamming me? How to recognize scammers:
On the last girl, mention that her nose is not going straight down, since it is quite commond haircoloure over hole old USSR
So best way to recognise is to nook at her nose, if it is not straight ... read more
|
2010-03-21 15:09:50:
by anonymous
in Dating Scams
on Dating scammer Esther Ansomaa from Accra, Ghana:
The girl above named Hawa Labaran, I got some email- letters from she, now under the name of Baah Becky of Accra , Ghana,
She had 3.7 million USD in a security company , and ask me if i would help ... read more
|
2010-03-21 15:02:44:
by anonymous
in Dating Scams
on Dating scammer Agne Zubrauskaite:
A famouse Lithuaian girl have scammed same norwegain pensionist 2 times. This is one of the real one-girl-scammers (no liga, but one girl that work alone). She have changed name while she scammed.
< ... read more
|
2010-03-21 14:55:59:
by anonymous
in Dating Scams
on Dating scammer Olga:
this girl us also the name of viktoriya she life in sint petersburg
|
2010-03-21 14:50:46:
by anonymous
in Dating Scams
on Dating scammer Olga:
Hi Dirk!
I can see on the link you gave you gets to spanish girls, that might be for real.
It is some russians in Spain, since it is possible to get easy visa there, spescially if they can str ... read more
|
2010-03-21 14:06:00:
by anonymous
in about DelphiFAQ
on How to submit a new scammer profile:
Met on Single Site. Alias Joel Daniels. I met him as George Carsey, widower, 1 son, Paul age 12, contractor, builder of roads/bridges. 2 Months back and forth with email, cell phone calls, telephone c ... read more
|
2010-03-21 13:23:42:
by Soes
in Male Dating Scammers
on Dating scammer Mark Philips:
This is the latest mail I got from the Diamond Agent....
I'm very sorry for the delay in replying you,I have been quite busy for sometime working on a contract,thats why i delay in replying y ... read more
|
2010-03-21 13:11:37:
by [hidden]
in Dating Scams
on Dating scammer Osei Kwesi Accra Ghana kind_osei@hotmail.com from Accra, Ghana:
Does anyone know this little lady ?She is on seniorpeoplemeet.com ..handle is TRUELOVE96 ,she says she is from Miami,Fl.I think,she is a scammer.
|
2010-03-21 13:08:59:
by [hidden]
in Other Scams
on Dating scammer Rose Kimberly in Africa:
don't trust a girl named illona rick to ripped my son of for more than £1000.00
|
| |