Solved

Simulate Ctrl pressing

Posted on 2002-06-16
4
252 Views
Last Modified: 2013-11-20
Hi,
how do I simulate Control button pressing from my code ?

thanks,
Yoav.
0
Comment
Question by:yoavo
  • 2
4 Comments
 
LVL 4

Expert Comment

by:mblat
ID: 7082089
look at
SendMessage
WM_KEYDOWN
VK_CONTROL


That should do it...

Hope it helps...
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7082901
You can also use

         keybd_event( VK_CONTROL,
                      0x45,
                      KEYEVENTF_EXTENDEDKEY | 0,
                      0 );


GOOD LUCK
0
 

Author Comment

by:yoavo
ID: 7082942
I want to simulate a continious pressing...

1. simulate a ctrl pressing.
2. do something (while the Ctrl button is still pressed).
3. release the ctrl from being pressed.

Yoav.
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 50 total points
ID: 7082944
The keybd_event makes the status of the control key until

keybd_event( VK_CONTROL,
                      0x45,
                      KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,
                      0);

methos calls

So its suitable for you...

GOOD LUCK
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

762 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