title: Show Windows 7 Windows Picture Viewer in Windows 8
body: <p>On Windows 8 I tried to run the code shown below to show the old Windows 7 Picture Viewer, but it returns an error.   On Windows 8 I can find C:\Program Files (x86)\Windows Photo Viewer\PhotoViewer.dll but I think that is the newer Windows 8 metro app.  I think the older Windows Picture Viewer is 'c:\windows\system32\shimgvw.dll.  I'd like to preview the image with the desktop application style rather than Metro.</p>
  
  <p>I tried both, but both return that the file does not have a program associated with it?
  What am I messing up?</p>
  
  <pre><code>var
  SEInfo: TShellExecuteInfo;
  ExitCode: DWORD;
  ExecuteFile, ParamString, StartInString: string;
  
  ExecuteFile:='c:\windows\system32\shimgvw.dll';
  FillChar(SEInfo, SizeOf(SEInfo), 0) ;
  SEInfo.cbSize := SizeOf(TShellExecuteInfo);
  with SEInfo do begin
    fMask := SEE_MASK_NOCLOSEPROCESS;
    Wnd := Application.Handle;
    lpFile := PChar(ExecuteFile);
    nShow := SW_SHOWNORMAL;
    lpParameters := PChar('ImageView_Fullscreen');
  end;
  if ShellExecuteEx(@SEInfo) then begin
  repeat
     Application.ProcessMessages;
     GetExitCodeProcess(SEInfo.hProcess, ExitCode) ;
   until (ExitCode &lt;&gt; STILL_ACTIVE) or Application.Terminated;
     ShowMessage('Windows Picture Viewer terminated') ;
   end
      else ShowMessage('Error starting Windows Picture Viewer') ;
  </code></pre>
  
  <p>I have not used ShellExecuteEx before so the basis for the code came from <a href="http://delphi.about.com/od/windowsshellapi/a/executeprogram.htm" rel="nofollow">here</a>.</p>