Recent

Author Topic: ShellExecute (Win32)  (Read 5295 times)

RadSurfer

  • Newbie
  • Posts: 4
ShellExecute (Win32)
« on: March 07, 2005, 01:39:56 pm »
Can someone please explain why the following code does not work.
If this were done under C++ it would cause either the Dial Up Adapter
dialog box to dial onto my ISP to appear,  
or if already online,  would display the current status (online time) of
the Dialup Adapter.

But under Lazarus this just produces an hourglass for an instant, then
disappears, and nothing happens!  It is not crashing...

uses
  Windows,
  Classes, SysUtils, LResources, Forms, Controls,
  Graphics, Dialogs, Buttons;

procedure TForm1.Button1Click(Sender: TObject);
(* Launch Dialup Adapter *)
begin
  ShellExecute(Form1.Handle,'open','rundll32','rnaui.dll,RnaDial MyIsp',nil,SW_SHOWNORMAL);
end;

Where: 'MyIsp' must be the same name as selected for your particular
     Dialup-Adapter

I can be reached via:
GAIM / AIM 'SirSkeptic'
Email: RadSurfer at yahoo.com

Thanks!

 

TinyPortal © 2005-2018