Article View: borland.public.cppbuilder.nativeapi
Article #15858Re: Screen Saver!
From: user
Date: Tue, 10 Jun 2003 11:51
Date: Tue, 10 Jun 2003 11:51
53 lines
3078 bytes
3078 bytes
Safari wrote:
> Thanks user@domain.invalid :-)
> Not worked!
>
> Safari
>
> <user@domain.invalid> wrote in message
> news:3EE3C493.8030904@domain.invalid...
> | Safari wrote:
> | > How can i call Screen Saver Setting?
> | >
> |
> | Launch a screen saver file as if it were an executable (it is one) with
> | this command line switch, /C, to have it display its Settings dialog.
>
>
>
Your sample code executes RunDLL32.exe to run the Control Panel
Desktop applet to install a screen saver, but you sound like you want
to either *start* the screen saver or to *configure* it. If that's the
case, you need to launch the screen saver itself, not RunDLL32.exe.
I couldn't get ShellExecute to pay any attention to the switch, so I did
this instead. This code starts the screen saver; Use "/c" instead of
"/s" in the CommandLine string to show the configuration dialog.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
LPTSTR CommandLine = "C:\\WINNT\\SYSTEM32\\ssbezier.scr /s";
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset( &si, 0, sizeof(si) );
si.cb = sizeof(si);
memset( &pi, 0, sizeof(pi) );
// Start the child process.
if( !CreateProcess( NULL, // No module name (use command line).
CommandLine, // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
{
MessageBox( NULL, "CreateProcess failed.", NULL, MB_OK );
}
}
Technical Details
Message-ID:
<3EE5C64C.7010201@domain.invalid>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!wn14feed!wn13feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3ee3bf50@newsgroups.borland.com> <3EE3C493.8030904@domain.invalid> <3ee51592@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,aeab6fd0c8a4fd7 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-06-10 04:57:33 PST Message-ID: <3EE5C64C.7010201@domain.invalid> Date: Tue, 10 Jun 2003 07:51:40 -0400 From: user@domain.invalid User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Screen Saver! References: <3ee3bf50@newsgroups.borland.com> <3EE3C493.8030904@domain.invalid> <3ee51592@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 68.162.138.29 X-Trace: newsgroups.borland.com 1055245925 68.162.138.29 (10 Jun 2003 04:52:05 -0700) Lines: 54 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!wn14feed!wn13feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail