We help IT Professionals succeed at work.

Capturing the enter key

khawaib
khawaib asked
on
Medium Priority
232 Views
Last Modified: 2010-04-01
Hi!

I have a win32 application and I am not using any MFC. I have a chatting window and I am trying to send message when user presses the enter key.

 Can you plz show me example code where I can see how to do that.

Thnx
Comment
Watch Question

Commented:
Set keyboard hook
and trap enter key


http://www.codeproject.com/tools/usagefinder.asp
http://www.codeguru.com/Cpp/W-P/system/keyboard/article.php/c5699/
http://www.codeproject.com/dll/keyboardhook.asp



if its not solve your problem then you can tell me then i tell you other method also
but i think this is the good one


Raj

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
We can not give code, but we can give you some way odoing that,

accept char by char until u find enter key

// accept a charecter ch here
while( ch!='\r'){
...Do processing
ch=NULL:
//accept ch again here
}

Regards
Prashant Sabnekar
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.