Solved

Create a Shortcut

Posted on 2004-10-10
6
449 Views
Last Modified: 2010-04-05
hi, I need to know how 2 create a shortcut with all the fields.

Name: name the link
Target: direct 2 the file
Start in: the folder that the link should start in
shortcut key: quick shortcut key
Run: how will the program startup. normal max, min..
Comment: this is a brief description of the link
Command: this goes after the target file.

can anyone do this? its urgent, 500pts up for grabs, maybe 1000pts if u get it 2 me within 1-2hrs

Sal.
0
Comment
Question by:SaLz
[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
6 Comments
 
LVL 7

Assisted Solution

by:sftweng
sftweng earned 100 total points
ID: 12271000
0
 
LVL 6

Assisted Solution

by:Amir Azhdari
Amir Azhdari earned 300 total points
ID: 12271041
procedure CreateShortcut(FileName: string; MenuFolder: string);
var
 AnObj: IUnknown;
 ShLink: IShellLink;
 PFile: IPersistFile;
 WFileName: WideString;
begin
 AnObj := CreateComObject(CLSID_ShellLink);
 ShLink := AnObj as IShellLink;
 PFile := AnObj as IPersistFile;
//Shelllink target
 ShLink.SetPath(PChar( FileName));
//ShowCommand
ShLink.SetShowCmd(SW_SHOWNORMAL);

//Working Dir
WorkingDirectory := ExtractFilePath( ProgramFile );
ShLink.SetWorkingDirectory(PChar( WorkingDirectory ));
// Save
 WFileName := MenuFolder+'\'+ChangeFileExt(extractFileName(LinkFile),'.lnk');
 PFile.Save(PWChar(WFileName), False);
end;
-----------
MenuFolder - must be set to full path to the new created program group folder!!!
0
 
LVL 6

Assisted Solution

by:Amir Azhdari
Amir Azhdari earned 300 total points
ID: 12271105
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Assisted Solution

by:Amir Azhdari
Amir Azhdari earned 300 total points
ID: 12271118
0
 
LVL 11

Accepted Solution

by:
calinutz earned 100 total points
ID: 12274112
procedure CreateShortCut(ShortCut, Application, Parameters, WorkDir:
string; SW_State: Integer; IconFile: string; IconIndex: Byte);
var
  SCObject: IUnknown;
  SCSLink: IShellLink;
  SCPFile: IPersistFile;
  WFName: WideString;
begin
  SCObject := CreateComObject(CLSID_ShellLink);
  SCSLink := SCObject as IShellLink;
  SCPFile := SCObject as IPersistFile;
  SCSLink.SetPath(PChar(Application));
  SCSLink.SetArguments(PChar(Parameters));
  SCSLink.SetWorkingDirectory(PChar(WorkDir));
  SCSLink.SetShowCmd(SW_State);
  SCSLink.SetIconLocation(PChar(IconFile), IconIndex);
  WFName := ShortCut;
  SCPFile.Save(PWChar(WFName), False);
end;


For example:

CreateShortCut(ShortCut, Application, Parameters, WorkDir: string; SW_State: Integer; IconFile: string; IconIndex: Byte);
0
 
LVL 2

Author Comment

by:SaLz
ID: 12348157
ooops, sorry forgot about the points u all get them.

thxs
Sal.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create Database on Android via Delphi dbExpress 3 140
oracle global variables 4 80
firemonkey Android Listview Sort items 7 97
Can Live bindings change TGrid Cell Colour ? 1 59
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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