Source code of Windows XP (NT5)
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.

172 lines
4.4 KiB

  1. #define STRICT
  2. /* disable "non-standard extension" warnings in our code
  3. #ifndef RC_INVOKED
  4. #pragma warning(disable:4001)
  5. #endif
  6. */
  7. #include <windows.h>
  8. #include <windowsx.h>
  9. //#include <port1632.h>
  10. #define OFFSETOF(x) x
  11. #define Static
  12. #define UNICODE_FONT_NAME TEXT("Lucida Sans Unicode")
  13. #define COUNTOF(x) (sizeof(x)/sizeof(*x))
  14. #define ByteCountOf(x) ((x) * sizeof(TCHAR))
  15. #define LONG2POINT(l, pt) ((pt).x = (SHORT)LOWORD(l), (pt).y = (SHORT)HIWORD(l))
  16. #include <commctrl.h>
  17. extern HINSTANCE hInst;
  18. BOOL FAR PASCAL InitToolbarClass(HINSTANCE hInstance);
  19. BOOL FAR PASCAL InitStatusClass(HINSTANCE hInstance);
  20. BOOL FAR PASCAL InitHeaderClass(HINSTANCE hInstance);
  21. BOOL FAR PASCAL InitButtonListBoxClass(HINSTANCE hInstance);
  22. BOOL FAR PASCAL InitTrackBar(HINSTANCE hInstance);
  23. BOOL FAR PASCAL InitUpDownClass(HINSTANCE hInstance);
  24. void FAR PASCAL NewSize(HWND hWnd, int nClientHeight, LONG style,
  25. int left, int top, int width, int height);
  26. #define IDS_SPACE 0x0400
  27. /* System MenuHelp
  28. */
  29. #define MH_SYSMENU (0x8000 - MINSYSCOMMAND)
  30. #define IDS_SYSMENU (MH_SYSMENU-16)
  31. #define IDS_HEADER (MH_SYSMENU-15)
  32. #define IDS_HEADERADJ (MH_SYSMENU-14)
  33. #define IDS_TOOLBARADJ (MH_SYSMENU-13)
  34. /* Cursor ID's
  35. */
  36. #define IDC_SPLIT 100
  37. #define IDC_MOVEBUTTON 102
  38. #define IDC_STOP 103
  39. #define IDC_COPY 104
  40. #define IDC_MOVE 105
  41. /* Icon ID's
  42. */
  43. #define IDI_INSERT 150
  44. /* AdjustDlgProc stuff
  45. */
  46. #define ADJUSTDLG 200
  47. #define IDC_BUTTONLIST 201
  48. #define IDC_RESET 202
  49. #define IDC_CURRENT 203
  50. #define IDC_REMOVE 204
  51. #define IDC_MOVEUP 205
  52. #define IDC_MOVEDOWN 206
  53. /* bitmap IDs
  54. */
  55. #define IDB_THUMB 300
  56. /* These are the internal structures used for a status bar. The header
  57. * bar code needs this also
  58. */
  59. typedef struct tagSTRINGINFO
  60. {
  61. LPTSTR pString;
  62. UINT uType;
  63. int right;
  64. } STRINGINFO, *PSTRINGINFO;
  65. typedef struct tagSTATUSINFO
  66. {
  67. HFONT hStatFont;
  68. BOOL bDefFont;
  69. int nFontHeight;
  70. int nMinHeight;
  71. int nBorderX, nBorderY, nBorderPart;
  72. STRINGINFO sSimple;
  73. int nParts;
  74. STRINGINFO sInfo[1];
  75. } STATUSINFO, *PSTATUSINFO;
  76. #define GWL_PSTATUSINFO 0 /* Window word index for status info */
  77. #define SBT_NOSIMPLE 0x00ff /* Flags to indicate normal status bar */
  78. /* This is the default status bar face name
  79. */
  80. extern TCHAR szSansSerif[];
  81. /* Note that window procedures in protect mode only DLL's may be called
  82. * directly.
  83. */
  84. void FAR PASCAL PaintStatusWnd(HWND hWnd, PSTATUSINFO pStatusInfo,
  85. PSTRINGINFO pStringInfo, int nParts, int nBorderX, BOOL bHeader);
  86. LRESULT CALLBACK StatusWndProc(HWND hWnd, UINT uMessage, WPARAM wParam,
  87. LPARAM lParam);
  88. /* toolbar.c */
  89. #define GWL_PTBSTATE 0
  90. typedef struct tagTBBMINFO /* info for recreating the bitmaps */
  91. {
  92. int nButtons;
  93. HINSTANCE hInst;
  94. WORD wID;
  95. HBITMAP hbm;
  96. } TBBMINFO, NEAR *PTBBMINFO;
  97. typedef struct tagTBSTATE /* instance data for toolbar window */
  98. {
  99. PTBBUTTON pCaptureButton;
  100. HWND hdlgCust;
  101. HWND hwndCommand;
  102. int nBitmaps;
  103. PTBBMINFO pBitmaps;
  104. int iNumButtons;
  105. int nSysColorChanges;
  106. TBBUTTON Buttons[1];
  107. } TBSTATE, NEAR *PTBSTATE;
  108. extern HBITMAP FAR PASCAL SelectBM(HDC hDC, PTBSTATE pTBState, int nButton);
  109. extern void FAR PASCAL DrawButton(HDC hdc, int x, int y, int dx, int dy,
  110. PTBSTATE pTBState, PTBBUTTON ptButton);
  111. extern int FAR PASCAL TBHitTest(PTBSTATE pTBState, int xPos, int yPos);
  112. extern int FAR PASCAL PositionFromID(PTBSTATE pTBState, int id);
  113. /* tbcust.c */
  114. extern BOOL FAR PASCAL SaveRestore(HWND hWnd, PTBSTATE pTBState, BOOL bWrite,
  115. LPTSTR FAR *lpNames);
  116. extern void FAR PASCAL CustomizeTB(HWND hWnd, PTBSTATE pTBState, int iPos);
  117. extern void FAR PASCAL MoveButton(HWND hwndToolbar, PTBSTATE pTBState,
  118. int nSource);
  119. /* cutils.c */
  120. void FAR PASCAL NewSize(HWND hWnd, int nHeight, LONG style, int left, int top, int width, int height);
  121. BOOL FAR PASCAL CreateDitherBrush(BOOL bIgnoreCount); /* creates hbrDither */
  122. BOOL FAR PASCAL FreeDitherBrush(void);
  123. void FAR PASCAL CreateThumb(BOOL bIgnoreCount);
  124. void FAR PASCAL DestroyThumb(void);
  125. void FAR PASCAL CheckSysColors(void);
  126. extern HBRUSH hbrDither;
  127. extern HBITMAP hbmThumb;
  128. extern int nSysColorChanges;
  129. extern DWORD rgbFace; // globals used a lot
  130. extern DWORD rgbShadow;
  131. extern DWORD rgbHilight;
  132. extern DWORD rgbFrame;