home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!europa.asd.contel.com!paladin.american.edu!auvm!INFERENCE.COM!GLOSTER
- Message-ID: <9301252306.AA01020@quaestor>
- Newsgroups: bit.listserv.win3-l
- Date: Mon, 25 Jan 1993 15:06:48 PST
- Sender: Microsoft Windows Version 3 Forum <WIN3-L@UICVM.BITNET>
- From: "Vance M. Gloster" <gloster@INFERENCE.COM>
- Subject: How to get a scroll bar's ID number...
- In-Reply-To: SHADOW%JCSVAX1.BITNET@pucc.Princeton.EDU's message of Mon,
- 25 Jan 1993 16:32:00 EST
- <9301252135.AA09605@fourier.inference.com>
- Lines: 23
-
- I'm writing a dialog window procedure where the user is supposed to change a
- certain color by clicking on 3 scrollbars... ID_SB_RED,ID_SB_GREEN,ID_SB_BLUE.
- Theses are the colors that combined with the RGB macro give me the actual colo
- r.
- Now my problem is that I can't figure out which scrollbar sends me which messa
- ge
- ...(I've tried to get that from the lParam of the message WM_VSCROLL... lPa
- ra
- m
- is supposed to have in the hiword the ID for the scrollbar... no good...)
-
- This works, if you do it right. The position of the scroll bar is in
- the lower 16 bits of lParam, and the window handle (not the same as
- the ID) of the scroll bar is in the upper 16 bits of the lParam. Use
- the function GetDlgCtrlID() to get the ID of the scrollbar. This
- function requires the window handle of the scroll bar as a parameter.
-
- One of the sample programs in Petzold's _Programming_Windows_ book is
- exactly this application. You might look at it if you have additional
- problems. Good luck!
-
- -Vance Gloster
- gloster@inference.com
-