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 detect the CPU type of the computer the application is running on?
what are the uses of Arrow and Function Keys ?
How to launch a control panel applet?
How to Use JPEGs from resource files ?
what are the common Problems with printing, preview and paper size in Quick Reports?
Explain about Multi-Threaded ISAPI DLLs ?
How to Set a transparent background color for TImageList?
what is the use of TSocketDispatcher?
How to Display a bitmap on the client area of an MDI parent form?
What is the difference between Delphi and Delphi Client/Server?
Do I have to know a lot about the Windows API to use Delphi?
How to create a Resource only DLL?
How to Display a file's associated icon?
How to Move the application server to another machine?
How to Link an animated cursor to a resource file?