我知道要使窗口接收拖动过来的file可以在在 FormCreate中加一句:
DragAcceptFiles(Self.Handle,Enabled);
但是,如果我要接受的是浏览器中托过来的超连接,并且在程序中得到我拖过来的超连接地址,要怎么做呢?
DragAcceptFiles(Self.Handle,Enabled);
但是,如果我要接受的是浏览器中托过来的超连接,并且在程序中得到我拖过来的超连接地址,要怎么做呢?
解决方案 »
- 求一个类似图片中的控件...
- 升级
- 问一个有意思的题目,呵呵
- delphi能将编辑好的文本按照格式,颜色,图片等信息生成html
- 服务程序(Service Application)的描述如何在程序中实现?
- 已取得硬盘的id号,什么橛的算法可以进行运算后,得到的字符是0-9和A-Z呢?
- 课程设计马上要交 求助各位大鸟!
- myvar:=StrtoInt(edit2.text);query1.sql.add('update change set 距离=? where 代号='''+edit1.text+'''');
- ☆☆☆☆☆☆☆☆<<Delphi6函数大全>>(附:光盘)☆☆☆☆☆☆☆☆☆☆
- 寻找help & manual的最新版
- 为什么我的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吧。