Solved

How do you tell an existing instance of Windows Photo Viewer to load and display a different image?

Posted on 2013-11-01
2
635 Views
Last Modified: 2013-11-02
Is there a way to tell an instance of Windows Photo Viewer that I have started via Process.Start, to load and display a different image?

Dim fileName As String = "C:\Users\John\Blah Blah\Picture.jpg"

Dim photoViewerProcess As Process = Process.Start("rundll32 ""%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll"", ImageView_Fullscreen " & fileName)

Is there some sort of message I could send to the photoViewerProcess to tell it to load a different image?

I don't want to leave a whole bunch of photo viewers open if I end up wanting to display lots of images.

A workaround is to close the existing process and open a new one but I was wondering if I could just tell the current instance to switch images.
0
Comment
Question by:ou81aswell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39618861
The PhotoViewer is a standard C/C++ application, its neither COM or .NET, so it has not been designed to be controlled programmatically.

The only way I see to control it would be to use the SendKeys class. Its Send method sends text to the system as if it had been typed on the keyboard. Thus, if you know the shortcuts and keystrokes needed to open a file, you can send them with SendKeys.Send.

SendKeys can save the situation in cases where you cannot control an application directly. But because you cannot use it to send data to a given application. Since it goes through the keyboard system, the keys end up on whatever window has the focus.
0
 

Author Comment

by:ou81aswell
ID: 39618906
Thanks. I looked at the app and couldn't figure out how to get it to open a different image. There doesn't appear to be a menu option to do that so I won't be able to use good old SendKeys so I'm keeping track of the instance myself and closing it before displaying a different image.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question