home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / SAMPLES / MUSCROLL / MUSCRDLL.H_ / MUSCRDLL.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  4.0 KB  |  149 lines

  1. /*
  2.  * MUSCRDLL.H
  3.  *
  4.  * DLL Specific include file.
  5.  *
  6.  * Contains all definitions and and prototypes pertinent ONLY
  7.  * to the DLL.  API related information is contained in MUSCROLL.H.
  8.  * API in any way.
  9.  *
  10.  * Version 1.1, October 1991, Kraig Brockschmidt
  11.  *
  12.  */
  13.  
  14.  
  15. #include <custcntl.h>   //Standard Windows header file for custom controls.
  16. #include "muscroll.h"   //Get interface stuff for the control.
  17.  
  18. #include "muscrres.h"
  19.  
  20.  
  21. /*
  22.  * In window extra bytes we simply store a local handle to
  23.  * a MUSCROLL data structure.  The local memory is allocated
  24.  * from the control's local heap (either application or DLL)
  25.  * instead of from USER's heap, thereby saving system resources.
  26.  *
  27.  * Note that the window styles that are stored in the regular
  28.  * windwow structure are copied here.  This is to optimize access
  29.  * to these bits, avoiding extra calls to GetWindowLong.
  30.  */
  31.  
  32. typedef struct tagMUSCROLL
  33.     {
  34.     HWND        hWndAssociate;  //Associate window handle
  35.     DWORD       dwStyle;        //Copy of GetWindowLong(hWnd, GWL_STYLE)
  36.     WORD        iMin;           //Minimum position
  37.     WORD        iMax;           //Maximum position
  38.     WORD        iPos;           //Current position
  39.     WORD        wState;         //State flags
  40.     COLORREF    rgCr[CCOLORS];  //Configurable colors.
  41.     } MUSCROLL;
  42.  
  43. typedef MUSCROLL     *PMUSCROLL;
  44. typedef MUSCROLL FAR *LPMUSCROLL;
  45.  
  46. #define CBMUSCROLL sizeof(MUSCROLL)
  47.  
  48.  
  49.  
  50. //Offsets to use with GetWindowWord
  51. #define GWW_MUSCROLLHMEM    0
  52.  
  53. //Extra bytes for the window if the size of a local handle.
  54. #define CBWINDOWEXTRA       sizeof(HANDLE)
  55.  
  56. //Extra Class bytes.
  57. #define CBCLASSEXTRA        0
  58.  
  59.  
  60.  
  61. //Control state flags.
  62. #define MUSTATE_GRAYED      0x0001
  63. #define MUSTATE_HIDDEN      0x0002
  64. #define MUSTATE_MOUSEOUT    0x0004
  65. #define MUSTATE_UPCLICK     0x0008
  66. #define MUSTATE_DOWNCLICK   0x0010
  67. #define MUSTATE_LEFTCLICK   0x0008  //Repeated since MSS_VERTICAL and
  68. #define MUSTATE_RIGHTCLICK  0x0010  //MSS_HORIZONTAL are exclusive.
  69.  
  70. //Combination of click states.
  71. #define MUSTATE_CLICKED     (MUSTATE_LEFTCLICK | MUSTATE_RIGHTCLICK)
  72.  
  73. //Combination of state flags.
  74. #define MUSTATE_ALL         0x001F
  75.  
  76.  
  77.  
  78.  
  79. /*
  80.  * Macros to change the control state given a PMUSCROLL
  81.  * and state flag(s)
  82.  */
  83. #define StateSet(p, wFlags)    (p->wState |=  (wFlags))
  84. #define StateClear(p, wFlags)  (p->wState &= ~(wFlags))
  85. #define StateTest(p, wFlags)   (p->wState &   (wFlags))
  86.  
  87.  
  88.  
  89.  
  90. //Private functions specific to the control.
  91.  
  92. //INIT.C
  93. HANDLE FAR PASCAL LibMain(HANDLE, WORD, WORD, LPSTR);
  94. BOOL       PASCAL FRegisterControl(HANDLE);
  95. LONG       PASCAL LMicroScrollCreate(HWND, WORD, PMUSCROLL, LPCREATESTRUCT);
  96. BOOL       PASCAL FTextParse(LPSTR, LPINT, LPINT, LPINT);
  97. WORD       PASCAL WTranslateUpToChar(LPSTR FAR *, char);
  98.  
  99. //MSAPI.C
  100. LONG       PASCAL LMicroScrollAPI(HWND, WORD, WORD, LONG, PMUSCROLL);
  101.  
  102.  
  103. //MUSCROLL.C
  104. LONG   FAR PASCAL _export MicroScrollWndProc(HWND, UINT, WPARAM, LPARAM);
  105. void       PASCAL PositionChange(HWND, PMUSCROLL);
  106. void       PASCAL ClickedRectCalc(HWND, PMUSCROLL, LPRECT);
  107.  
  108.  
  109. //PAINT.C
  110. LONG       PASCAL LMicroScrollPaint(HWND, PMUSCROLL);
  111. void       PASCAL Draw3DButtonRect(HDC, HPEN, HPEN, WORD, WORD,\
  112.                                    WORD, WORD, BOOL);
  113.  
  114.  
  115.  
  116. //WEP.C
  117. void   FAR PASCAL WEP(int);
  118.  
  119.  
  120.  
  121.  
  122.  
  123. //Timer identifiers.
  124. #define IDT_FIRSTCLICK      500
  125. #define IDT_HOLDCLICK       501
  126.  
  127. #define CTICKS_FIRSTCLICK   400
  128. #define CTICKS_HOLDCLICK    50
  129.  
  130.  
  131. //Default range and position constants.
  132. #define IDEFAULTMIN         0
  133. #define IDEFAULTMAX         9
  134. #define IDEFAULTPOS         5
  135.  
  136.  
  137.  
  138.  
  139. /*
  140.  * All that follows in this include file is specific to
  141.  * the dialog editor interface for the MicroScroll control.
  142.  */
  143.  
  144. //Standard dialog editor callbacks.
  145. HANDLE FAR PASCAL _export HCtlInfo(void);
  146. WORD   FAR PASCAL _export WTranslateCtlFlags(DWORD, LPSTR, WORD);
  147. BOOL   FAR PASCAL _export FShowCtlStyleDlg(HWND, HANDLE, LPFNSTRTOID, LPFNIDTOSTR);
  148. BOOL   FAR PASCAL _export FCtlStyleDlgProc(HWND, WORD, WORD, LONG);
  149.