Solved

send key strokes to other applications when machine is locked

Posted on 2011-02-17
7
508 Views
Last Modified: 2012-05-11
I have a mainframe console interface (win 32 application) which gets automatically logged off after 10 min of inactivity. I am planning to create a small key triggering application in Delphi to send keystrokes to that console interface to make it active forever.

(1) My new application should be able to send automated key-presses to my console interface application.
(2) The new application should be able to send key presses even when the computer is locked.. An this is the important feature i am looking for.

I would love to hear from the Delphi experts here for ideas / code samples etc..
0
Comment
Question by:jimsweb
  • 4
  • 2
7 Comments
 
LVL 24

Expert Comment

by:jimyX
ID: 34914516
Are you talking about creating local application to run on that machine and send the key strokes?
0
 
LVL 8

Author Comment

by:jimsweb
ID: 34914627
yes. jimy.
Create a small Delphi application that can send key stroke (say enter key) to another windows application running in the PC.

NB: Mainframe console interface: It is a windows application that interact with mainframe. Usually mainframes a unix based, though the latest one is running on zOS.
0
 
LVL 24

Expert Comment

by:jimyX
ID: 34914648
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 24

Expert Comment

by:jimyX
ID: 34914674
To send to another window you can use "SendKeys" from the unit "SndKey32.pas":
http://delphi.about.com/od/adptips2004/a/bltip1104_3.htm

But since you just need to keep the session active by simulating a key press, you can just use "PostKeyEx32" by sending a vk_Control key press in a Timer.
I am not familiar with Mainframe console interface or zOS so I am not sure if this works though.
0
 
LVL 24

Accepted Solution

by:
jimyX earned 400 total points
ID: 34914861
You can set a suitable interval for the Timer (say 7000 ms):
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  PostKeyEx32(VK_CONTROL, [], False);
end;

Open in new window

"PostKeyEx32" can perform the key action on the active application that's why I am not using Enter/Return key because if the focus is moved unintentionally to another application then the key pressed can perform an unwanted actions (if the active application has the possibility to receive Enter on one of its controls).
0
 

Assisted Solution

by:SleekProductions
SleekProductions earned 100 total points
ID: 34924335
I might be wrong here, but I would have tried to:

1. Use WinSpy (part of MSDK?) or similar (you know those apps where you can move the mouse over a window and get its information, intended as debugging tools) to find out how to find the old applications target window in a safe way (that always work), by window class, title or something like that.

2. Posting a message to that window to keep it alive or (worst case) a keystroke (I know nothing about your target).

3. There should also be a way to check that the old app is still running (logged in or not) and if not run the window finding routine again and again until such a window is found.

The aim here being to have an app started when the machine is powered on (windows boots) that needs no attention at all.

Perhaps this task can be helped with things from www.madshi.org.
0
 
LVL 8

Author Closing Comment

by:jimsweb
ID: 34977172
Thanks you..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mapShare challenge 13 89
drawing animated level bar based on numbers 3 88
Problem to start Neon 20 85
Convert MS Word document to a PDF file 9 62
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now