How to invoke the Windows ShortCut Dialog wizard?
Answer Posted / editcdc
function InvokeShortCutDialog(Directory : string) : boolean;
var
Reg : TRegistry;
CmdLine : string;
begin
Result := false;
Reg := TRegistry.Create;
try
Reg.Rootkey := HKEY_CLASSES_ROOT;
if Reg.OpenKeyReadOnly('.LNKShellNew') then
begin
CmdLine := Reg.ReadString('Command');
CmdLine := StringReplace(CmdLine, '%1', Directory, []);
Result := True;
WinExec(PChar(CmdLine), SW_SHOWNORMAL );
end
finally
Reg.free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
InvokeShortCutDialog('c:Temp');
end;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is Turbo Pascal still available?
How to Select an item in a TListView when the checkbox is checked ?
How does one change the default directory that Delphi uses to save projects?
How to detect the CPU type of the computer the application is running on?
How to Handle exceptions in Delphi?
What are the Benefits of the ConstraintBroker?
How to pass functions or procedures to other functions or procedures?
What if I do not have a CD-ROM drive?
Does Delphi have an equivalent to the Visual Basic SendKeys function?
How to Add hint windows to applications?
How to Clear the window in a console application?
How to custom draw menu items?
How to use sets in code, such as adding to TDBGrid.Options, at run time?
How to Change the port of a printer?
Do I have to understand object-oriented programming to use Delphi?