473,587 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect CD Insert from Windows Service

I am trying to detect when a CD is inserted from a windows service. I
have went through the route of creating a hiden window and trying to
use the WndProc to detect the event; although the window does not seem
to be recieving the events that I need. I have also tried registering
the WM_SHNOTIFY event with my specific window and still do not recieve
the event.

Is there another method for recieving the CD insert event from within
a winows service?

Thanks.

Jul 10 '07 #1
2 3091
If you want to get messages sent to the window, then I think you have to
set the checkbox on the service that allows it to interact with the desktop
(since you are trying to get it through a windows message).

You might want to consider an application that runs while the user is
logged in that sends a message to your service when the CD is inserted.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
<ar********@gma il.comwrote in message
news:11******** *************@p 39g2000hse.goog legroups.com...
>I am trying to detect when a CD is inserted from a windows service. I
have went through the route of creating a hiden window and trying to
use the WndProc to detect the event; although the window does not seem
to be recieving the events that I need. I have also tried registering
the WM_SHNOTIFY event with my specific window and still do not recieve
the event.

Is there another method for recieving the CD insert event from within
a winows service?

Thanks.
Jul 10 '07 #2
I have tried checking that box and the window still does not recieve
the messages; I suspect they may be filtered out by the service.

thanks.

On Jul 10, 11:00 am, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guar d.caspershouse. comwrote:
If you want to get messages sent to the window, then I think you have to
set the checkbox on the service that allows it to interact with the desktop
(since you are trying to get it through a windows message).

You might want to consider an application that runs while the user is
logged in that sends a message to your service when the CD is inserted.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard .caspershouse.c om

<arcade2...@gma il.comwrote in message

news:11******** *************@p 39g2000hse.goog legroups.com...
I am trying to detect when a CD is inserted from a windows service. I
have went through the route of creating a hiden window and trying to
use the WndProc to detect the event; although the window does not seem
to be recieving the events that I need. I have also tried registering
the WM_SHNOTIFY event with my specific window and still do not recieve
the event.
Is there another method for recieving the CD insert event from within
a winows service?
Thanks.- Hide quoted text -

- Show quoted text -

Jul 10 '07 #3

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

Similar topics

9
6701
by: Yaron C. | last post by:
Hi, Is there is a way to detect Service Pack 2 for XP in JS ? Can I know it from navigator.userAgent ? Thanks, Yaron
0
1363
by: Hank | last post by:
Hi, I am writing a windows service application which manage image capturing device in C#.NET. When the service is running, how it automatically detect when there is a new device plugged in (say through a USB port or Ethernet Adapter)? Your help is highly appreciated! Hank
5
3944
by: John Lee | last post by:
Hi, I have a component with some static public methods and is it possible from inside my method to decide if my component is invoked by an ASP.NET application (such as web service) or a windows application? If YES, How to do that? If I know it's invoked by web service (web service is configured as windows authentication only and assigned...
3
9102
by: Sara | last post by:
HI, I want to code a program to detect GSM mobile (any kind) which connected through serial port to computer and then be able to send SMS through this mobile phone to other mobile phones, could anyone help me and guide me, I wrote a program which could open COM port but still couldn't detect mobile phone and send SMS through it. I searched...
4
2083
by: henry | last post by:
Hi all, I'm building a website which provides contents that only work for some browser types and versions. I know I can get most of the client browser information using HttpBrowserCapabilities class, but I can't find a way to determine IE update version or service pack number. Any ideas? TIA Henry
5
2179
by: TulasiKumar | last post by:
Hi all, I am new in Netwrok porgraming in cSharp.how can i detect Tcp/Ip packet in c#.Net.Any body knows please tell me, what are the interfaces or classes are supported regrading on TCP/IP packets.Please tell me any website refrences or any Source code examples.This is very urgent requirement. Thanks in advance, Regards, Tulasi Kumar.
4
10110
by: Jarod_24 | last post by:
How do a windows-service detect whether a user is logged or not on a computer? So far i've found nothing in the windows api or any code examples that will allow me to figure this out. The solution i have today is to use Diagnostics.Process.GetProcesses and then iterate through the array i get and look for explorer.exe Explorer.exe is not...
0
1193
by: =?Utf-8?B?VmlsaGVsbQ==?= | last post by:
I am making a ASP.NET application that connects to a database. I want to distribute this to my customers that may have different Windows OS, so my installer must handle different windows versions. The installer makes sure SQL Server 2005 is there, IIS is ready and ASP.NET is set up properly. In my installer I am using the following SQL...
14
5343
by: racheli10 | last post by:
hi, I found a lot of programs that detect usb devices in c#. but i need to make windows service program that detect usb. can someone help me???
0
7915
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...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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...
1
5712
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...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
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
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.