Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.4 KiB

  1. /*
  2. TrackBar
  3. All the useful information for a trackbar.
  4. */
  5. typedef struct {
  6. HWND hwnd; // our window handle
  7. HDC hdc; // current DC
  8. LONG lLogMin; // Logical minimum
  9. LONG lLogMax; // Logical maximum
  10. LONG lLogPos; // Logical position
  11. LONG lSelStart; // Logical selection start
  12. LONG lSelEnd; // Logical selection end
  13. WORD wThumbWidth; // Width of the thumb
  14. WORD wThumbHeight; // Height of the thumb
  15. int iSizePhys; // Size of where thumb lives
  16. RECT rc; // track bar rect.
  17. RECT Thumb; // Rectangle we current thumb
  18. DWORD dwDragPos; // Logical position of mouse while dragging.
  19. WORD Flags; // Flags for our window
  20. int Timer; // Our timer.
  21. WORD Cmd; // The command we're repeating.
  22. int nTics; // number of ticks.
  23. PDWORD pTics; // the tick marks.
  24. } TrackBar, *PTrackBar;
  25. // Trackbar flags
  26. #define TBF_NOTHUMB 0x0001 // No thumb because not wide enough.
  27. #define TBF_SELECTION 0x0002 // a selection has been established (draw the range)
  28. /*
  29. useful constants.
  30. */
  31. #define REPEATTIME 500 // mouse auto repeat 1/2 of a second
  32. #define TIMER_ID 1
  33. #define GWW_TRACKMEM 0 /* handle to track bar memory */
  34. #define EXTRA_TB_BYTES sizeof(PTrackBar) /* Total extra bytes. */
  35. /*
  36. Useful defines.
  37. */
  38. #define TrackBarCreate(hwnd) SetWindowWord(hwnd,GWW_TRACKMEM,(WORD)LocalAlloc(LPTR,sizeof(TrackBar)))
  39. #define TrackBarDestroy(hwnd) LocalFree((HLOCAL)GetWindowWord(hwnd,GWW_TRACKMEM))
  40. #define TrackBarLock(hwnd) (PTrackBar)GetWindowWord(hwnd,GWW_TRACKMEM)
  41. /*
  42. Function Prototypes
  43. */
  44. static void NEAR PASCAL DoTrack(PTrackBar, int, DWORD);
  45. static WORD NEAR PASCAL WTrackType(PTrackBar, LONG);
  46. static void NEAR PASCAL TBTrackInit(PTrackBar, LONG);
  47. static void NEAR PASCAL TBTrackEnd(PTrackBar, LONG);
  48. static void NEAR PASCAL TBTrack(PTrackBar, LONG);
  49. static void NEAR PASCAL DrawThumb(PTrackBar);
  50. static HBRUSH NEAR PASCAL SelectColorObjects(PTrackBar, BOOL);
  51. static void NEAR PASCAL SetTBCaretPos(PTrackBar);
  52. extern DWORD FAR PASCAL lMulDiv32(DWORD, DWORD, DWORD);