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. ATL / WTL / STL
  4. command_id_handler

command_id_handler

Scheduled Pinned Locked Moved ATL / WTL / STL
questionhelp
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.
  • H Offline
    H Offline
    harishv
    wrote on last edited by
    #1

    :confused:Hi, I have a dialog that is invoked form a property sheet that has various controls (edit boxes, check boxes) in my dialog. I need to know if the user modified (touched) any of these. There are function handlers for all of the controls (thru the COMMAND_ID_HANDLER macro). I expcted these to be called only when the user changes something. But these functions are being invoked when the dialog shows up!! What is the problem? Regards HV

    H 1 Reply Last reply
    0
    • H harishv

      :confused:Hi, I have a dialog that is invoked form a property sheet that has various controls (edit boxes, check boxes) in my dialog. I need to know if the user modified (touched) any of these. There are function handlers for all of the controls (thru the COMMAND_ID_HANDLER macro). I expcted these to be called only when the user changes something. But these functions are being invoked when the dialog shows up!! What is the problem? Regards HV

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Do you put data in those controls (like defaults or previous values) when you show the dialog? That would cause a change. You'll just have to ignore those until the dialog is initialized and displayed. Besides, when you use COMMAND_ID_HANDLER, all messages sent to the control invoke your handler. If all you want to do is watch for changes, try this:

      COMMAND_HANDLER(IDC_MYCTL, EN_CHANGE, OnChange)

      ...or at least something like it. If you initialize the dialog with text in the controls, you'll still have to ignore it at such time (perhaps through a state variable), but once the dialog is shown, any change on that control would call your handler. Also, different controls use different command messages for changes. TextBox uses EN_CHANGE while other controls will most likely use something different.

      Reminiscent of my younger years...

      10 LOAD "SCISSORS" 20 RUN

      H 1 Reply Last reply
      0
      • H Heath Stewart

        Do you put data in those controls (like defaults or previous values) when you show the dialog? That would cause a change. You'll just have to ignore those until the dialog is initialized and displayed. Besides, when you use COMMAND_ID_HANDLER, all messages sent to the control invoke your handler. If all you want to do is watch for changes, try this:

        COMMAND_HANDLER(IDC_MYCTL, EN_CHANGE, OnChange)

        ...or at least something like it. If you initialize the dialog with text in the controls, you'll still have to ignore it at such time (perhaps through a state variable), but once the dialog is shown, any change on that control would call your handler. Also, different controls use different command messages for changes. TextBox uses EN_CHANGE while other controls will most likely use something different.

        Reminiscent of my younger years...

        10 LOAD "SCISSORS" 20 RUN

        H Offline
        H Offline
        harishv
        wrote on last edited by
        #3

        ok, go that. in fact, that was the problem. thanks a lot for your suggestion. really appreciate that.:)

        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