473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Program to execute keyboard commands

19
What would code look like for a program that just hit a key over and over in C?

(basically how would code a program to press a key as if it was manually pressed)
Jun 10 '08 #1
5 1866
jhaxo
57
If the os is windows i would try PostMessage to send a WM_Key message.
Jun 10 '08 #2
odin607
19
whats the code look like for it? im very unfamiliar with it, i looked up the syntax but kinda blew over my head
Jun 11 '08 #3
jhaxo
57
whats the code look like for it? im very unfamiliar with it, i looked up the syntax but kinda blew over my head
Is this an mfc program or sdk?

If its mfc just enter :: and begin typing PostMessage and intellisense should tell you the parameters you need.

Its been some time since i used this, sorry.
Jun 13 '08 #4
odin607
19
i dont know C++, i should have specified C

however if anyone can give me the C++ code to do it (and any other sort of libraries or whatever else is needed) i wouldnt mind using it at all

program i use is ms visual studio 2008


i tried the :: then looked through the options, theres no postmessage.. i assumed cause i didnt load a library (not sure which to load.. since i dont know C++)
Jun 14 '08 #5
jhaxo
57
i dont know C++, i should have specified C

however if anyone can give me the C++ code to do it (and any other sort of libraries or whatever else is needed) i wouldnt mind using it at all

program i use is ms visual studio 2008


i tried the :: then looked through the options, theres no postmessage.. i assumed cause i didnt load a library (not sure which to load.. since i dont know C++)

u need to include winuser.h.
i think the rule of the forum is we arent supposed to give out code unless the poster makes some kind of stab at it themseleves.
Jun 14 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Fernando Rodriguez | last post by:
Hi, How can I save the output of an external program, called with os.system()?
3
by: Kenneth McDonald | last post by:
After looking around at various editors, I've finally decided on (I think :-) ) Vim for my future work. (jed is a great editor, but doesn't do neat things like allow me to write python code to add...
3
by: Daragoth | last post by:
Hi, I'm writing a program using Metrowerks CodeWarrior 4.0 that determines the best possible combination of a data set by checking every possible combination. I found there were about 250,000,000...
27
by: cj | last post by:
I run this program and to exit click the X in the upper right corner. But apparently it isn't really ending the program. If I return to VB and make changes then try to rebuild the app it says the...
4
by: Brant Sears | last post by:
Hi. I'm new to Python and I am trying to use the latest release (2.5) on Windows XP. What I want to do is execute a program and have the results of the execution assigned to a variable....
0
by: sunrt | last post by:
We have an As400 system that has program which executes batch files which resides on the SQL server 7.0 computer . Those batch files run SQL server jobs using isql. The whole idea about this is...
22
Frinavale
by: Frinavale | last post by:
How To Use A Database In Your Program Many .NET solutions are database driven and so many of us often wonder how to access the database. To help you understand the answer to this question I've...
331
by: Xah Lee | last post by:
http://xahlee.org/emacs/modernization.html ] The Modernization of Emacs ---------------------------------------- THE PROBLEM Emacs is a great editor. It is perhaps the most powerful and...
1
Curtis Rutland
by: Curtis Rutland | last post by:
How To Use A Database In Your Program Part II This article is intended to extend Frinny’s excellent article: How to Use a Database in Your Program. Frinny’s article defines the basic concepts...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.