Involking the create new shortcutdialog
Posted on 2007-10-12
This code I found at borland after I followed a link from a topic here about invoking the new shortcut dialog >
function InvokeShortCutDialog(Directory : string) : boolean;
Reg : TRegistry;
CmdLine : string;
Result := false;
Reg := TRegistry.Create;
Reg.Rootkey := HKEY_CLASSES_ROOT;
if Reg.OpenKeyReadOnly('.LNKShellNew') then
CmdLine := Reg.ReadString('Command');
CmdLine := StringReplace(CmdLine, '%1', Directory, );
Result := True;
WinExec(PChar(CmdLine), SW_SHOWNORMAL );
procedure TForm1.Button1Click(Sender: TObject);
I can't get this to work however. This is supposed to work on windows 2000, I have xp sp2...should that be the problem?
Furthermore I found these pieces of code (traced back into sites reading right to left stead of left to right > this made it oh so difficult to get the right one I guess)
ShellExecute(0,'open','rundll','appwiz.cpl,NewLinkHere %1', 'c:\', SW_SHOWNORMAL);
This doesn't work either...why not?
WinExec('rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3, '', SW_NORMAL);
Values of '','0', '1', '2', '3' pop up either the installed software list or the add software or remove software list.....how do I get my hands on the new shortcut dialog?