我知道要使窗口接收拖动过来的file可以在在 FormCreate中加一句:
DragAcceptFiles(Self.Handle,Enabled);
但是,如果我要接受的是浏览器中托过来的超连接,并且在程序中得到我拖过来的超连接地址,要怎么做呢?
DragAcceptFiles(Self.Handle,Enabled);
但是,如果我要接受的是浏览器中托过来的超连接,并且在程序中得到我拖过来的超连接地址,要怎么做呢?
解决方案 »
- 使用IdSMTP1控件 发邮件,为何目标收到信总让发收条呢?
- ACCESS的时间查询
- DBGridEh TITLE 属性为BUTTON ,dbhaotosortmarking=true,出现排序小箭头了,为什么不能排序?
- 这么在运行时设置dbgrid中列的宽度呢??
- 寻图形控件
- 又一超高难度的问题,菜鸟别进来!放心,不是叫你做操作系统!
- 怎样达到矩形框的旋转这个功能
- ssl2000(大宋) & wlw88(飞扬) 请接分
- 求助!!!如何使鼠标移动到的控件高亮显示
- 如果有这样的SQL语句,select * from TableName ,如果没有返回值,则showmessage('没有返回值');请问各位superman,怎样确定返回值为NULL?
- 为什么我的DELPHI6.0里的在new 中的webservices栏中,没有Invokable Wozard 导向?
- 动态创建RAVE报表时出现的问题
private
procedure Memo1Message(var Msg: TMsg; var Handled: Boolean);
...procedure TForm1.FormCreate(Sender: TObject);
begin
DragAcceptFiles(Memo1.Handle, TRUE);
Application.OnMessage := Memo1Message;
end;procedure TForm1.Memo1Message(var Msg: TMsg; var Handled: Boolean);
var
nFiles, I: Integer;
Filename: string;
begin
if (Msg.message = WM_DROPFILES) and (msg.hwnd = Memo1.Handle) then
begin
nFiles := DragQueryFile (Msg.wParam, $FFFFFFFF, nil, 0);
try
for I := 0 to nFiles - 1 do
begin
SetLength (Filename, 80);
DragQueryFile (Msg.wParam, I, PChar (Filename), 80);
Filename := PChar (Filename);
Memo1.lines.add(filename);
end;
finally
DragFinish (Msg.wParam);
end;
Handled := True;
end;
end;(二)捕捉IE超连接超级连接和其他文件一些文件属性,通过delphi自带的控件实现是比较困难的,由于delphi封装的控件并没有把有些比较特殊的属性封装进去。
但我们可以在delphi下使用微软的控件来实现,下面例子是可以将浏览器超级连接地址放入richedit中:菜单:component/import activex control/microsoft rich textbox control...
然后install在RichTextBox1的OLEDragDrop事件中实现:
procedure TForm1.RichTextBox1OLEDragDrop(Sender: TObject;
var Data: IVBDataObject; var Effect: Integer; var Button,
Shift: Smallint; var x, y: Single);
begin
RichTextBox1.Text:=data.GetData(1);
end;关于如何用delphi封装的控件实现(二),请高手来解答,或者写些ocx吧。