如上?
解决方案 »
- 机读卡(就是高考选择题那种) 如何进行数据处理
- 请问这样的菜单如何做?
- DBChart/Chart柱图顶端显示的不是数值而是柱图的所对应的标签值,如何解决?
- win7上安装delphi7的问题
- 关于存储过程
- 请问各位大侠运行时创建的表单,为什么不能ShowModal只能Show,如何解决?
- 我用PageControl建立很多个页面,怎样用一个按钮实现全部关闭,注意:是一下子全部都关掉了,不是快速的挨个关掉!
- 当我用Grid来浏览数据到最后一条数据后,再用方向键望下浏览,当关闭系统的时候,就会出错。帮忙啊
- 急!急!急!VC++语句用DELPHI如何表示,高分回送先送40
- 为什么我的代码会出现out of memory(1)啊?以下是具体的功能和实现?大神们帮我看一下
- 请问各位仁兄、贤弟、大姐、小妹(高分求助, DELPHI中文电子书籍):
- 关于类的问题?大家帮忙指导!
interface
uses
Windows, ShellAPI, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
ListView1: TListView;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure WMDropFiles(var Msg: TWMDropFiles); message WM_DROPFILES;
procedure AppOnMessage(var Msg: TMsg; var Handled: Boolean);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.AppOnMessage(var Msg: TMsg; var Handled: Boolean);
var
WMD: TWMDropFiles;
begin
if Msg.message = WM_DROPFILES then
begin
// MessageBeep(0);
WMD.Msg := Msg.message;
WMD.Drop := Msg.wParam;
WMD.Unused := Msg.lParam;
WMD.Result := 0;
WMDropFiles(WMD);
Handled := TRUE;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
DragAcceptFiles(listview1.Handle, True);
// DragAcceptFiles(Handle, True);
// DragAcceptFiles(Application.Handle, True);
Application.OnMessage := AppOnMessage;
end;
procedure TForm1.WMDropFiles(var Msg: TWMDropFiles);
var
N: Word;
buffer: array[0..180] of Char;
item: TListItem;
begin with Msg do
begin
for N := 0 to DragQueryFile(Drop, $FFFFFFFF, buffer, 1) - 1 do
begin
DragQueryFile(Drop, N, Buffer, 80);
Item := ListView1.Items.Add;
item.Caption := StrPas(Buffer);
end;
DragFinish(Drop);
end;
end; end.
http://www.codeproject.com/shell/explorerdragdrop.asp 这里讲了MFC的实现,但我在Delphi没找到相应的COelDataSource类,,郁闷ing..............................