Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to detect when CD is inserted in a CDROM drive Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Detect when CD is inserted in a CDROM drive 14-Jun-04
Category
Win API
Language
Delphi All Versions
Views
387
User Rating
10
# Votes
2
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   
2   unit Unit1;
3   
4   interface
5   
6   uses
7     Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
8   
9   type
10    TForm1 = class(TForm)
11      procedure CDROM_Notification(var msg : TMessage);
12        message WM_DEVICECHANGE;
13    private
14      { private declarations }
15    public
16      { public declarations }
17    end;
18  
19  var
20    Form1: TForm1;
21  
22  implementation
23  
24  {$R *.DFM}
25  
26  const
27    CD_OUTPUT = $8004;
28    CD_INPUT  = $8000;
29  
30  procedure TForm1.CDROM_Notification(var msg : TMessage);
31  begin
32    if msg.wParam = CD_INPUT then
33      ShowMessage('There is a new CD.')
34    else
35    if msg.wParam = CD_OUTPUT then
36      ShowMessage('CD was ejected.');
37  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC