不用获取当前鼠标点击的.JMT文件名和路径! <br><br>因为你已关联了此文件,所以双击会直接运行你的程序<br><br><br>procedure TForm1.WMDROPFILES(var Msg: TMessage);<br>var<br> a : Integer;<br> Buffer : array[0..255] of Char;<br>begin<br> a := DragQueryFile(Msg.wParam, $FFFFFFFF, Buffer, 255);<br> for a := 0 to a - 1 do<br> begin<br> DragQueryFile(Msg.wParam, a, Buffer, 255);<br> //文件名就在Buffer里面了,下面你可以做任何事<br> end;<br> DragFinish(Msg.wParam);<br>end;<br>procedure TForm1.FormCreate(Sender: TObject);<br><br>begin<br><br>DragAcceptFiles(Handle, True); //启动窗口对文件的接收<br>end;