Solved

Simulate Ctrl pressing

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
How to know only "File created" with EventLog 3 35
maxBlock challenge 30 150
sum28 challenge 31 117
wordappend challenge 8 247
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…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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