4

Situation:

A GUI app contains functionality (off a menu option) that produces a frequently updated image to a directory.

A logged-in, running instance of the app is the ONLY source for this image (functionality 'reliant' on display device). I have researched this to death - it is a sad fact.

The GUI application offers COM interfaces, but none that generate the image.

GUI code cannot be change in the least (big surprise).

Requirement:

These current images are needed by other processes at various times.

Obvious solution:

A process that creates an instance of the GUI app and uses SendKeys to manipulate the controls to produce the image.

Roadblocks (do I need to elaborate)

Aside from the flakiness of Sendkeys - assuming that Sendkeys WAS reliable....

Sendkeys can't work when console session is locked (locked is production requirement)

SendMessage API can't send key combinations like 'shift/letter' (required to invoke menu option).

Questions

Is there any other way to programatically interact with the app when the session is locked?

Can a windows service unlock/lock the sesion at predetermined times - long enough to allow an image generation to occur.

I know, I know, its crap. ANY high level ideas and MOST opinions are appreciated ;)

Chris
  • 149
  • 6

1 Answers1

2

Virtual PC.

Lock the host, not the virtual machine.


But to actually answer your question: i don't think you can send keys to a locked computer. Why? What if there are multiple logged in sessions; which one would it send the keys to?

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
  • Ok, Virtual PC is an option - thanks. I am still reeling from the COM interface that actually generates (and requires) a running instance of the GUI. That floored me. Maybe I misunderstood, but I thought the beauty of COM was that you can get at functionality without being bound to an implementation. – Chris Dec 10 '09 at 15:36
  • Well COM is designed to separate usage from implementation (e.g. implementation can change as long as the interface doesn't change). In this case it sounds like they let people drive their UI using an interface; but you are still driving an interface. They could recode the application so that their UI drives underlying logic using interfaces - but then how much gain is there for how much payoff... – Ian Boyd Dec 10 '09 at 20:53