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. How to get WM_VSCROLL?

How to get WM_VSCROLL?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 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.
  • F Offline
    F Offline
    freehawk
    wrote on last edited by
    #1

    Hello everyone I have a window with two scrolls, and I want to get WM_VSCROLL in function "PreTranslateMessage(MSG* pMsg) ". Though I add "case WM_VSCROLL:" to soource code, but I can not get it. Because the message does not come into "PreTranslateMessage(MSG* pMsg)". How to get it? Thanks. -Freehawk

    T Mircea PuiuM 3 Replies Last reply
    0
    • F freehawk

      Hello everyone I have a window with two scrolls, and I want to get WM_VSCROLL in function "PreTranslateMessage(MSG* pMsg) ". Though I add "case WM_VSCROLL:" to soource code, but I can not get it. Because the message does not come into "PreTranslateMessage(MSG* pMsg)". How to get it? Thanks. -Freehawk

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      Overide WM_VSCROLL message in your Window if you are using the MFC the Function Declaration is like this

      OnHScroll(UINT nSBCode,UINT nPos,CScrollBar *pScrollBar)

      where pScrollbar contain pointer to that Scrollbar if it is not Window Default Scrollbar. In Win32 lParam contain the pointer to The Scrollbar you have to typecast that. ----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

      F 1 Reply Last reply
      0
      • T ThatsAlok

        Overide WM_VSCROLL message in your Window if you are using the MFC the Function Declaration is like this

        OnHScroll(UINT nSBCode,UINT nPos,CScrollBar *pScrollBar)

        where pScrollbar contain pointer to that Scrollbar if it is not Window Default Scrollbar. In Win32 lParam contain the pointer to The Scrollbar you have to typecast that. ----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

        F Offline
        F Offline
        freehawk
        wrote on last edited by
        #3

        In fact I want to handle something before WM_VSCROLL happens. I dont know how to catch. -Freehawk

        1 Reply Last reply
        0
        • F freehawk

          Hello everyone I have a window with two scrolls, and I want to get WM_VSCROLL in function "PreTranslateMessage(MSG* pMsg) ". Though I add "case WM_VSCROLL:" to soource code, but I can not get it. Because the message does not come into "PreTranslateMessage(MSG* pMsg)". How to get it? Thanks. -Freehawk

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          Are you using switch case like this

          switch(LOWORD(pMsg->message))

          or using some other method ----------------------------- "I Think this Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

          1 Reply Last reply
          0
          • F freehawk

            Hello everyone I have a window with two scrolls, and I want to get WM_VSCROLL in function "PreTranslateMessage(MSG* pMsg) ". Though I add "case WM_VSCROLL:" to soource code, but I can not get it. Because the message does not come into "PreTranslateMessage(MSG* pMsg)". How to get it? Thanks. -Freehawk

            Mircea PuiuM Offline
            Mircea PuiuM Offline
            Mircea Puiu
            wrote on last edited by
            #5

            Normally you write your code inside OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); Should you still want to intercept the WM_SCROLL message, then use the PreTranslateMessage() function of your app class (not the dlg one) SkyWalker

            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