to:limengchen(lmc) 
那不是要不停的向MCI device发信息吗?
有谁来发信息呢?这样的话还不如用sysinfo控件。

解决方案 »

  1.   

    to:suntingting(亭亭)
    to:vbFly(CSDN是垃圾) 
    你这要去检测光驱,那要程序不停发消息去判断光驱,
    以前我用sysinfo控件做过,使用sysinfo控件的DeviceArrival和DeviceRemoveComplete事件,在事件中判断光驱;现在我要的是不用sysinfo控件。
    不用sysinfo等控件能完成这个功能就给分,如何?
      

  2.   

    '方法一'FormPrivate Function DriveIsCDROM() As Boolean
    'Dim ...Set fs0 = CreateObject("scripting.filesystemobject")
    Set dc0 = fs0.drives
    DriveIsCDROM = False
    For Each d0 In dc0 If d0.Drivetype = 4 Then
     DriveIsCDROM = True
     Exit Function
     End If
    NextEnd FunctionPrivate Sub Form_Load()MsgBox DriveIsCDROM()End Sub'////////////////////////////////'方法二'用API
    Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
      

  3.   

    to:Seedling(叶子) 
    你的方法只是用来判断某个逻辑驱动器是光驱。