home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / win3l / 12878 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.6 KB  |  37 lines

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