473,780 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
SystemParameter sInfo. And the system would use the new settings.

Now that I'm trying to do it in .NET, I found that SystemParameter sInfo 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 2200
You still can use those features through P/Invoke.

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

"Christophe r Burr" <cb***@kcc.co m> wrote in message
news:%2******** **********@TK2M SFTNGP11.phx.gb l...

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
SystemParameter sInfo. And the system would use the new settings.

Now that I'm trying to do it in .NET, I found that SystemParameter sInfo 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*****@agniso ft.com> wrote in message
news:uX******** ******@TK2MSFTN GP10.phx.gbl...
You still can use those features through P/Invoke.

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

"Christophe r Burr" <cb***@kcc.co m> wrote in message
news:%2******** **********@TK2M SFTNGP11.phx.gb l...

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
SystemParameter sInfo. And the system would use the new settings.

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

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.co m> 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.m icrosoft.com...
On Fri, 30 Jan 2004 07:17:18 -0600, Christopher Burr <cb***@kcc.co m> 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
6659
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 wav-files every time the screensaver starts. It is a Tkinter application, btw. Any help would be very appreciated. Thanks
0
4183
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. However I am unable to detect the screensaver starting when the screensaver password option is disabled. When using the WndProc Overrides I am unable to capture the screensaver event unless the application is active . Thank you in advance for any...
2
8572
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 seem to be '/c' but that does not seem to work for the screensaver I have written. I've tested my code and if '/c' is the first argument then the options dialog is launched but Windows XP does not seem to be supplying the '/c' argument when I...
0
1625
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 minutes of inactivity. This windows service would be used on some machines to prevent the lock from occurring every 10 minutes. I have tried to reposition the mouse pointer with the Cursor class in a service, but it does not work -- always...
4
5111
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 minutes of inactivity. This windows service would be used on some machines to prevent the lock from occurring every 10 minutes. I have tried to reposition the mouse pointer with the Cursor class in a service, but it does not work -- always...
1
2632
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 seem to be '/c' but that does not seem to work for the screensaver I have written. I've tested my code and if '/c' is the first argument then the options dialog is launched but Windows XP does not seem to be supplying the '/c' argument when I...
4
5504
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 to work, however, i can't get the application to work with some prebuilt assemblies i have. Also, when the screensaver is running under the windows screensaver settings it also will not access the config file. Any pointers would be greatly...
3
5660
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 fWinIni); .... try
4
342
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 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...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9931
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7485
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.