🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15882

Re: Screen Saver!

#15882
From: Safari
Date: Wed, 11 Jun 2003 00:58
53 lines
3206 bytes
Okkkkkkkkkkkkkkeeeeeeeeeeeeey :-)
Very very thanks,

char SysDir[MAX_PATH];
GetSystemDirectory(SysDir, sizeof(SysDir));
AnsiString FileName = IncludeTrailingBaclslash(SysDir) + "FileName.scr /s";
LPTSTR CommandLine = FileName.c_str();

// LPTSTR CommandLine = "C:\\WINNT\\SYSTEM32\\ssbezier.scr /s";
// My Path is: "D:\\WinNT\\System32\\FileName.scr"

Any difficult?
Safari

<user@domain.invalid> wrote in message
news:3EE5C64C.7010201@domain.invalid...
|
| 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: <3ee7951a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!easynet-quince!easynet.net!peer01.cox.net!cox.net!small1.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
References: <3ee3bf50@newsgroups.borland.com> <3EE3C493.8030904@domain.invalid> <3ee51592@newsgroups.borland.com> <3EE5C64C.7010201@domain.invalid>

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-11 13:50:34 PST
From: "Safari" <Safari@alloymail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ee3bf50@newsgroups.borland.com> <3EE3C493.8030904@domain.invalid> <3ee51592@newsgroups.borland.com> <3EE5C64C.7010201@domain.invalid>
Subject: Re: Screen Saver!
Date: Wed, 11 Jun 2003 05:28:54 +0430
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 81.28.33.100
Message-ID: <3ee7951a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1055364378 81.28.33.100 (11 Jun 2003 13:46:18 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!easynet-quince!easynet.net!peer01.cox.net!cox.net!small1.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