CFanatic

Go Back   CFanatic > Programming > Win32 Programming

Join CFanatic Forum Now

how to send more than one keystrokes at a time? topic posted under Win32 Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-12-2007, 04:28 PM
Junior Member
 
Join Date: Sep 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
chrono is on a distinguished road
| More
how to send more than one keystrokes at a time?

if I wish to send three inputs(for example Ctrl,Alt,Z) from the keyboard, but at the same time, not one key after another, so what can I do?
Reply With Quote
  #2  
Old 09-12-2007, 05:43 PM
Junior Member
 
Join Date: Sep 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
chrono is on a distinguished road
| More
Re: how to send more than one keystrokes at a time?

question solved
Reply With Quote
  #3  
Old 09-12-2007, 10:00 PM
shabbir's Avatar
Administrator
 
Join Date: Sep 2006
Posts: 1,163
Thanks: 57
Thanked 63 Times in 44 Posts
shabbir has a spectacular aura aboutshabbir has a spectacular aura about
| More
Re: how to send more than one keystrokes at a time?

Quote:
Originally Posted by chrono View Post
question solved
Do you mind sharing how you did that? I guess its just plain simple postmessage.
Reply With Quote
  #4  
Old 09-13-2007, 07:24 PM
Junior Member
 
Join Date: Sep 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
chrono is on a distinguished road
| More
Re: how to send more than one keystrokes at a time?

Oh ok sure

from codeproject website to send three keys Ctrl, Alt, and Z:
keybd_event(VK_CONTROL, 0x9d, 0,0); //ctrl press
keybd_event(VK_MENU, 0xb8, 0,0); //alt press
keybd_event((BYTE)VkKeyScan('Z'), 0xac, 0,0); //Z press

keybd_event(VK_CONTROL, 0x9d, KEYEVENTF_KEYUP,0); //ctrl release
keybd_event(VK_MENU, 0xb8, KEYEVENTF_KEYUP,0); //alt release
keybd_event((BYTE)VkKeyScan('Z'), 0xac, KEYEVENTF_KEYUP,0); //Z release
Reply With Quote
  #5  
Old 09-14-2007, 11:09 AM
Junior Member
 
Join Date: Sep 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
chrono is on a distinguished road
| More
Re: how to send more than one keystrokes at a time?

I didn't read carefully of your previous post, shabbir. To answer your post, no I didn't use PostMessage, but I did use the WM_COMMAND, where the user clicks on the button on the user interface then it will send out three keys input which I use keybd_event().
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Log idle time meniscus C# Programming 0 12-19-2007 06:45 AM
Variables that change themselves over time CODINGMASTER C++ Programming 4 09-17-2007 11:49 AM
One of the best comeback lines of all time… JokesBot The Lounge 0 09-16-2006 09:43 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 02:46 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board