Stiwin
驱动牛犊
驱动牛犊
  • 注册日期2002-02-17
  • 最后登录2004-01-08
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1372回复:9

系统插入usb设备(如U盘,MP3机等)在我要在自己的程序中告诉用户有U盘,或mp3机插入

楼主#
更多 发布于:2004-01-01 17:15
系统插入usb设备(如U盘,MP3机等)在我要在自己的程序中告诉用户有U盘,或mp3机插入
adsl123
驱动牛犊
驱动牛犊
  • 注册日期2003-12-02
  • 最后登录2004-01-18
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-01-01 20:26
是应用程序中吗?
江湖术士
Stiwin
驱动牛犊
驱动牛犊
  • 注册日期2002-02-17
  • 最后登录2004-01-08
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-01-02 09:16
是的
zhongdao
驱动牛犊
驱动牛犊
  • 注册日期2003-01-16
  • 最后登录2008-05-12
  • 粉丝0
  • 关注0
  • 积分60分
  • 威望7点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
地板#
发布于:2004-01-02 09:24
插入、拔出时系统会发 WM_DEVICECHANGE 消息给应用程序
huoxy
驱动小牛
驱动小牛
  • 注册日期2002-03-01
  • 最后登录2014-02-24
  • 粉丝0
  • 关注0
  • 积分21分
  • 威望4点
  • 贡献值0点
  • 好评度1点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-01-02 10:21
插入、拔出时系统会发 WM_DEVICECHANGE 消息给应用程序


好像在Delphi能接收到这个消息,但是不能接受里面的具体信息。
好好学习,天天向上,做一个乖宝宝。
whmjack
驱动小牛
驱动小牛
  • 注册日期2003-09-17
  • 最后登录2007-04-26
  • 粉丝0
  • 关注0
  • 积分290分
  • 威望29点
  • 贡献值0点
  • 好评度29点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2004-01-02 11:02
WM_DEVICECHANGE
The WM_DEVICECHANGE device message notifies an application or device driver of a change to the hardware configuration of a device or the computer.

Event = (UINT) wParam;
dwData = (DWORD) lParam;
 
Parameters
Event
Event type. This parameter can be one of the following values: Value Meaning
DBT_CONFIGCHANGECANCELED  A request to change the current configuration (dock or undock) has been canceled.
DBT_CONFIGCHANGED The current configuration has changed, due to a dock or undock.  
DBT_DEVICEARRIVAL A device has been inserted and is now available.  
DBT_DEVICEQUERYREMOVE Permission is requested to remove a device. Any application can deny this request and cancel the removal.
DBT_DEVICEQUERYREMOVEFAILED A request to remove a device has been canceled.
DBT_DEVICEREMOVECOMPLETE A device has been removed.
DBT_DEVICEREMOVEPENDING A device is about to be removed. Cannot be denied.
DBT_DEVICETYPESPECIFIC A device-specific event has occurred.
DBT_QUERYCHANGECONFIG  Permission is requested to change the current configuration (dock or undock).  
DBT_USERDEFINED  The meaning of this message is user-defined.


dwData
Address of a structure that contains event-specific data. Its meaning depends on the given event.
Return Values
Return TRUE to grant a requested action.

Return BROADCAST_QUERY_DENY to deny a requested action.

Remarks
For devices that offer software-controllable features, such as ejection and locking, the system typically sends a DBT_DEVICEREMOVEPENDING message to let applications and device drivers end their use of the device gracefully.

If the system forcibly removes a device, it may not send a DBT_DEVICEQUERYREMOVE message before doing so.

DBT_CONFIGCHANGECANCELED, DBT_CONFIGCHANGED, DBT_DEVICEARRIVAL, DBT_DEVICEQUERYREMOVE, DBT_DEVICEQUERYREMOVEFAILED, DBT_DEVICEREMOVECOMPLETE, DBT_DEVICEREMOVEPENDING, DBT_DEVICETYPESPECIFIC, DBT_QUERYCHANGECONFIG, DBT_USERDEFINED

QuickInfo
  Windows NT: Requires version 4.0 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in winuser.h.

See Also
System Messages Overview, System Message Messages

 
Stiwin
驱动牛犊
驱动牛犊
  • 注册日期2002-02-17
  • 最后登录2004-01-08
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2004-01-02 12:09
如果我是插着U盘或MP3机,开机的话怎么知道有没有盘插着呢
zhongdao
驱动牛犊
驱动牛犊
  • 注册日期2003-01-16
  • 最后登录2008-05-12
  • 粉丝0
  • 关注0
  • 积分60分
  • 威望7点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2004-01-02 16:44
你的程序里可以试着访问你的设备,如果能访问的话,不就可以证明你的设备已插上吗
Stiwin
驱动牛犊
驱动牛犊
  • 注册日期2002-02-17
  • 最后登录2004-01-08
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2004-01-05 10:37
你的程序里可以试着访问你的设备,如果能访问的话,不就可以证明你的设备已插上吗


程序怎么知道有没有设备呀!你自己再想想呀
Stiwin
驱动牛犊
驱动牛犊
  • 注册日期2002-02-17
  • 最后登录2004-01-08
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
9楼#
发布于:2004-01-05 10:38
你的程序里可以试着访问你的设备,如果能访问的话,不就可以证明你的设备已插上吗


程序怎么知道有没有设备呀!你自己再想想呀:0
游客

返回顶部