Solved

Create a Shortcut

Posted on 2004-10-10
6
423 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
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

12 Experts available now in Live!

Get 1:1 Help Now