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. Replacing msctls_updown32

Replacing msctls_updown32

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
4 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.
  • B Offline
    B Offline
    Brian Shifrin
    wrote on last edited by
    #1

    How can I replace CSpinButton inside TabCtrl???? Cann't use "PreSubclassWindow()" as control may not be created at that time? May be someone has ideas how to detect when CTabCtrl created Spin? Thanks, Brian

    M 1 Reply Last reply
    0
    • B Brian Shifrin

      How can I replace CSpinButton inside TabCtrl???? Cann't use "PreSubclassWindow()" as control may not be created at that time? May be someone has ideas how to detect when CTabCtrl created Spin? Thanks, Brian

      M Offline
      M Offline
      Maurizio Pisano
      wrote on last edited by
      #2

      The spin button sends a WM_PARENTNOTIFY msg to the tab control when it's created. If the low order word of wParam is WM_CREATE then get the child control's class name (lParam is a pointer to the child's HWND). If the class name is "msctls_updown32" then you hit the jackpot ;)

      B 1 Reply Last reply
      0
      • M Maurizio Pisano

        The spin button sends a WM_PARENTNOTIFY msg to the tab control when it's created. If the low order word of wParam is WM_CREATE then get the child control's class name (lParam is a pointer to the child's HWND). If the class name is "msctls_updown32" then you hit the jackpot ;)

        B Offline
        B Offline
        Brian Shifrin
        wrote on last edited by
        #3

        Thanks, worked like a charm.... One more question... If I want to hide Spin, what would be the best way to do this...

        M 1 Reply Last reply
        0
        • B Brian Shifrin

          Thanks, worked like a charm.... One more question... If I want to hide Spin, what would be the best way to do this...

          M Offline
          M Offline
          Maurizio Pisano
          wrote on last edited by
          #4

          subclass the spin control and then on WM_WINDOWPOSCHANGING set the flags like this: ((LPWINDOWPOS)lParam)->flags &= ~SWP_SHOWWINDOW; ((LPWINDOWPOS)lParam)->flags |= SWP_HIDEWINDOW;

          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