Evil Scripting

Moderators: None (Apply to moderate this forum)
Number of threads: 62
Number of posts: 272

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
CD-ROM Drive Posted by borering_guy89 on 21 Aug 2005 at 12:32 PM
anyone know how to open to make the cdrom drive open and close using visual basic?
Report
Re: CD-ROM Drive Posted by ranainnet on 20 Sept 2005 at 1:25 PM
This message was edited by ranainnet at 2005-9-20 13:29:56

This message was edited by ranainnet at 2005-9-20 13:27:14

: anyone know how to open to make the cdrom drive open and close using visual basic?
:
To open or close CD-ROM form VB uou need the following API:

Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As String, ByVal uReturnLength As Long, _
ByVal hwndCallback As Long) As Long

Then you can open or close the cd-rom by the following code:

Public Sub OpenCD()
Dim res As Long, returnstring As String * 127
res = mciSendString("set CDAudio door open", returnstring, 127, 0)
End Sub

Public Sub CloseCD()
Dim res As Long, returnstring As String * 127
res = mciSendString("set CDAudio door closed", returnstring, 127, 0)
End Sub
'res is a Long variable

You can put those functions in a timer control to code a fun program which if loaded in the background will automatically oprn and close the CD-ROM tray.

GoodLuck.
_____________________________________________________________________________
Knowledge Is Power. Be Sure To Use This Power For Others WelFare. (;->

Report
Re: CD-ROM Drive Posted by silicon knight on 29 Jan 2006 at 9:06 AM
: anyone know how to open to make the cdrom drive open and close using visual basic?
:

I had that virus on my coputer for about 3 months, goes by the name of "odyian" and disguises it self as "rul32dli.exe".

if you can get source codes for those media player software you'll kind off end up with the code to open CD-Rom with a program!

p.s. i dont know!
Report
Re: CD-ROM Drive Posted by eliteprgmr on 1 Feb 2006 at 12:33 PM
its damn simple. jus ask me personally:
emraanelaahi(at.the.rate.of)sify(dot)com





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.