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. 890818 - message dispatching

890818 - message dispatching

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++learning
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.
  • I Offline
    I Offline
    ilostmyid2
    wrote on last edited by
    #1

    hi i created a new project, a dialog based MFC application. i inserted a button in the dialog with id IDC_BUTTON1. i added a member variable of type AcButton derived from CButton to the dialog object to handle WM_LBUTTONDOWN on the button. 1. why is the button enabled while there's no handler for the IDC_BUTTON1 command and i've not included ON_COMMAND_UPDATE_UI in the message map of the dialog? in another words, why the button is enabled by default?! in this case, i see that the AcButton::OnLButtonDown is called. in the resource editor, i disable the button. in such a case, the AcButton::OnLButtonDown is not called anymore by clicking on the button. instead, the WM_LBUTTONDOWN is received by the dialog (the parent of the button). 2. who decides to do this?! 3. how can i make mouse events be received by a control in a dialog which cannot be focused nor get enabled? let's say eg. a static text, how can get the mouse events? i hope i could clarify my three questions. plz answer my by numbers. thx

    M 1 Reply Last reply
    0
    • I ilostmyid2

      hi i created a new project, a dialog based MFC application. i inserted a button in the dialog with id IDC_BUTTON1. i added a member variable of type AcButton derived from CButton to the dialog object to handle WM_LBUTTONDOWN on the button. 1. why is the button enabled while there's no handler for the IDC_BUTTON1 command and i've not included ON_COMMAND_UPDATE_UI in the message map of the dialog? in another words, why the button is enabled by default?! in this case, i see that the AcButton::OnLButtonDown is called. in the resource editor, i disable the button. in such a case, the AcButton::OnLButtonDown is not called anymore by clicking on the button. instead, the WM_LBUTTONDOWN is received by the dialog (the parent of the button). 2. who decides to do this?! 3. how can i make mouse events be received by a control in a dialog which cannot be focused nor get enabled? let's say eg. a static text, how can get the mouse events? i hope i could clarify my three questions. plz answer my by numbers. thx

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

      What does the 890818 stand for? *curious*

      Chat in Europe :java: Now with 24% more Twitter

      I 1 Reply Last reply
      0
      • M Moak

        What does the 890818 stand for? *curious*

        Chat in Europe :java: Now with 24% more Twitter

        I Offline
        I Offline
        ilostmyid2
        wrote on last edited by
        #3

        this kind of tag is helpful in the following ways for me: 1. i may find my own posts between a plenty of posts without requirement to read them one by one. 2. today is the 18th of the 8th month of the year of 1389. we totally use a different calendar which is the most accurate one in the world, instead of Gregorian. this helps me find when i had posted the question. 3. this makes ppl like u ask the question as a reply to my post. then i get happy to have an answer to my question, for a short moment of the time. :D lol

        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