473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Setting ScreenSaver


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
4 2167
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: klappnase | last post by:
Hello everyone, does anyone know a way to stop the screensaver under linux from starting up while a certain process is running? I need this because I experience a memory leak while recording...
0
by: Luke | last post by:
I am trying to capture an event when the screensaver starts. I have code working on Windows XP etc when the Password/Welcome Screen is enabled . Using the Fast User Switching Notifications. ...
2
by: DanielB | last post by:
Does anyone know what the command line argumentto launch a screensaver's options/configuration dialog is on Windows XP Pro? From most of the example source code I can find on the web, it would...
0
by: Paul Smith | last post by:
I have been given an unusual task to create a Windows Service to do something periodically to make the screensaver timer reset. We have a general policy of locking computers automatically after 10...
4
by: Paul Smith | last post by:
I have been given an unusual task to create a Windows Service to do something periodically to make the screensaver timer reset. We have a general policy of locking computers automatically after 10...
1
by: DanielB | last post by:
Does anyone know what the command line argumentto launch a screensaver's options/configuration dialog is on Windows XP Pro? From most of the example source code I can find on the web, it would...
4
by: Simon Mercer | last post by:
I have been trying to build a screensaver that will connect to a database and display specific data depending on the user that is logged in. I have managed to get a simple data access screensaver...
3
by: Ron Nanko | last post by:
Hi, I'm trying to setup a screensaver via a C# application. What I currently do is this: unsafe public static extern short SystemParametersInfo (int uiAction, int uiParam, int* pvParam, int...
4
by: Christopher Burr | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.