VC如何弹出U盘

来源:百度知道 编辑:UC知道 时间:2024/06/24 13:12:21
请问在VC下,如何弹出U盘?谢谢
一楼的大侠jspdpz:谢谢您提供的程序,但是,请问 DEVINST GetDrivesDevInstByDiskNumber(long DiskNumber, UINT DriveType) 函数后面是否是还有内容没贴上呢? (BYTE Buf[1024];后面)

#include <windows.h>
#include <Setupapi.h>
#include <winioctl.h>
#include <cfgmgr32.h>
#include <regstr.h>
#include <initguid.h>
#include <stdio.h>
extern "C"
{
#include "hidsdi.h"
}
DEFINE_GUID(GUID_DEVINTERFACE_DISK, 0x53f56307L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
DEFINE_GUID(GUID_DEVINTERFACE_CDROM, 0x53f56308L, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
//-------------------------------------------------
DEVINST GetDrivesDevInstByDiskNumber(long DiskNumber, UINT DriveType);
//-------------------------------------------------
//-------------------------------------------------
int main(int argc, char* argv[])
{
if ( argc != 2 ) {
return 1;
}

//printf("in \n\n");
<