Solved

Simulate Ctrl pressing

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
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 …

635 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