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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Scrollbar

Scrollbar

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

    Hi. I'm trying to manage a listbox vertical scroll bar and I have a problem with the function OnVScroll when I drag the scroll box. In OnVScroll(), when the first parameter nSBCode is SB_THUMBPOSITION or SB_THUMBTRACK, the second parameter nPos is expected to indicate the position of the scroll box. nPos (which is a UINT) can be cast to an int, and then I realized that after 32768, (int) nPos is -32768 ! Then, (int) nPos increases up to 32768 and then -32768 again !!! How should I proceed to manage the scroll box position when the range of my vertical scroll bar is over 32768 ? Thanks.

    T 1 Reply Last reply
    0
    • C confalonieri

      Hi. I'm trying to manage a listbox vertical scroll bar and I have a problem with the function OnVScroll when I drag the scroll box. In OnVScroll(), when the first parameter nSBCode is SB_THUMBPOSITION or SB_THUMBTRACK, the second parameter nPos is expected to indicate the position of the scroll box. nPos (which is a UINT) can be cast to an int, and then I realized that after 32768, (int) nPos is -32768 ! Then, (int) nPos increases up to 32768 and then -32768 again !!! How should I proceed to manage the scroll box position when the range of my vertical scroll bar is over 32768 ? Thanks.

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      You should use CWnd::GetScrollInfo instead of parameters passed to WM_VSCROLL. GetScrollInfo supports 32-bit ranges and positions. Tomasz Sowinski -- http://www.shooltz.com

      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