how to check if an edit box is selected(or the cursor is in it)

This is a discussion on how to check if an edit box is selected(or the cursor is in it) within the Windows Programming forums, part of the Platform Specific Boards category; I was wandering if there is a CEdit function( or another) that can return a handle to a selected edit ...

  1. #1
    Registered User
    Join Date
    May 2005
    Location
    Toronto, Canada
    Posts
    257

    how to check if an edit box is selected(or the cursor is in it)

    I was wandering if there is a CEdit function( or another) that can return a handle to a selected edit box.

    I would like to use an if statement( something like
    if(there is a selected edit box == true)
    do this to it;

    How would I do it?
    Everything is relative...

  2. #2
    return 0;
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    89
    What exactly do you mean by "selected edit box"? If you want to check wether an edit box has the focus, you could do something like:

    Code:
    if(GetFocus() == handleToEditBox) {
        // Do something
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. allegro issues
    By mramazing in forum C++ Programming
    Replies: 1
    Last Post: 01-07-2009, 10:56 PM
  2. edit box
    By beene in forum Windows Programming
    Replies: 3
    Last Post: 11-11-2006, 03:40 AM
  3. WS_HSCROLL in ES_READONLY edit box error
    By Homunculus in forum Windows Programming
    Replies: 4
    Last Post: 02-13-2006, 07:46 AM
  4. check edit box value
    By commissar in forum Windows Programming
    Replies: 2
    Last Post: 02-23-2005, 12:29 AM
  5. Edit Box Questions PT. II
    By Quantrizi in forum Windows Programming
    Replies: 16
    Last Post: 08-12-2003, 10:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21