Capturing the enter key

Posted on 2006-04-02
Last Modified: 2010-04-01

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.

Question by:khawaib
    LVL 3

    Accepted Solution

    Set keyboard hook
    and trap enter key

    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

    LVL 3

    Assisted Solution

    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
    //accept ch again here

    Prashant Sabnekar

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
    Article by: SunnyDark
    This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
    The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now