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. WM_USER ignored by View window? (CHtmlView)

WM_USER ignored by View window? (CHtmlView)

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
3 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.
  • N Offline
    N Offline
    nobaq
    wrote on last edited by
    #1

    Hi, I am desperated: I want to send a WM_USER message to a CHtmlView but the message handler is never called :-( In my *.h file I have:

    #define WM_HYLGETCONTENT WM_USER + 79
    afx_msg LRESULT OnHylGetContent(WPARAM wParam, LPARAM lParam);

    In my *cpp file I have:

    BEGIN_MESSAGE_MAP(CHyperlexView, CHtmlView)
    [...]
    ON_MESSAGE(WM_HYLGETCONTENT, OnHylGetContent)
    END_MESSAGE_MAP()

    [...]

    afx_msg LRESULT CHyperlexView::OnHylGetContent(WPARAM wParam, LPARAM lParam)
    {
    MessageBox("I get called!");
    return 1111;
    }

    But the function is never called :-( I checked with Spy++: The message is sent successfully to the window but the LRESULT is 0 instead of 1111. The message does not appear too. What could be the problem here? I have also checked other values for WM_USER, I get the same result :( Thank you, Niki

    R K 2 Replies Last reply
    0
    • N nobaq

      Hi, I am desperated: I want to send a WM_USER message to a CHtmlView but the message handler is never called :-( In my *.h file I have:

      #define WM_HYLGETCONTENT WM_USER + 79
      afx_msg LRESULT OnHylGetContent(WPARAM wParam, LPARAM lParam);

      In my *cpp file I have:

      BEGIN_MESSAGE_MAP(CHyperlexView, CHtmlView)
      [...]
      ON_MESSAGE(WM_HYLGETCONTENT, OnHylGetContent)
      END_MESSAGE_MAP()

      [...]

      afx_msg LRESULT CHyperlexView::OnHylGetContent(WPARAM wParam, LPARAM lParam)
      {
      MessageBox("I get called!");
      return 1111;
      }

      But the function is never called :-( I checked with Spy++: The message is sent successfully to the window but the LRESULT is 0 instead of 1111. The message does not appear too. What could be the problem here? I have also checked other values for WM_USER, I get the same result :( Thank you, Niki

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

      You've probably hit a conflict with another existing message ID. Use WM_APP instead of WM_USER, the latter is obsolete. What you really should do is use a registered windows message. Read more about message management here[^].

      "It's supposed to be hard, otherwise anybody could do it!" - selfquote
      "High speed never compensates for wrong direction!" - unknown

      1 Reply Last reply
      0
      • N nobaq

        Hi, I am desperated: I want to send a WM_USER message to a CHtmlView but the message handler is never called :-( In my *.h file I have:

        #define WM_HYLGETCONTENT WM_USER + 79
        afx_msg LRESULT OnHylGetContent(WPARAM wParam, LPARAM lParam);

        In my *cpp file I have:

        BEGIN_MESSAGE_MAP(CHyperlexView, CHtmlView)
        [...]
        ON_MESSAGE(WM_HYLGETCONTENT, OnHylGetContent)
        END_MESSAGE_MAP()

        [...]

        afx_msg LRESULT CHyperlexView::OnHylGetContent(WPARAM wParam, LPARAM lParam)
        {
        MessageBox("I get called!");
        return 1111;
        }

        But the function is never called :-( I checked with Spy++: The message is sent successfully to the window but the LRESULT is 0 instead of 1111. The message does not appear too. What could be the problem here? I have also checked other values for WM_USER, I get the same result :( Thank you, Niki

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

        From where your sendmessage(...) has been called

        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