Solved

Simulate Ctrl pressing

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

thanks,
Yoav.
0
Comment
Question by:yoavo
[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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

729 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