RE: [GD-Windows] Troubles with Win32 slider
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2003-05-27 21:57:05
|
The slider will send you WM_SCROLL messages. Actually, working=20 with sliders in Win32, I've found to be a pain in the butt,=20 because they're so different from many other controls. Here's code from a wrapper I wrote for personal use a long time=20 ago: virtual int value() { return SendMessage( controlWindow_->window()->hWnd(), TBM_GETPOS, = 0, 0 ); } virtual void setValue( int v ) { LRESULT lr =3D SendMessage( controlWindow_->window()->hWnd(), = TBM_SETPOS, TRUE, v ); } Cheers, / h+ -----Original Message----- From: gam...@li... = [mailto:gam...@li...]On Behalf Of = Pierre Terdiman Sent: Tuesday, May 27, 2003 2:46 PM To: gam...@li... Subject: [GD-Windows] Troubles with Win32 slider I put a vanilla Win32 slider in a dialog (in VC6's resource editor), and = I can't seem to get it work. This is probably very easy once you know how to do it, but neither the = MSDN nor Google seems to answer this basic question clearly : how do I = get back the slider's position ? (!) Note that : - For checkboxes or radio buttons it worked like a charm using, for = example, IsDlgButtonChecked(). I'm looking for similar brain-dead = functions to handle sliders. - I don't want to / can't use MFC here. - I tried to catch various messages in the parent window, = GetScrollPos(), etc, nothing seems to work. I'll appreciate a small overview, or a working link to a decent = tutorial. Thanks, - Pierre www.codercorner.com |