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
How to Use Stored Procedures ?
How to create an icon from a bitmap?
How to capture an image from a video source?
How to Set break on exception in Delphi 4?
How to avoid "Random" Exceptions being raised when using TJPEGImage or the JPEG unit?
Explain the MasterSource/MasterFields behavior?
How to activate different hints for each cell in a grid?
How to Change the root key ?
How to Convert Data in Paradox Tables to InterBase Using Delphi?
How to Loada local html file in the HTML control ?
what are Safe Mode and VGA mode?
How to Create resource files?
How to eject a CD-ROM in code?
How to Declare a SafeArray in the type library editor?
How to Change the port of a printer?