Hi
I think this is what you need.
Got if from the link provided by Paul Eggleton (thanks,filed for later ref).
See code on page 3.
Changed the first parameter (handle) to 0.
The article seems to say that there can be more than 1 
control in the cpl file and in that case you need to add a ,
and name after the .cpl file name. (eg main.cpl,mouse)
Seems to work ok.
Warren

uses ShellAPI;
procedure TForm1.Button1Click(Sender: TObject);
begin
 ShellExecute
    (0, PChar('open'),
    PChar('rundll32.exe'),
    PChar('shell32.dll,Control_RunDLL TimeDate.cpl'),
    nil, SW_NORMAL);
end;

-----Original Message-----
From: Trevor Jones [mailto:[EMAIL PROTECTED]
Sent: Friday, 5 December 2003 01:40 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: RE: [DUG] Running CPLs


Rohit,
  I think you have to execute either control.exe or cpanel.exe and pass the
name of the appliet as a parameter on the command line.

  I vaguely remember having something like
WinExec('control.exe','date/time');

HTH

Trevor

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]>
Sent: Friday, December 05, 2003 12:39 PM
Subject: Re: RE: [DUG] Running CPLs


> No it doesnt.  I have tried winexec and shellexecute.  The error ranges
from "File not found", "Do not know how to execute it", "file not an
executable 0 wrong format" and "no file association for cpl"
>
>
> >
> > From: Stephen Barker <[EMAIL PROTECTED]>
> > Date: 2003/12/05 Fri AM 10:27:34 GMT+13:00
> > To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>,
> >    "'NZ Borland Developers Group - Delphi List'" <[EMAIL PROTECTED]>
> > Subject: RE: [DUG] Running CPLs
> >
> > if you open timedate.cpl in explorer it works, so I assume you can also
do a
> >
> >
> > ShellExecute(handle,'open',...
> >
> > Steve
> >
> > > -----Original Message-----
> > > From: Rohit Gupta [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, 5 December 2003 11:04 a.m.
> > > To: NZ Borland Developers Group - Delphi List
> > > Subject: [DUG] Running CPLs
> > >
> > >
> > > I am converting over a dedicated DOS app to Windows.  The user
> > > is to have no access to any windows feature or appelets... hopefully
> > > we can achieve this.
> > >
> > > However we need a way to set time and date.  Rather than
> > > reinventing the wheel, is there any way I can run the WIndows
> > > appalet from Delphi ?
> > > Regards
> > >
> > > Rohit
> > >
> > > ====================================================
> > > ==================
> > > CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New
> > > Zealand
> > > PH    (649) 489-2280
> > > FX    (649) 489-2290
> > > email [EMAIL PROTECTED]  or  [EMAIL PROTECTED]
> > > ====================================================
> > > ==================
> > >
> > >
> > > _______________________________________________
> > > Delphi mailing list
> > > [EMAIL PROTECTED]
> > > http://ns3.123.co.nz/mailman/listinfo/delphi
> > >
> > > ---
> > > Incoming mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003
> > >
> > >
> > _______________________________________________
> > Delphi mailing list
> > [EMAIL PROTECTED]
> > http://ns3.123.co.nz/mailman/listinfo/delphi
> >
>
> _______________________________________________
> Delphi mailing list
> [EMAIL PROTECTED]
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
>


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared 
by MailMarshal
For more information please visit www.marshalsoftware.com
#####################################################################################
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to