473,320 Members | 2,080 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,320 software developers and data experts.

How to find CD loaded or not

Dear friends,

I want to know what is the code for finding whether a cd is loaded or not in the drive ?
will any body give me the code?
Jul 23 '06 #1
1 1287
sashi
1,754 Expert 1GB
Hi there,

try out the below code segment.. it works fine me.. hope it helps you to get started with.. take care and good luck my fren.. :)

Expand|Select|Wrap|Line Numbers
  1. Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" _
  2.     (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal _
  3.     nVolumeNameSize As Long, lpVolumeSerialNumber As Long, _
  4.     lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal _ lpFileSystemNameBuffer As String, _
  5.     ByVal nFileSystemNameSize As Long) As Long
  6.  
  7.  
  8. Private Sub Command1_Click()
  9.     erg& = GetVolumeInformation(Drive1.Drive, VolName$, 127&, VolNumber&, MCM&, FSF&, FSys$, 127&)
  10.  
  11.  
  12.     If erg& = 0 Then
  13.         MsgBox "There is no media In the drive"
  14.     Else
  15.         MsgBox "There is media In the drive"
  16.     End If
  17. End Sub
  18.  
Jul 24 '06 #2

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

Similar topics

1
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the...
1
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
2
by: balakrishnan.dinesh | last post by:
hi frnds, In my senario, My webpage will load dynamically from the server, Sometimes Images in my is not loading, how can i find , whether my image is loaded or not, through javascript. then...
2
by: Atul | last post by:
I am unable to find image height and width in mozilla firefox. My code is working in IE but not in Mozilla. How can i find image width and height in mozilla? function check(sel) { if(sel != "")...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.