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. What is the notification code that gets sent when a scrollbar event occurs?

What is the notification code that gets sent when a scrollbar event occurs?

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

    Hi, I'm using the OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) method to find out when a user uses a scrollbar. Except I'm not sure what to be checking lParam against. I've casted lParam to be a NMHDR*, but when I check the value of pNMHDR->code, it's usually 0xFFFFFFF4. Can anyone tell me what xxxxx should be in the following line? BOOL CBaseFormView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { NMHDR* pNMHDR = (NMHDR*)lParam; **if(pNMHDR->code == xxxxx)** { //Do stuff } } Or can someone tell me if I'm going about this the wrong way? Thanks, skyapie

    R P 2 Replies Last reply
    0
    • S skyapie

      Hi, I'm using the OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) method to find out when a user uses a scrollbar. Except I'm not sure what to be checking lParam against. I've casted lParam to be a NMHDR*, but when I check the value of pNMHDR->code, it's usually 0xFFFFFFF4. Can anyone tell me what xxxxx should be in the following line? BOOL CBaseFormView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { NMHDR* pNMHDR = (NMHDR*)lParam; **if(pNMHDR->code == xxxxx)** { //Do stuff } } Or can someone tell me if I'm going about this the wrong way? Thanks, skyapie

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

      You will get control at OnVScroll() OnHScroll() when the suer scrolls the scrol bar Rinu Raj

      S 1 Reply Last reply
      0
      • S skyapie

        Hi, I'm using the OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) method to find out when a user uses a scrollbar. Except I'm not sure what to be checking lParam against. I've casted lParam to be a NMHDR*, but when I check the value of pNMHDR->code, it's usually 0xFFFFFFF4. Can anyone tell me what xxxxx should be in the following line? BOOL CBaseFormView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { NMHDR* pNMHDR = (NMHDR*)lParam; **if(pNMHDR->code == xxxxx)** { //Do stuff } } Or can someone tell me if I'm going about this the wrong way? Thanks, skyapie

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        skyapie wrote:

        I'm using the OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) method to find out when a user uses a scrollbar

        If this scrollbar is of this view only then it will not send WM_NOTIFY message. Handle WM_VSCROLL message

        skyapie wrote:

        BOOL CBaseFormView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { NMHDR* pNMHDR = (NMHDR*)lParam; if(pNMHDR->code == xxxxx) { //Do stuff } }

        This code will work , if you want to handle scrolling of child window of this view, lets say scrolling in listcontrol present as child of this view.

        Prasad Notifier using ATL | Operator new[],delete[][^]

        1 Reply Last reply
        0
        • R Rinu_Raj

          You will get control at OnVScroll() OnHScroll() when the suer scrolls the scrol bar Rinu Raj

          S Offline
          S Offline
          skyapie
          wrote on last edited by
          #4

          That will work if the scrollbar is for the view, not for a list control or list box in the view...

          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