views:

437

answers:

2

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 ;)

+1  A: 

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
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
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
A: 

Hi, I have a macro for "Bussiness object" software which will refreh gsm oss statictics(server).To run this macro I have a vb script in which "sendKey" function is used to send the password to "bussiness object" .The macro runs well with xp scheduler.But if the computer is locked the macro does not run.Only bussiness object is opened but password is not passed.so the macro can not run.Now will anyone respond with any solution please....

Rashed

related questions