By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

Setting ScreenSaver

P: n/a

I'm trying to set the user's screensaver in the .NET world...

In Win32 I could use a combination of setting the screen saver name via the
registry and then setting the time and active status using
SystemParametersInfo. And the system would use the new settings.

Now that I'm trying to do it in .NET, I found that SystemParametersInfo does
not exist. I also found I can detect when the screensaver settings have
been changed, but what I cannot find out is how to cause the system to know
that the screensaver settings have changed...

Anyone have any ideas?

--
Chris Burr
cb***@kcc.com

Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You still can use those features through P/Invoke.

Add namespace System.Runtime.InteropServices in your code and then declare
[DllImport("user32", CharSet=CharSet.Auto)]
unsafe public static extern short SystemParametersInfo (int uiAction, int
uiParam, int* pvParam, int fWinIni);
HTH
Shishir Kumar Mishra
Agni Software (P) Ltd.
www.agnisoft.com

"Christopher Burr" <cb***@kcc.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...

I'm trying to set the user's screensaver in the .NET world...

In Win32 I could use a combination of setting the screen saver name via the registry and then setting the time and active status using
SystemParametersInfo. And the system would use the new settings.

Now that I'm trying to do it in .NET, I found that SystemParametersInfo does not exist. I also found I can detect when the screensaver settings have
been changed, but what I cannot find out is how to cause the system to know that the screensaver settings have changed...

Anyone have any ideas?

--
Chris Burr
cb***@kcc.com

Jul 21 '05 #2

P: n/a
Yea, was just hoping that I could avoid going to unmanaged code.

--
Chris Burr
cb***@kcc.com
"Shishir Kumar Mishra" <sh*****@agnisoft.com> wrote in message
news:uX**************@TK2MSFTNGP10.phx.gbl...
You still can use those features through P/Invoke.

Add namespace System.Runtime.InteropServices in your code and then declare [DllImport("user32", CharSet=CharSet.Auto)]
unsafe public static extern short SystemParametersInfo (int uiAction, int
uiParam, int* pvParam, int fWinIni);
HTH
Shishir Kumar Mishra
Agni Software (P) Ltd.
www.agnisoft.com

"Christopher Burr" <cb***@kcc.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...

I'm trying to set the user's screensaver in the .NET world...

In Win32 I could use a combination of setting the screen saver name via

the
registry and then setting the time and active status using
SystemParametersInfo. And the system would use the new settings.

Now that I'm trying to do it in .NET, I found that SystemParametersInfo

does
not exist. I also found I can detect when the screensaver settings have
been changed, but what I cannot find out is how to cause the system to

know
that the screensaver settings have changed...

Anyone have any ideas?

--
Chris Burr
cb***@kcc.com


Jul 21 '05 #3

P: n/a
On Fri, 30 Jan 2004 07:17:18 -0600, Christopher Burr <cb***@kcc.com> wrote:
Yea, was just hoping that I could avoid going to unmanaged code.


And what's the problem? Use the registry and make it up through it!

--
.... blood, sugar, sex, magic ...
CIA = Caught In Action programmer
Jul 21 '05 #4

P: n/a
Only problem then is that the effects don't take place until the next login
=(

--
Chris Burr
cb***@kcc.com
"Maniaque |CIA|" <cape[a]fromru[dot]com> wrote in message
news:op**************@msnews.microsoft.com...
On Fri, 30 Jan 2004 07:17:18 -0600, Christopher Burr <cb***@kcc.com> wrote:
Yea, was just hoping that I could avoid going to unmanaged code.


And what's the problem? Use the registry and make it up through it!

--
... blood, sugar, sex, magic ...
CIA = Caught In Action programmer

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.