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. Promblem with Dynamic Control Event Handling.

Promblem with Dynamic Control Event Handling.

Scheduled Pinned Locked Moved C / C++ / MFC
jsonhelp
4 Posts 3 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.
  • U Offline
    U Offline
    uday kiran janaswamy
    wrote on last edited by
    #1

    Hi all, I am creating a Edit Box Dynamically in CDialog Box. And when i Right Click on the Edit Box what i have created i want to show a Menu. //=========================================================================== //Source for Creating the Edit Box when mouse is clicked. CEdit *ptr = new CEdit; ptr->Create(WS_VISIBLE|WS_CHILD|WS_BORDER|WS_TABSTOP|ES_AUTOHSCROLL,CRect(point.x,point.y,point.x +100, point.y +20),this,NULL); Note : the Last Parameter is the ID for the Edit Control in Create(...) Api. //=========================================================================== Now i am not able to handle an event to this dynamically created Edit Box. I want to Handle the RButtonDown Event for every Dyanmically Created Edit Box. i Mean when ever i Right Click on the EditBox what i have Created i want to Populate a Menu using TrackPopUpMenu(...) Api. please help me out. Uday kiran

    C 1 Reply Last reply
    0
    • U uday kiran janaswamy

      Hi all, I am creating a Edit Box Dynamically in CDialog Box. And when i Right Click on the Edit Box what i have created i want to show a Menu. //=========================================================================== //Source for Creating the Edit Box when mouse is clicked. CEdit *ptr = new CEdit; ptr->Create(WS_VISIBLE|WS_CHILD|WS_BORDER|WS_TABSTOP|ES_AUTOHSCROLL,CRect(point.x,point.y,point.x +100, point.y +20),this,NULL); Note : the Last Parameter is the ID for the Edit Control in Create(...) Api. //=========================================================================== Now i am not able to handle an event to this dynamically created Edit Box. I want to Handle the RButtonDown Event for every Dyanmically Created Edit Box. i Mean when ever i Right Click on the EditBox what i have Created i want to Populate a Menu using TrackPopUpMenu(...) Api. please help me out. Uday kiran

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      You need to add the entries of the control in the message map manually. The best way to do it is to look how class wizard does and do the same for your control. So, add an edit box to your dialog, add the handler with classwizard look at the message maps entries (in the dialog class header file and source file) and see what has changed. Now you can do the same for your control.


      Cédric Moonen Software developer
      Charting control [Updated - v1.1]

      U 1 Reply Last reply
      0
      • C Cedric Moonen

        You need to add the entries of the control in the message map manually. The best way to do it is to look how class wizard does and do the same for your control. So, add an edit box to your dialog, add the handler with classwizard look at the message maps entries (in the dialog class header file and source file) and see what has changed. Now you can do the same for your control.


        Cédric Moonen Software developer
        Charting control [Updated - v1.1]

        U Offline
        U Offline
        uday kiran janaswamy
        wrote on last edited by
        #3

        Hi Cedric Moonen, My Doubt is that the CEditBox doesn't Handle the WM_RBUTTON_DOWN Event. The Events handled for the Edit Box are. EN_CHANGE,EN_ERRORSPACE,EN_HSCROLL,EN_KILLFOCUS,EN_MAXTEXT,EN_SETFOCUS,EN_UPDATE. What about the Event Handler of WM_RBUTTON_WOWN Event. please tell me your suggestions. Uday kiran

        J 1 Reply Last reply
        0
        • U uday kiran janaswamy

          Hi Cedric Moonen, My Doubt is that the CEditBox doesn't Handle the WM_RBUTTON_DOWN Event. The Events handled for the Edit Box are. EN_CHANGE,EN_ERRORSPACE,EN_HSCROLL,EN_KILLFOCUS,EN_MAXTEXT,EN_SETFOCUS,EN_UPDATE. What about the Event Handler of WM_RBUTTON_WOWN Event. please tell me your suggestions. Uday kiran

          J Offline
          J Offline
          Justin Tay
          wrote on last edited by
          #4

          uday kiran janaswamy wrote:

          The Events handled for the Edit Box are. EN_CHANGE,EN_ERRORSPACE,EN_HSCROLL,EN_KILLFOCUS,EN_MAXTEXT,EN_SETFOCUS,EN_UPDATE.

          These aren't events handled by the edit control. These are notifications posted by the edit control to it's parent. In that case you can use WM_PARENTNOTIFY[^]. Or if your only interested in a right-click there is NM_RCLICK[^] notifications.

          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