Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Jul : ShellExecute sloooooooooow

www.cryer.info
Managed Newsgroup Archive

ShellExecute sloooooooooow

Subject:ShellExecute sloooooooooow
Posted by:"Ben Hochstrasser" (bh..@tiscali123^h^h^h.ch)
Date:Sat, 2 Jul 2005 00:33:58

I have created a very simple application spawner (background: applications
that reside on a network drive but have a shortcut on the user's desktop
sometimes fail to display the proper icon) that simply takes a .lnk file
(ie a desktop shortcut) or an UNC path as the parameter:

program Launcher;

uses
  Windows,
  ShellAPI;

{$R *.RES}

begin
  if ParamCount <> 0 then
    ShellExecute(GetDesktopWindow, 'open', PChar(ParamStr(1)), nil, nil,
                         SW_SHOWNORMAL)
  else
    MessageBox(GetDesktopWindow, 'Please supply a command line',
             'Nothing To Do', MB_OK or MB_ICONSTOP or MB_SETFOREGROUND);
end.

The good news: it works.

The bad news: it takes about 15 seconds to start the [remote] application.
Starting the [still remote] application directly (ie via its desktop
shortcut) takes only one or two seconds.

Locally installed applications behave the same whether started via the
launcher or run directly.

What may be happening behind the scenes? Any ideas?

--
Ben

Replies:

www.cryer.info
Managed Newsgroup Archive