Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / November 2006

Tip: Looking for answers? Try searching our database.

screen saver

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 27 Nov 2006 16:57 GMT
I would like to create a simple standalone vb app that will end, and
preferably restart the windows screen saver.  I fould code that says it
starts the screen saver but how about terminating the currently running
instance?
Linda Liu [MSFT] - 28 Nov 2006 12:02 GMT
Hi John,

Based on my understanding, you'd like to stop the currently running screen
saver in your WinForms application written in VB.NET. If I'm off base,
please feel free to let me know.

When the screen saver is running, is it terminated when you move the
pointer or press a key? If yes, I think you could simulate a key press in
your application to stop the currently running screen saver.

The following is a sample.

Imports System.Runtime.InteropServices

Declare Sub keybd_event Lib "User32.dll" Alias "keybd_event" (ByVal bvk As
Byte, ByVal bscan As Byte, ByVal dwflags As Integer, ByVal dwextrainfo As
Integer)

' call this API in your code to simulate a key press
keybd_event(65, 0, 0, 0)

Hope this helps.
If my suggestion doesn't apply to your scenario, please feel free to let me
know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
John - 28 Nov 2006 20:49 GMT
That appears to do the job.  Thanks.

> Hi John,
>
[quoted text clipped - 46 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.