Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stupid question... 1

Status
Not open for further replies.

redzombi19

Programmer
Jun 2, 2002
35
US
is there a command in foxpro to ejct a cd or floppy?
sorry for the question, i just wanted to know. :eek:)
thanks!


 
redzombi19,

To open and close the CD drawer... Cut-n-paste the code below into a prg file and run it from within VFP.


Declare Long mciSendString in winmm as mciSendStringA string lpstrCommand, long lpstrReturnStr, Long wReturnLenLong, Long hCallBack
=mciSendStringA("Set CDAudio Door Open Wait", 0, 0, 0)
messagebox("Insert the CD and click OK.", 0, "INSERT CD")
=mciSendStringA("Set CDAudio Door Closed Wait", 0, 0, 0)


Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
slighthaze ,
allthough I don't see why to use this 'function', just curious!
how do you select a second cd or zipdrive ?
-bart
 
Nifrabar,

Code to open whatever CD drawer you want to based on the drive letter. The code below assumes that you have CD drives H:\ and I:\, you will need to modify these to suit. Cut-n-paste the code below into a prg file and run it from within VFP.


LOCAL cCDDrive1, cCDDrive2
cCDDrive1 = "H:\"
cCDDrive2 = "I:\"
Declare Long mciSendString in winmm as mciSendStringA string lpstrCommand, long lpstrReturnStr, Long wReturnLenLong, Long hCallBack
mciSendStringA("Open "+cCDDrive1+" type CDAudio alias CDDrawer1", 0, 0, 0)
mciSendStringA("Set CDDrawer1 Door Open Wait", 0, 0, 0)
messagebox("Insert the CD and click OK.", 0, "INSERT CD IN FIRST DRIVE")
mciSendStringA("Set CDDrawer1 Door Closed Wait", 0, 0, 0)
mciSendStringA("Open "+cCDDrive2+" type CDAudio alias CDDrawer2", 0, 0, 0)
mciSendStringA("Set CDDrawer2 Door Open Wait", 0, 0, 0)
messagebox("Insert the CD and click OK.", 0, "INSERT CD IN SECOND DRIVE")
mciSendStringA("Set CDDrawer2 Door Closed Wait", 0, 0, 0)


Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top