Thread: NOt REALLY UnDERstand!

  1. #1
    JOANNA
    Guest

    Angry NOt REALLY UnDERstand!

    Thanks,nvoight for last help.i think i can solve the previous problem already.in this question,i am not understand that much,so i would like to need urs help again. ) Create a line editor where the left,right,home,end,delete,backspace keys function perfectly. how do that? give me specific on this problem,
    generally,i know how to create a window first.But after that,
    how is it going to start!! HELP >>> ###

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    read your help files or refer to msdn for examples on creating a window. Store lines in a linked list. Again refer to msdn for information on trapping keyboard messages. See what you can come up with some research. Post some code of your own if you want further help.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    >Create a line editor where the left,right,home,end,delete,backspace keys function perfectly.

    hm... you could just place a CEdit element on the window.
    You wouldn't have to do anything yourself.

    It's very hard for us to guess what you already know, or
    how you want to do this, as there are many different ways.
    So if you could provide us with an example of what you did
    so far, I'm sure we can show you how to proceed.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    I don't quite get what you want, but you could try the following:

    you can poll any key (check if it's pressed or not) using the following fuction:

    SHORT GetKeyState(int nVirtKey);

    where nVirtKey is the virtual key code of the key you want to poll, you can replace it with

    VK_LEFT
    VK_RIGHT
    VK_UP
    VK_DOWN
    VK_BACK_SPACE
    VK_HOME
    VK_END
    VK_DELETE

    check the high order bit, if it's 1, the key is pressed.

    if you don't know how to check the high order bit, you can do it with a function like this:

    int CheckHighBit(SHORT c)
    {
    SHORT mask=(0 ¦ (1<<(sizeof(SHORT)-1)));
    if(c & mask)
    {
    return 1; //The high bit is on (The key is pressed)
    }
    else
    {
    return 0;
    }
    }


    good luck

    Oskilian

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 21
    Last Post: 10-14-2006, 04:38 AM
  2. Need software to help to understand C source code
    By Kincider in forum C++ Programming
    Replies: 1
    Last Post: 09-28-2006, 09:44 PM
  3. Replies: 13
    Last Post: 08-24-2006, 12:22 AM
  4. Need help to understand x["AC"] in the following code
    By jcourcel in forum C Programming
    Replies: 11
    Last Post: 06-06-2006, 01:13 AM
  5. I don't understand K&R example
    By rllovera in forum C Programming
    Replies: 8
    Last Post: 10-25-2004, 10:45 AM