拖拉打开文件
2006-02-04 13:50:12 来源:WEB开发网核心提示:PRocedure DragDropFiles(Var message: TMessage); Message WM_DropFiles;Procedure Tfm_main.DragDropFiles(Var message: TMessage);Var p: Array[0..254] Of char; i:
PRocedure DragDropFiles(Var message: TMessage); Message WM_DropFiles;
Procedure Tfm_main.DragDropFiles(Var message: TMessage);
Var
p: Array[0..254] Of char;
i: Word;
Begin
Inherited;
i := DragQueryFile(Message.wParam, $FFFFFFFF, Nil, 0);
For i := 0 To i - 1 Do
Begin
DragQueryFile(Message.wParam, i, p, 255);
End;
Try
If FileExists(strPas(p)) Then
OpenFile(strPas(p));
Finally
DragFinish(HDROP(Message.WParam));
End;
End;
更多精彩
赞助商链接