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. Receive message

Receive message

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • M Offline
    M Offline
    Mathias S
    wrote on last edited by
    #1

    In a "class CMyCtrl : public CWnd" controller I create another controller dynamically. Can I catch the WM_LBUTTONDOWN message that is intended for the dynamic controller in CMyCtrl instead? /Mathias

    R 2 Replies Last reply
    0
    • M Mathias S

      In a "class CMyCtrl : public CWnd" controller I create another controller dynamically. Can I catch the WM_LBUTTONDOWN message that is intended for the dynamic controller in CMyCtrl instead? /Mathias

      R Offline
      R Offline
      ravjak
      wrote on last edited by
      #2

      (WNDPROC) gfnMyProc; //in some previous called function gfnMyProc = (WNDPROC)SetWindowLong(listview, GWL_WNDPROC,(LONG)MyProc); LRESULT CALLBACK MyProc(HWND hwnd, UINT uiMsg,WPARAM wParam, LPARAM lParam) { switch (uiMsg) { case WM_LBUTTONDOWN: { //your stuff here break; } } return CallWindowProc(gfnMyProc, hwnd, uiMsg, wParam, lParam); }} Pain is a weakness living the body

      1 Reply Last reply
      0
      • M Mathias S

        In a "class CMyCtrl : public CWnd" controller I create another controller dynamically. Can I catch the WM_LBUTTONDOWN message that is intended for the dynamic controller in CMyCtrl instead? /Mathias

        R Offline
        R Offline
        ravjak
        wrote on last edited by
        #3

        This should work (WNDPROC) gfnMyProc; //in some previous called function gfnMyProc = (WNDPROC)SetWindowLong(listview, GWL_WNDPROC,(LONG)MyProc); LRESULT CALLBACK MyProc(HWND hwnd, UINT uiMsg,WPARAM wParam, LPARAM lParam) { switch (uiMsg) { case WM_LBUTTONDOWN: { //your stuff here break; } } return CallWindowProc(gfnMyProc, hwnd, uiMsg, wParam, lParam); } Pain is a weakness living the body

        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