Groups | Blog | Home
all groups > dotnet clr > january 2004 >

dotnet clr : Setting ScreenSaver


Christopher Burr
1/29/2004 10:50:59 AM

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
cburr@kcc.com


Christopher Burr
1/30/2004 7:17:18 AM
Yea, was just hoping that I could avoid going to unmanaged code.

--
Chris Burr
cburr@kcc.com


[quoted text, click to view]

Shishir Kumar Mishra
1/30/2004 10:27:19 AM
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

[quoted text, click to view]

Maniaque |CIA|
1/30/2004 4:39:01 PM
[quoted text, click to view]

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

--
.... blood, sugar, sex, magic ...
Christopher Burr
2/4/2004 7:44:40 AM
Only problem then is that the effects don't take place until the next login
=(

--
Chris Burr
cburr@kcc.com


[quoted text, click to view]

AddThis Social Bookmark Button