VB.Net and Screensaver problem
Morning All
I have a Visual Basic Application that I have created in Visual Studio 2005. This application is a data logging screen that displays running and downtime details of machines on my production.
The company has now enforced a Screen Saver policy which enables after 15 minutes. This now defeats the purpose of my screen as the operators should see real time data instead of having to go to the PC afre 15 minutes to unlcok the PC (Windows 7) to see the screen.
Is there anyway that I can have the screen still shown even when the screen saver is active, eg make it the screen saver or something along those lines?
Regards
Douglas Bell
Re: VB.Net and Screensaver problem
AFIK .. You can override the screensaver timer by using the sendkeys to make the system belive the user is still active on the system. You could also disable the sreensaver on startup and enable it on exit via code...
Re: VB.Net and Screensaver problem
Hi GremlinSA
The sendkeys option sounds good unfortuantly this basically disables the screen saver completly as the Data screen is active all the time, IT Security would not go for this as if no user is present at the PC it must be locked. Disabling the screensaver at startup is not an option as the local user has no rights to the Screen Saver as it is applied via a GPO and again it would be in breech of IT security., Is there such a thing as a completly transparent screen saver?
Regards
Re: VB.Net and Screensaver problem
Hi,
If the user's have some rights to the registry you can change the screensaver settings here..
use Microsoft.Win32.Registry
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop
Name ScreenSaveTimeOut
Type REG_SZ
Value 900
900 = 15min
or if that's not an option, what if you set up a timer in your app to save multiple images of the main form or objects in the form to a bitmap or jpeg
that get saved to the slideshow folder. Then setup the screensaver to the slideshow setting. You can set the slideshow to update every 6 seconds. At least the user can see an updated display of the chart or data that's on your main form.
Just a thought.
Curt
Re: VB.Net and Screensaver problem
Have IT Security run your program as a service
Re: VB.Net and Screensaver problem
Even as a service, the screen saver settings would override it.
Curt's idea would most probably be your best option
I think I remember ( My brain is not what it used to be ) That you can use the SendMessage API and send a particular message to stop the screensaver from coming up - I'll have to look that up - Google is HUGE.
There is also another API, I did something some time ago.... Come to think of it, that managed the Power off settings.
Re: VB.Net and Screensaver problem
Aha! I knew I had it on my system!! :D
You can use the SystemParametersInfo API. You could use it with the SPI_SETSCREENSAVETIMEOUT constant. So, if you do something like this :
Code:
Imports System.Runtime.InteropServices
Imports Microsoft.Win32 'for system events
Public Class Form1
'This function queries or sets system-wide parameters, and updates the user profile during the process.
<DllImport("user32", EntryPoint:="SystemParametersInfo", CharSet:=CharSet.Auto, SetLastError:=True)> _
Private Shared Function SystemParametersInfo(ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer
End Function
Private Const SPI_SETSCREENSAVETIMEOUT As Int32 = 15
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'Sets the screen saver time-out value to the
'value of the uiParam parameter. This value is the amount of time,
'in seconds, that the system must remain idle before the screen saver activates.
'So, if you set it 30, it will suspend the screensaver & Power Off features for 30 minutes
SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, 30, 0, 0)
End Sub
End Class
it will suspend the screensaver & Power Off features for 30 minutes
I hope this helps.
Re: VB.Net and Screensaver problem
Sounds to me like your best bet would be to create a screen saver that talks to your program and displays results as a screen saver so that when the screen saver kicks in it will take over the job of displaying your data to the users while still allowing the system to be locked.
Re: VB.Net and Screensaver problem
Could be a punishable offense. It was where I worked. One screen saver for the system that locked when THEY wanted it.
Re: VB.Net and Screensaver problem
I would not see anything wrong with creating a screen saver that displays useful information. The only purpose for a screen saver is to prevent burn in on a monitor combined with the optional locking feature. To most companies it would not matter what the screen saver was so long as it is not malicous or vulgar or somehow inappropriate.
Re: VB.Net and Screensaver problem
Same with desktop backgrounds. Sounds innocent, until someone gets a 900MB picture of whatever the current theme was. They sent it to everyone and clogged up the server with copies.
People were bringing software from home, and installing it (violating licenses). Something had to be done
Re: VB.Net and Screensaver problem
I really do not see how that relates to the subject at hand?
Re: VB.Net and Screensaver problem
Any software falls into the same 'rogue' category
Re: VB.Net and Screensaver problem
I could be wrong but it sounds like the software in question here is intended for in house use.