Is there a way that VB can know when the operating system
goes into screen save mode? I have continuous polling I
wish to pause while in screen save mode. And likewise to
wake back up when the screen saver is turned back off.
Any help on this will be greatly appreciated.
Rob 12 11542
Rob wrote: Is there a way that VB can know when the operating system goes into screen save mode? I have continuous polling I wish to pause while in screen save mode. And likewise to wake back up when the screen saver is turned back off.
Any help on this will be greatly appreciated.
Rob
You can use SystemParametersInfo with the SPI_GETSCREENSAVERRUNNING flag
to find out if the screen saver is running... In other words, you could
have a timer that fires every second or so and calls this function. If
it's running put your worker thread to sleep. If it's not, wake it up...
HTH,
Tom Shelton
Hi Rob,
Certain Windows events can be waited on, eg system shutdown, display
properties changes, etc.(see the SystemEvents class). Unfortunately there's no
mention of any Windows event occurring when the screen saver starts.
The following is a VB (classic) project which detects whether a
workstation is locked or not. It include some very straightforward code to
detect whether the screen saver is running, but you'll have to keep checking. http://www.mvps.org/st-software/Code...orkstation.zip
Regards,
Fergus
"Rob" <ro**@stl.NO.hamptontilley.SPAM.com> schrieb Is there a way that VB can know when the operating system goes into screen save mode? I have continuous polling I wish to pause while in screen save mode. And likewise to wake back up when the screen saver is turned back off.
Any help on this will be greatly appreciated.
Protected Overrides Sub WndProc( _
ByRef m As System.Windows.Forms.Message)
Const WM_SYSCOMMAND As Integer = &H112
Const SC_SCREENSAVE As Integer = &HF140
MyBase.WndProc(m)
If m.Msg = WM_SYSCOMMAND _
AndAlso m.WParam.ToInt32 = SC_SCREENSAVE Then
Debug.WriteLine("Screensaver activated")
End If
End Sub
--
Armin
Armin Zingler wrote: "Rob" <ro**@stl.NO.hamptontilley.SPAM.com> schrieb
Is there a way that VB can know when the operating system goes into screen save mode? I have continuous polling I wish to pause while in screen save mode. And likewise to wake back up when the screen saver is turned back off.
Any help on this will be greatly appreciated.
Protected Overrides Sub WndProc( _ ByRef m As System.Windows.Forms.Message)
Const WM_SYSCOMMAND As Integer = &H112 Const SC_SCREENSAVE As Integer = &HF140
MyBase.WndProc(m)
If m.Msg = WM_SYSCOMMAND _ AndAlso m.WParam.ToInt32 = SC_SCREENSAVE Then
Debug.WriteLine("Screensaver activated") End If End Sub
Well, I'll be... You learn something new every day. That is going down
in my little book of knowledge...
Tom Shelton
Thank you Armin. That looks very straight forward. Is
there a listing anywhere of these great little Windows
Message constants?
Rob -----Original Message----- "Rob" <ro**@stl.NO.hamptontilley.SPAM.com> schrieb Is there a way that VB can know when the operating
system goes into screen save mode? I have continuous polling
I wish to pause while in screen save mode. And likewise
to wake back up when the screen saver is turned back off.
Any help on this will be greatly appreciated.
Protected Overrides Sub WndProc( _ ByRef m As System.Windows.Forms.Message)
Const WM_SYSCOMMAND As Integer = &H112 Const SC_SCREENSAVE As Integer = &HF140
MyBase.WndProc(m)
If m.Msg = WM_SYSCOMMAND _ AndAlso m.WParam.ToInt32 = SC_SCREENSAVE Then
Debug.WriteLine("Screensaver activated") End If End Sub
-- Armin
.
"Tom Shelton" <to*@mtogden.com> schrieb Protected Overrides Sub WndProc( _ ByRef m As System.Windows.Forms.Message)
Const WM_SYSCOMMAND As Integer = &H112 Const SC_SCREENSAVE As Integer = &HF140
MyBase.WndProc(m)
If m.Msg = WM_SYSCOMMAND _ AndAlso m.WParam.ToInt32 = SC_SCREENSAVE Then
Debug.WriteLine("Screensaver activated") End If End Sub
Well, I'll be... You learn something new every day. That is going down in my little book of knowledge...
:)
Unfortunately, I don't know how to detect when the screen saver is closed.
:-)
--
Armin
Armin Zingler wrote: "Tom Shelton" <to*@mtogden.com> schrieb
Protected Overrides Sub WndProc( _ ByRef m As System.Windows.Forms.Message)
Const WM_SYSCOMMAND As Integer = &H112 Const SC_SCREENSAVE As Integer = &HF140
MyBase.WndProc(m)
If m.Msg = WM_SYSCOMMAND _ AndAlso m.WParam.ToInt32 = SC_SCREENSAVE Then
Debug.WriteLine("Screensaver activated") End If End Sub
Well, I'll be... You learn something new every day. That is going down in my little book of knowledge...
:)
Unfortunately, I don't know how to detect when the screen saver is closed. :-)
Well, then... I guess that does put a damper on things :) Using the
SystemParametersInfo - you can find out...
Tom Shelton
Write a DLL that injects itself into the CreateProcess API and detect which
process is created when the screensaver comes active... Then, wait until the
process has terminated and therefore the screen saver has closed.
--
HTH,
-- Tom Spink, Über Geek
Please respond to the newsgroup,
so all can benefit
"Chaos, Panic, Disorder, my work here is done"
"Armin Zingler" <az*******@freenet.de> wrote in message
news:#7**************@TK2MSFTNGP11.phx.gbl...
: "Tom Shelton" <to*@mtogden.com> schrieb
: > > Protected Overrides Sub WndProc( _
: > > ByRef m As System.Windows.Forms.Message)
: > >
: > > Const WM_SYSCOMMAND As Integer = &H112
: > > Const SC_SCREENSAVE As Integer = &HF140
: > >
: > > MyBase.WndProc(m)
: > >
: > > If m.Msg = WM_SYSCOMMAND _
: > > AndAlso m.WParam.ToInt32 = SC_SCREENSAVE Then
: > >
: > > Debug.WriteLine("Screensaver activated")
: > > End If
: > > End Sub
: > >
: > >
: >
: > Well, I'll be... You learn something new every day. That is going
: > down in my little book of knowledge...
:
: :)
:
: Unfortunately, I don't know how to detect when the screen saver is closed.
: :-)
:
:
: --
: Armin
:
"Rob" <ro**@stl.NO.hamptontilley.SPAM.com> schrieb Thank you Armin. That looks very straight forward. Is there a listing anywhere of these great little Windows Message constants?
Press <F1> and select "MSDN library". ;-)
In this case, I added
Debug.WriteLine(m)
to Sub WndProc, waited for the screen saver to be started and found out that
WM_SYSCOMMAND is sent. In the help index, after pasting "WM_SYSCOMMAND" you
get the message documentation.
--
Armin
Hello,
"Rob" <ro**@stl.NO.hamptontilley.SPAM.com> schrieb: Is there a way that VB can know when the operating system goes into screen save mode? I have continuous polling I wish to pause while in screen save mode. And likewise to wake back up when the screen saver is turned back off. http://www.mvps.org/dotnet/dotnet/sa...tem/index.html
-> "ScreensaverStart"
--
Herfried K. Wagner
MVP · VB Classic, VB.NET http://www.mvps.org/dotnet
Thank you Fergus, I look at the example.
Rob -----Original Message----- Hi Rob,
Certain Windows events can be waited on, eg system
shutdown, displayproperties changes, etc.(see the SystemEvents class).
Unfortunately there's nomention of any Windows event occurring when the screen
saver starts. The following is a VB (classic) project which detects
whether aworkstation is locked or not. It include some very
straightforward code todetect whether the screen saver is running, but you'll
have to keep checking. http://www.mvps.org/st-
software/Code/DetectLockedWorkstation.zip Regards, Fergus
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mr. x |
last post by:
Hello,
Can Html code be a screen saver ?
How can I do that ?
Thanks :)
|
by: Card.Starzinger |
last post by:
Hi!
I need help to simulate programmatically user interaction on WinNT 4.0, to
avoid screen saver activation.
I try with key injection event.
SendInput API and keybd_event API work...
|
by: Thom Little |
last post by:
How do I invoke the current screen saver with C#?
Where did you find the information on how to do it?
--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--
|
by: Dwight Trumbower |
last post by:
When doing a SaveAS on workbook, within a c# program, and the screen saver
has activated, I always get the error message: "Excel cannot complete this
task with available resources".
I've looked...
|
by: Daniel |
last post by:
Hi all,
i have a doubt related to the screen saver ability.
After developing the asp.net webform, can i add screen saver ability in this
webform?
which means, i open the asp.net webform, after a...
|
by: James Mc |
last post by:
I need some help creating a screensaver in VB.NET
How do I detect a mouse movement while the screen saver is running,
then close the screen saver?
Thanks
JamesMc
|
by: Shawn Mehaffie |
last post by:
I have created a screen saver using VB.Net but cannot find any articles or
examples on how to write the code for the /p parameter (display in dialog
preview window). All the .Net exmaples I have...
|
by: ashwiniappajigowda |
last post by:
Hi,
I have an simple MFC dialog based application. On launch of that
application 'Password protected screen saver' is not getting activated
after the screen saver timeout.
If 'On resume,...
|
by: rehanrana |
last post by:
I built application in VB6, my application appear in system tray, when I double click on icon of my application, it run screen saver, my screen saver shows images and news. Screen saver...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |