今
今夜有风
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);<br>var filename_now:string;<br>begin<br>filename_now:=trim(extractfilepath(application.ExeName)+'moive/'+combobox1.text);<br>showmessage(filename_now);//显示为:c:/delphi/movie/123.txt<br>ShellExecute(handle,'open',PChar(filename_now),nil,nil,SW_SHOWMAXIMIZED);//不能正常打开<br>其中combobox1中的值为123.txt(123.txt存放地址为c:/delphi/movie/123.txt)。请指教!<br><br>要是我直接<br>ShellExecute(handle,'open',PChar('c:/delphi/movie/123.txt'),nil,nil,SW_SHOWMAXIMIZED);<br>是可以打开的。但上面那样就不行了。为什么呢。搞不懂。怪事呀。<br><br>另外又试了这样也是行的:<br>filename_now:='c:/delphi/movie/123.txt';<br>ShellExecute(handle,'open',PChar(filename_now),nil,nil,SW_SHOWMAXIMIZED);