Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Paradox to control other windows programs 1

Status
Not open for further replies.

corox

IS-IT--Management
Sep 9, 2002
3
US
I have a non-Paradox windows applications that converts files from one format to another in a batch-type operation (i.e. one after the other). Periodically, this application brings up a dialog box asking for user verification. It is a Yes/No dialog box with the default focus on Yes (which is good). The dialog box is uniquely identifiable as a separate Windows Handle. With this annoying popup dialog box, unattended operation is not possible. I would like to create a Paradox (8) form that periodically (every 30 seconds or so) looks for the presence of a specific Windows Handle and sends it an Enter Key.

The sendkeys function seems to be restricted to an application that was started by the Paradox Execute command which won't be the case for the dialog popup. Anyone familiar with winsendmessage or similar functionality may be able to help. Again, what I want to simulate is the Enter Key.

Thanks,

COROX - Colorado Rockies
 
I would take a look at the DDE stuff in the help files. It looks like you could open a DDE session with the offending program (after seeing if the dialog was open using enumWindowHandles()), then send your enter key and then close the session.

Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
<<The sendkeys function seems to be restricted to an application that was started by the Paradox Execute command which won't be the case for the dialog popup. >>

not so, actually. Just the program with focus, as it just stuffs the keyboard buffer.

Use enumWindowNames() and enumWindowHandles() to get the handle of the window you want. make sure it has focus, and use sendkeys().

If this doesn't work it'll be because the dialog box is system-modal. In which case, I _believe_ that you should be able to stuff the keyboard buffer with <enter> keystrokes in advance ...

hth

Mike
 
So....I can create a PDOX form that wakes up periodically, does an enumwindownames to see if the popup is present. If so, issue the sendkeys ({ENTER}) and goes back to sleep to wake up again and repeat. Sounds easy enough. This presumes that the popup I want has focus, which it should if I'm doing this as an unattended operation when the PC isn't doing anything else.

Just in case...is there a way to force a window to get focus from PDOX?

Thanks for the advice. I'll try tonight.
 
BINGO! Thanks LeMike for the clarification on sendkeys. I created a form that wakes up every 10 seconds, takes a peek at the active windows via enumwindownames, if it sees the window waiting for the acknowledgement sends the enter key via sendkeys and goes back to sleep. It runs minimized and allowed me to process over a 100 files last night. I have 2000 more to go, but it will be painless now.

I'm gonna try this on a PC that has PDOX 8 Runtime to see if I can get this going on multiple PCs.

Thanks again...COROX.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top