Solved

Simulate Ctrl pressing

Posted on 2002-06-16
4
253 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

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
Include multiple hostnames in this command? 3 53
Add content to output file 4 62
bigDiff challenge 17 84
sum13 challenge 24 90
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

896 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

18 Experts available now in Live!

Get 1:1 Help Now