473,324 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Capturing events in Windows Service

2
Hello,

I have been experimenting with windows services using Visual Studio.NET 2003. I used the Windows Template that it provides in the projects and it was really simple to create a windows service in no time at all.

I would like to be able to receive some windows messages such as SERVICE_CONTROL_SHUTDOWN so that I know the computer is shutting down. I know that there is a 'CanShutdown' option in the template that allows me to be notified of the mahcine closing down but it happens late on and I cannot stop the machine from closing down. I read that it is possible to stop a shutdown but I can't figure out how to do it when using c++ in the .NET template.

Can anyone provide me with some help in this matter?

Regards,

John.
Apr 3 '08 #1
0 763

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: jerrygarciuh | last post by:
Hello, I have been playing with various Googled solutions for capturing the <Enter> key to suppress form submission. My first question is whether anyone has a script that works in all common...
6
by: ankurw | last post by:
Hi All, I am experiencing a frustrating issue with hooking into COM events from a Windows service writting in C#. I create a COM object in the service and hook into an event exposed by the...
14
by: Brent Burkart | last post by:
I am trying to capture the Windows Authenticated username, but I want to be able to capture the login name that exists in IIS, not Windows. In order to enter my company's intranet through the...
1
by: Nikolay Petrov | last post by:
I am going to write a windows service and i need some info. How is the right way to make it do thing as specified time? Should I use a timer, which checks the time and execute what it have to, or...
2
by: SLE | last post by:
Hi there, I am writing a service which monitors processes on the local machine. Currently I have implemented a System.Management.ManagementEventWatcher which raises events for processes being...
5
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event...
3
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the...
1
by: hemant | last post by:
I am trying to Caputre the screen in windows service with the GDI Api of Win32 in vb.net 1. CreateDc 2. CreateCompatibleDC 3. CreateCompatibleBitmapDc 4. Bitblt 5. SelectObject 6. ...
2
by: yevron2 | last post by:
Hello, I am trying to get clipboard events using SetClipboardViewer api. It works in a windows form when i override the function: protected override void WndProc(ref...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.