473,803 Members | 4,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How know windows locked (via ctrl-alt-del)?

How do i know if windows has been locked (via ctrl-alt-del)?

I need to know because I'm running my app as a service and I want to
suppress sounds when the desktop's locked (it currently plays them).
Oct 26 '06 #1
2 2563
"John Smith" <as****@asdasd. comwrote in message
news:OK******** ********@TK2MSF TNGP03.phx.gbl. ..
How do i know if windows has been locked (via ctrl-alt-del)?

I need to know because I'm running my app as a service and I want to
suppress sounds when the desktop's locked (it currently plays them).
You can register a handler for the SessionLock event.

That said, I'm not convinced that it makes sense to implement as a service
something that is tied to a specific user.
Oct 26 '06 #2
Make sure you don't cut the sound for every session when one session
locks... If you're working with WinXP, no problem because I think you can't
have 2 simultaneous sessions alive. But if you are working with a server
version of windows (win2k (adv)server or win2k3) you could have problems
with the remote desktop applications (Terminal Service, etc.)

Anyway, here's how you can detect session lock/unlock... this way is
extremely precise and does not require a lot of CPU usage (almost none)...
;)

in your load method (or anywhere you want)
SystemEvents.Se ssionSwitch += new
SessionSwitchEv entHandler(Syst emEvents_Sessio nSwitch);

Here's an example of the Event Handler
void SystemEvents_Se ssionSwitch(obj ect sender,
SessionSwitchEv entArgs e)
{
if (e.Reason == SessionSwitchRe ason.SessionLoc k)
Fire_OnSessionL ock();
else if (e.Reason == SessionSwitchRe ason.SessionUnl ock)
Fire_OnSessionU nlock();
}

I hope it helps...

ThunderMusic

"John Smith" <as****@asdasd. comwrote in message
news:OK******** ********@TK2MSF TNGP03.phx.gbl. ..
How do i know if windows has been locked (via ctrl-alt-del)?

I need to know because I'm running my app as a service and I want to
suppress sounds when the desktop's locked (it currently plays them).


Oct 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1556
by: Dariusz Tomoñ | last post by:
Hello Quick question: how can I execute Windows command (like deleting liles from server) via ASP? best regards D.T.
0
676
by: Damon | last post by:
Hi, I need to query each column's constraint and name of a table in postgreSQL v7.3.4 with a single SQL query but don't know how. Would appreciate any pointers! Thank you. Regards, Damon
1
975
by: Rick | last post by:
I created a simple Windows app in VS.NET on Windows XP I copied the "AppName.EXE" and the "AppName.Exe.Config" to a folder on a "WINDOWS 2003 Server" The application opens fine over the browser but fails to access/read the "AppName.Exe.Config ERROR: The remote server returned an error: (401) Unauthorized I've given Full access to this folder to "Administrators,ASP.NET, Everyone,IUSR,Network Service, System,Users,IWAM but nothing In...
3
4801
by: Robb Gilmore | last post by:
Hi, I need to write a C#.NET PC application that can talk to a non-windows device using a USB-IrDA adapter. I have been searching for information about how to do this, and the bext info I have found is at this link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/irda/irda/irda_programming_with_windows_sockets.asp However, that information is from 1998, which is before .NET, and I imagine that .NET must wrap at...
0
1271
by: jpegny | last post by:
Hello all, I'm in the middle of setting up a windows 2003 server for asp.net (with vb.net 2003) remote development/deployment. The problem is that as soon as I install service pack 1 on windows 2003 I can no longer remotely develop asp.net apps with vs.net 2003. I have set-up servers with all the patches except service pack 1 and they work fine but as soon as I install service pack 1 it breaks the remote development of asp.net.
6
3808
by: nsjmetzger | last post by:
I have a script that runs fine in Windows 2003 (32-bit). It basically calls the Windows defrag command. When I try the exact same code on Windows 2003 (64-bit) I get the following message: C:\Scripts>autodefrag.py Starting defragment: defrag -v C: >>c:/Scripts/DEFRAG20070502.log 'defrag' is not recognized as an internal or external command, operable program or batch file. I have tried defrag.exe and even giving it the full path to
0
1013
by: Chris | last post by:
Hi I need to develop a training application. I would like to use the functionality of windows messenger and "embed" it in a branded web page in the same way you can take Windows Media Player and use to play video clip on a web page. All the clients would have Windows messenger installed. Is there any way to have asp.net pages use messenger in this way. I would like to use the Voice Messenger component of Windows messager but integrate it...
4
1314
by: shaileshkumar | last post by:
hi, my name is shailesh,recently i was asked to find the database details(version,name etc) via a java program. please help me shailesh
0
1132
by: philaphan80 | last post by:
I'm hoping someone can offer some guidance regarding a concept I have. I'm trying to perform the following within Windows Explorer: 1. Add an entry to the context menu which should be executed upon right-click of a folder or right-click of an open white space within the righthand pane. 2. Run the program that will create a pre-determined folder path -- possibly several folders deep -- within the folder that was originally...
0
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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,...
0
10542
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10309
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10068
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
7600
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
6840
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
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4274
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

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.