CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

问一个关于文件拖放的问题

楼主firesnowd(火雪)2005-08-04 02:12:53 在 VC/MFC / 基础类 提问

在做一个压缩的软件.想实现一种效果:把列表框显示的压缩包内文件拖放到资源管理器后会自动解压到对应的地方.  
  请问当把文件拖放到指定文件夹后如何通知程序由它来进行解压操作?  
  谢谢! 问题点数:100、回复次数:7Top

1 楼an_bachelor(洗澡就是浪費生命)回复于 2005-08-04 05:29:38 得分 50

在你的程序中响应WM_DROPFILES   Message  
   
  --------------------------------------------------------------------------------  
   
  Sent   when   the   user   drops   a   file   on   the   window   of   an   application   that   has   registered   itself   as   a   recipient   of   dropped   files.  
   
  Syntax  
   
   
  To   send   this   message,   call   the   SendMessage   function   as   follows.    
  lResult   =   SendMessage(             //   returns   LRESULT   in   lResult           (HWND)   hWndControl,             //   handle   to   destination   control           (UINT)   WM_DROPFILES,             //   message   ID           (WPARAM)   wParam,             //   =   (WPARAM)   (HDROP)   hDrop;         (LPARAM)   lParam             //   =   0;   not   used,   must   be   zero   );        
  Parameters  
   
  hDrop  
  Handle   to   an   internal   structure   describing   the   dropped   files.   Pass   this   handle   DragFinish,   DragQueryFile,   or   DragQueryPoint   to   retrieve   information   about   the   dropped   files.    
  lParam  
  Must   be   zero.  
  Return   Value  
   
  An   application   should   return   zero   if   it   processes   this   message.  
   
   
   
  Remarks  
   
  The   HDROP   handle   is   declared   in   Shellapi.h.   You   must   include   this   header   in   your   build   to   use   WM_DROPFILES.   For   further   discussion   of   how   to   use   drag-and-drop   to   transfer   Shell   data,   see   Transferring   Shell   Data   Using   Drag-and-Drop   or   the   Clipboard.  
   
  Message   Information  
   
  Header   winuser.h    
  Minimum   operating   systems   Windows   NT   3.1,   Windows   95    
   
  See   Also  
   
  DragAcceptFiles  
   
  --------------------------------------------------------------------------------  
   
  ©   2005   Microsoft   Corporation.   All   rights   reserved.Top

2 楼jiangsheng(蒋晟.Net[MVP])回复于 2005-08-04 07:07:01 得分 50

Transferring   Shell   Objects   with   Drag-and-Drop   and   the   Clipboard    
  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/transferring/transfer.aspTop

3 楼vcleaner(我没当大哥很久了.......)回复于 2005-08-04 08:44:14 得分 0

需要你的软件支持拖放,程序中需要处理一些关于拖放的消息。Top

4 楼firesnowd(火雪)回复于 2005-08-04 23:26:03 得分 0

WM_DROPFILES怎样用的,有没有例子.谢谢!Top

5 楼realmiss(边缘)回复于 2005-08-05 00:21:34 得分 0

查msdn吧Top

6 楼firesnowd(火雪)回复于 2005-08-05 00:31:35 得分 0

WM_DROPFILES不是有文件拖放到本程序窗口上才触发的吗?    
  但我是要把本程序窗口上的文件拖放到浏览器那里去,当鼠标放下时由本程序进行处理.Top

7 楼firesnowd(火雪)回复于 2005-08-05 17:28:06 得分 0

msdn上说可以用IASyncOperation   ,但又找不到具体的用法Top

相关问题

  • 文件的拖放问题?急!!!
  • 文件拖放问题(50分)
  • 文件的拖放打开问题
  • 一个关于文件拖放的问题
  • 拖放文件来启动应用程序的问题!
  • 请问如何响应文件的拖放
  • 拖放问题!
  • 拖放问题
  • 拖放的问题
  • 请问怎样实现把文件从桌面或者资源管理器拖放到Form中,高分!

关键词

  • 文件
  • 文件拖放
  • dropfiles
  • 程序
  • lresult
  • dropped
  • wparam
  • wm
  • message

得分解答快速导航

  • 帖主:firesnowd
  • an_bachelor
  • jiangsheng

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo