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. Afx Message Handling in CStatic as Child-Window

Afx Message Handling in CStatic as Child-Window

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++visual-studio
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.
  • _ Offline
    _ Offline
    _NielsB
    wrote on last edited by
    #1

    Hi! I have a question about afx-message-handling in a MFC-Dialog (VS.NET 2003, WinXP). I've got a main Dialog (CDialog) and a Child-Window in it (CStatic). The goal is to handle afx-messages from the CStatic (ie. ON_WM_LBUTTONDOWN()) . I did use the standard afx-message-map-mothod (ie. mapping ON_WM_LBUTTONDOWN() to afx_msg void OnLButtonDown(UINT nFlags, CPoint point)), but nothing happens. Only the messages and handlers of the Main-Dialog are working. I tried to put the focus on the Child-Window manually - no sucess. I tried to use CWnd instead of CStatic - no sucess. Perhaps the CDialog messages are blocking the messages of the CStatic?! Im really new in this and need a hint. thanks in advance! _NielsB

    M K 2 Replies Last reply
    0
    • _ _NielsB

      Hi! I have a question about afx-message-handling in a MFC-Dialog (VS.NET 2003, WinXP). I've got a main Dialog (CDialog) and a Child-Window in it (CStatic). The goal is to handle afx-messages from the CStatic (ie. ON_WM_LBUTTONDOWN()) . I did use the standard afx-message-map-mothod (ie. mapping ON_WM_LBUTTONDOWN() to afx_msg void OnLButtonDown(UINT nFlags, CPoint point)), but nothing happens. Only the messages and handlers of the Main-Dialog are working. I tried to put the focus on the Child-Window manually - no sucess. I tried to use CWnd instead of CStatic - no sucess. Perhaps the CDialog messages are blocking the messages of the CStatic?! Im really new in this and need a hint. thanks in advance! _NielsB

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

      did you derived a new class from CStatic ?


      Maximilien Lincourt Your Head A Splode - Strong Bad

      1 Reply Last reply
      0
      • _ _NielsB

        Hi! I have a question about afx-message-handling in a MFC-Dialog (VS.NET 2003, WinXP). I've got a main Dialog (CDialog) and a Child-Window in it (CStatic). The goal is to handle afx-messages from the CStatic (ie. ON_WM_LBUTTONDOWN()) . I did use the standard afx-message-map-mothod (ie. mapping ON_WM_LBUTTONDOWN() to afx_msg void OnLButtonDown(UINT nFlags, CPoint point)), but nothing happens. Only the messages and handlers of the Main-Dialog are working. I tried to put the focus on the Child-Window manually - no sucess. I tried to use CWnd instead of CStatic - no sucess. Perhaps the CDialog messages are blocking the messages of the CStatic?! Im really new in this and need a hint. thanks in advance! _NielsB

        K Offline
        K Offline
        khan
        wrote on last edited by
        #3

        Include this style: SS_NOTIFY with the CStatic. m_Static.ModifyStyle(0,SS_NOTIFY); this is this.

        _ 1 Reply Last reply
        0
        • K khan

          Include this style: SS_NOTIFY with the CStatic. m_Static.ModifyStyle(0,SS_NOTIFY); this is this.

          _ Offline
          _ Offline
          _NielsB
          wrote on last edited by
          #4

          works fine ... thanks!

          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