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 to get characters just deleted by BackSpace key(or Delete key)

How to get characters just deleted by BackSpace key(or Delete key)

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 2 Posters 3 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.
  • T Offline
    T Offline
    Truong D Toan
    wrote on last edited by
    #1

    Hi everyone, My name is Toan.I am studying about hook programming.And when I do my project,I wonder there is any way to get the characters just deleted by using Backspace key(or Delete key). Thanks for reading my question. (My English is not very good.Sorry for using any wrong words)

    M 1 Reply Last reply
    0
    • T Truong D Toan

      Hi everyone, My name is Toan.I am studying about hook programming.And when I do my project,I wonder there is any way to get the characters just deleted by using Backspace key(or Delete key). Thanks for reading my question. (My English is not very good.Sorry for using any wrong words)

      M Offline
      M Offline
      Manikandan
      wrote on last edited by
      #2

      I understand you are editing in an edit control which you expect to UNDO when you delete a character. Am I correct? If so use CEdit Clipboard Operations.;)

      T 1 Reply Last reply
      0
      • M Manikandan

        I understand you are editing in an edit control which you expect to UNDO when you delete a character. Am I correct? If so use CEdit Clipboard Operations.;)

        T Offline
        T Offline
        Truong D Toan
        wrote on last edited by
        #3

        Thanks Manikandan.But my problem is that I want to write a program processing input and output.For example,if the user press the Backspace key and the key deleted is 'a' the program will replace that character by character 'b'.

        M 1 Reply Last reply
        0
        • T Truong D Toan

          Thanks Manikandan.But my problem is that I want to write a program processing input and output.For example,if the user press the Backspace key and the key deleted is 'a' the program will replace that character by character 'b'.

          M Offline
          M Offline
          Manikandan
          wrote on last edited by
          #4

          May be this one helps you... BOOL CParentWnd::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN) { if(pMsg->hwnd == urCtrl.GetSafeHwnd()) { switch (pMsg->wParam ) { case VK_BACK_SPACE : {//TRY HERE} } } }

          T 1 Reply Last reply
          0
          • M Manikandan

            May be this one helps you... BOOL CParentWnd::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN) { if(pMsg->hwnd == urCtrl.GetSafeHwnd()) { switch (pMsg->wParam ) { case VK_BACK_SPACE : {//TRY HERE} } } }

            T Offline
            T Offline
            Truong D Toan
            wrote on last edited by
            #5

            Sorry for my confuse question.My project is a Dll component processing input and output.For example,when my program is running and you are working with MS Word,you press the Backspace and the character just deleted is 'a',my program hook that event and show a message "Hello".(or any other actions)

            T 1 Reply Last reply
            0
            • T Truong D Toan

              Sorry for my confuse question.My project is a Dll component processing input and output.For example,when my program is running and you are working with MS Word,you press the Backspace and the character just deleted is 'a',my program hook that event and show a message "Hello".(or any other actions)

              T Offline
              T Offline
              Truong D Toan
              wrote on last edited by
              #6

              Thanks for your helping,Manikandan

              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