高手们看过来-几个难题!(150分)

L

lb415

Unregistered / Unconfirmed
GUEST, unregistred user!
1.DragAcceptFiles可以允许文件的拖动,<br>&nbsp; 如何将一段文字拖进程序的MEMO中呢?<br>2.怎样实现文件和文字的拖动只对Form中的<br>&nbsp; ListBox或者Memo有效?<br>3.如果采用修改注册表的方式(如Delphi里的<br>&nbsp; ContMenu)在右键菜单中调用自己的程序,<br>&nbsp; 如何把文件名传递给程序?
 
写注册表: &nbsp; <br>&nbsp; &nbsp;reg.OpenKey('*/shell/mysoft/command',true);<br>&nbsp; &nbsp;reg.WriteString('',application.ExeName+' "%1"');<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ~~~~!<br>...<br>有了上面的基础你就可以在程序开始的时候用:<br>&nbsp; &nbsp;if paramcount&lt;&gt;0 and fileexists(paramstr(1)) then<br>&nbsp; &nbsp; filename := paramstr(1);<br>现在字符串filename里面的就是文件名参数.
 
type TDragDropEvent = procedure(Sender, Source: TObject; X, Y: Integer) of object;<br>由tobject判断,获取文字,添到tmemo
 
那第二条如何实现呢?
 
在listbox和memo中将ondragover事件中的accept属性设为true就行了
 
第一条walala能否说得再详细一些!
 
请大家帮个忙,第一条具体如何实现
 
when dragging, send a COPY message to the control or form<br>then send a PASTE message to your control<br><br>or you can consult source code of DRAG&amp;DROP components.
 
多人接受答案了。
 
大富翁的email系统不正常<br>我答了问题老是收不到返回信息<br>sorry
 

Similar threads

D
回复
0
查看
746
DelphiTeacher的专栏
D
D
回复
0
查看
749
DelphiTeacher的专栏
D
D
回复
0
查看
595
DelphiTeacher的专栏
D
顶部