Jump to content
  • Advertisement
Sign in to follow this  
DrunkinCanadian

Help! My scrollbar has an evil Syamese twin!!

This topic is 4817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Um so I created a scrollbar using CreateWindowEx,no problem there, but, when I use SetScrollInfo to initialize it, the scrollbar grows an evil left twin that steals all the messages. Can someone please help me? using Visual c++ express Beta heres the code:
//--------------- Create a scrollbar --------------------
m_hScrollBarWin = CreateWindowEx(0L,
                       TEXT("SCROLLBAR"),
                       NULL, // There is no text to display
                       WS_CHILD | WS_VISIBLE  |SBS_VERT,
                       20, 
					   10,
                       40,
                       200,
                       
					   
                       m_hWindow,
                       NULL,
                       hInstance,
                       NULL);


if(!m_hScrollBarWin)
 MessageBox(m_hWindow,TEXT("Scrollbars aint workin!"),TEXT("Ahhh Bloody Hell"),MB_OK);
//---------- now set up the scrollbar --------------------
ZeroMemory(&m_ScrollInfo,sizeof(m_ScrollInfo));
m_ScrollInfo.cbSize = sizeof(m_ScrollInfo);
m_ScrollInfo.fMask  = SIF_POS | SIF_PAGE | SIF_RANGE ;
m_ScrollInfo.nPos  = 41; //-- beginning position of scrollbar --
m_ScrollInfo.nPage = 33;//-- 33 Units in client area at anyone time --
m_ScrollInfo.nMin   = 0;
m_ScrollInfo.nMax   = 99; //-- scrolls up to 99 'Units'

SetScrollInfo(m_hScrollBarWin,SBS_VERT,&m_ScrollInfo,TRUE);

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!