DelphiFAQ Home Search:

Start an applet from the control panel (Display properties..)

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Are you looking for a way to start Control Panel applets from your application without
opening the Control Panel? For example to let the user set display properties or
the time/ date?

Look in your \Windows\System (NT: \System32) directory to find out the names of the
applet - each applet corresponds to a .CPL file which is practically a DLL.

The function StartApplet() in the following code starts a given applet; the sample brings
up the "Display Properties" dialog:

Program AppletDemo;

Uses
  SysUtils, Windows;

function StartApplet(app : String): integer;
var
  cCmd : array [0..1023] of char;
begin
  StrPCopy (cCmd, 'rundll32.exe shell32.dll,Control_RunDLL ' + app);
  Result := WinExec (cCmd, SW_SHOWNORMAL);
end;

begin
  StartApplet ('desk.cpl');
end.

Comments:

2006-01-07, 16:36:35
anonymous from Germany  
cd \Windows\System32
2007-01-29, 19:34:30
anonymous from United States  
This was very helpful, thanks.

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: