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. New notification code for subclassed CButton

New notification code for subclassed CButton

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionannouncement
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.
  • R Offline
    R Offline
    Roger Stoltz
    wrote on last edited by
    #1

    I want a different behaviour for a button when keeping it pressed with the LButton of the mouse. To repeat the BN_CLICKED using a timer inside the new class is no big deal, it all works fine and dandy. The thing is that I want to add a new notification code to be repeated while the button is pushed in, something like BN_KEPTDOWN, but I'd like to pick a value that doesn't conflict with some other notification code in a later release of DevStudio and/or MFC (running on VC6 at the moment). Are there some guidelines regarding creating new notification codes? I tried MSDN but I was unable to find anything about this. Links, anyone? -- Roger


    It's supposed to be hard, otherwise anybody could do it!

    W 1 Reply Last reply
    0
    • R Roger Stoltz

      I want a different behaviour for a button when keeping it pressed with the LButton of the mouse. To repeat the BN_CLICKED using a timer inside the new class is no big deal, it all works fine and dandy. The thing is that I want to add a new notification code to be repeated while the button is pushed in, something like BN_KEPTDOWN, but I'd like to pick a value that doesn't conflict with some other notification code in a later release of DevStudio and/or MFC (running on VC6 at the moment). Are there some guidelines regarding creating new notification codes? I tried MSDN but I was unable to find anything about this. Links, anyone? -- Roger


      It's supposed to be hard, otherwise anybody could do it!

      W Offline
      W Offline
      willy_total
      wrote on last edited by
      #2

      you can use WM_USER then just add to it if you need more than one

      R 1 Reply Last reply
      0
      • W willy_total

        you can use WM_USER then just add to it if you need more than one

        R Offline
        R Offline
        Roger Stoltz
        wrote on last edited by
        #3

        Probably, but WM_USER has nothing to do with notification codes since WM_USER is a message ID. When you handle the BN_CLICKED event, a WM_COMMAND message is sent from the child to the parent with a 16-bit notification code in the WPARAM parameter of the message. The other 16 bits are the ID of the control and the LPARAM parameter is the window handle of the control. This is normally taken care of by the framework/MFC. What I want is a new notification code that is guaranteed not to conflict with other notification codes for buttons. -- Roger


        It's supposed to be hard, otherwise anybody could do it!

        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