http://lazarus-ccr.sourceforge.net/docs/lcl/lclintf/opendocument.html
uses ...process.....var my_pipe : TProcess;begin //proccess my_pipe:=TProcess.Create(nil); my_pipe.CommandLine:=cmd_value+' my_file';('firefox my.html' :sample) my_pipe.Options:=[poUsePipes]; my_pipe.Execute; my_pipe.Free;p.s. work well(linux, win)
It wouldn't find the procedure.....It didn't find cmd_Value
explorer.exe c:\a.bmp
Quote from: captain jaster on December 27, 2010, 08:55:39 pmIt wouldn't find the procedure.....It didn't find cmd_Valueare you kidding us?
ShellExecute(0, 'open', 'filename', '', nil, SW_SHOWNORMAL);
Quote from: theo on December 27, 2010, 09:40:44 pmQuote from: captain jaster on December 27, 2010, 08:55:39 pmIt wouldn't find the procedure.....It didn't find cmd_Valueare you kidding us? Probably not... OpenDocument is not available in LCL 0.9.28.2 and lower and for TProcess you still need the full path of the executable (and cmd_Value is *not* defined in the code that was posted!).For Windows you could use ShellExecute (unit Windows):Code: [Select]ShellExecute(0, 'open', 'filename', '', nil, SW_SHOWNORMAL);Gr.Quote from: seba22 on December 27, 2010, 10:02:10 pmDon't kill if i'm wrong but in windows you can try. my_pipe.CommandLine:='explorer.exe c:\myfile.html';explorer.exe should pass that myfile.html for default application.Code: [Select]explorer.exe c:\a.bmp should run paint, with a.bmp loaded.Dirk.
Don't kill if i'm wrong but in windows you can try. my_pipe.CommandLine:='explorer.exe c:\myfile.html';explorer.exe should pass that myfile.html for default application.Code: [Select]explorer.exe c:\a.bmp should run paint, with a.bmp loaded.