• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

Capturing the enter key

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
0
khawaib
Asked:
khawaib
2 Solutions
 
Raj_KauCommented:
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
0
 
Prashant SabnekarAVPCommented:
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
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now