GetOpenFileName<br>所有功能我可写不起<br>简单的实现<br>var<br> fnRec : tagOFNA;<br> StrFile: Array [0..1023] of Char;<br>begin<br> ZeroMemory(Addr(fnRec), SizeOf(tagOFNA));<br> ZeroMemory(Addr(StrFile), SizeOf(StrFile));<br><br> fnRec.lStructSize:= SizeOf(tagOFNA);<br> fnRec.hWndOwner:= Application.Handle;<br> fnRec.hInstance:= 0;<br> fnRec.lpstrFilter:=PChar('所有文件(*.*)'#0'*.*'#0'文本文件(*.txt)'#0'*.txt'#0#0);<br> fnRec.lpstrFile:= StrFile;<br> fnRec.nMaxFile:= 1024;<br> fnRec.lpstrTitle:= '打开文件';<br> GetOpenFileName(fnRec);<br>