Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How Do I Detect Activity In a CEdit Control ?

How Do I Detect Activity In a CEdit Control ?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++helpannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MJ_Karas
    wrote on last edited by
    #1

    With the MFC class CEdit it is possible to receive notification messages for EN_UPDATE (for when the control is about to display altered text) and EN_CHANGE (for when the control has finished the display of altered text). Can anyone tell me how I can get notification to my dialog when the user is simply moving the cursor caret around inside the edit control and the text is not changing? I am using a single line version of the CEdit control. Your help would be greatly appreciated. If you need further information about what I am doing or in order to answer my question please leave a reply post here and I will answer back. Thanks Mike

    J 1 Reply Last reply
    0
    • M MJ_Karas

      With the MFC class CEdit it is possible to receive notification messages for EN_UPDATE (for when the control is about to display altered text) and EN_CHANGE (for when the control has finished the display of altered text). Can anyone tell me how I can get notification to my dialog when the user is simply moving the cursor caret around inside the edit control and the text is not changing? I am using a single line version of the CEdit control. Your help would be greatly appreciated. If you need further information about what I am doing or in order to answer my question please leave a reply post here and I will answer back. Thanks Mike

      J Offline
      J Offline
      Jon Hulatt
      wrote on last edited by
      #2

      You'd have to handle a variety of messages. WM_CHAR for characters; i believe this message is sent even if it's only a system key like a cursor key being pressed. Also, you'd want some mouse button messages... WM_LBUTTONDOWN or UP , for example. Because the user can reposition the cursor with a mouse click. Jon Sorry to dissapoint you all with my lack of a witty or poignant signature.

      M 1 Reply Last reply
      0
      • J Jon Hulatt

        You'd have to handle a variety of messages. WM_CHAR for characters; i believe this message is sent even if it's only a system key like a cursor key being pressed. Also, you'd want some mouse button messages... WM_LBUTTONDOWN or UP , for example. Because the user can reposition the cursor with a mouse click. Jon Sorry to dissapoint you all with my lack of a witty or poignant signature.

        M Offline
        M Offline
        MJ_Karas
        wrote on last edited by
        #3

        Thanks Jon. Your idea gave me the encouragement to do what needed to be done. I subclassed the CEdit control with a class that has message handlers for all of the appropriate messages that potentially change the caret position in the edit box. These include WM_KEYDOWN, WM_KEYUP, the three left moouse button messages, the three right mouse button messages and the reflected CHANGE message. It turns out that WM_CHAR is not so very useful as this does not get sent except for typed characters that will be modifying the edit box text contents. One sees no response there except for the likes of the arrow keys that actually move the caret around. Thanks again. Mike

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups