How to invoke the Windows ShortCut Dialog wizard?
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 |
How to determine the names of the installed comm ports?
How to Modify application server SQL from the client?
what are Multiple Transports?
How to Disable ALT-F4 to prevent form closing
How to Access HKEY_LOCAL_MACHINE under NT without Admin?
why we should use main in C
How to Change the display mode settings in code?
What are the different ways of defining array sizes?
How to avoid "Random" Exceptions being raised when using TJPEGImage or the JPEG unit?
How to Place a grid in edit mode programatically?
How to Disable Full Window Drag?
How to Determine if an object supports a property?