Solved

sendkeys

Posted on 1997-05-16
5
420 Views
Last Modified: 2010-04-04
I'm using the sendkeys function that was suggested
here, what happens is that when I send a keystroke
and the menu opens, my other procedures stop working,
al least until I close the menu. I want to send a keystroke
and open the menu, do a pause for a set time, then move
down the menu--this is for a demo and it has to be native
to the program. How do I get around delphi not running my
routines with the menu open? Any suggestions would be
welcome.
0
Comment
Question by:jenny042797
[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
5 Comments
 

Expert Comment

by:sbehrens
ID: 1336347
Assuming you are using Delphi 2.0/3.0: Put the routine that
sends keys into its own thread. That way, it is (at least moderately) independent from the rest of the program being busy.

If you are using Delphi 1.0, please rate this an F :)

Soenke
0
 
LVL 3

Expert Comment

by:sperling
ID: 1336348
To create a good-looking demo, use the WH_JOURNALRECORD and WH_JOURNALPLAYBACK hooks. (Look up SetWindowsHookEx) These allows you to record mouse movements/clicks and keypresses, and to play them back exactly as entered. The mouse and the keyboard will also be disabled while playing back.

It is a bit of work to code this, but it makes great demos of your apps. Works for both 16 and 32-bit windows.

Regards,

Erik.
0
 

Author Comment

by:jenny042797
ID: 1336349
Thanks, but unfortunately I am using 1.0. The demo needs
to run on cheesy systems.

0
 
LVL 1

Accepted Solution

by:
slp earned 100 total points
ID: 1336350
Teixiera and Pacheco's _Delphi Developer's Guide_ has a very nice implementation of a SendKeys() function.  The two editions of the book contain versions for Win16 and Win32.  This function alone is almost worth the price of the book; considering how great it is otherwise (I'd rate it as the TOP general Delphi programming book), it's a bargain.

HTH

SLP

0
 

Author Comment

by:jenny042797
ID: 1336351
any idea why procedrues stop executing when the menu is opened?

sendkey (vk_menu)
   pause a sec
    stops here and doesnt come back
sendkey(vk_down)

where as taking out the pause and stuff in between it will work
but too fast to follow.

The problem isnt in the pause either.

Oh, I've seen the book, now I have an excuse to buy it.
thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

695 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