call external program

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how can i start this program from my form ?

rundll32.exe c:\windows\system32\shimgvw.dll,ImageView_Fullscreen image.tif ?

this is Windows Pictures and Fax Viewer from XP and I want to call it from
my app to displat an image (I need it, because it can handle multiple pages
tiffs)

i also have made use of a var sysFolder =
Environment.GetFolderPath(Environment.SpecialFolder.System); to replace
'c:\windows\system32'

i can't even start the WPFV empty (w/o an image load into it)
 
here is a piece of code that normally would work

string curpath = System.IO.Directory.GetCurrentDirectory();
string sysFolder =
Environment.GetFolderPath(Environment.SpecialFolder.System);
System.IO.Directory.SetCurrentDirectory(sysFolder);
System.Diagnostics.Process.Start("rundll32.exe " + sysFolder
+"\\shimgvw.dll,ImageView_Fullscreen c:\\modi\\starlac.tif");
System.IO.Directory.SetCurrentDirectory(curpath);

i'm changing to the system directory before executing the command and still
nothing hapens
 
Hi,

Did you try to use:

public static Process Start(
string fileName,
string arguments
);

fileName="rundll32.exe";
arguments=sysFolder + "\\shimgvw.dll,ImageView_Fullscreen
c:\\modi\\starlac.tif";

HTH
Marcin
 
Back
Top