找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 3160|回复: 0

ToolBar的模样自己画(二)

[复制链接]

1214

主题

352

回帖

11

精华

管理员

菜鸟

积分
93755

贡献奖关注奖人气王精英奖乐于助人勋章

发表于 2010-1-30 09:26:02 | 显示全部楼层 |阅读模式

  1. Private Const CDDS_PREPAINT As Long = &H1
  2. Private Const CDDS_ITEMPREPAINT As Long = (CDDS_ITEM Or CDDS_PREPAINT)
  3. Private Const CDRF_SKIPDEFAULT As Long = &H4
  4. Private Const CDRF_NOTIFYITEMDRAW As Long = &H20
  5. Private Const CDIS_CHECKED As Long = &H8
  6. Private Const CDIS_DISABLED As Long = &H4
  7. Private Const CDIS_HOT As Long = &H40
  8. Private Const CDIS_SELECTED As Long = &H1
  9. Private Const GWL_WNDPROC = (-4)
  10. Private Const WM_USER As Long = &H400
  11. Private Const TB_GETBUTTONTEXTA As Long = (WM_USER + 45)
  12. Private Const TB_GETIMAGELIST As Long = (WM_USER + 49)
  13. Private Const TB_GETHOTIMAGELIST = (WM_USER + 53)
  14. Private Const TB_GETDISABLEDIMAGELIST = (WM_USER + 55)
  15. Private Const TB_GETBITMAP As Long = (WM_USER + 44)
  16. Private Const TB_COMMANDTOINDEX As Long = (WM_USER + 25)
  17. Private Const TB_GETBUTTON As Long = (WM_USER + 23)
  18. Private Const TBSTYLE_LIST As Long = &H1000
  19. Private Const TBSTYLE_SEP As Long = &H1
  20. Private Const TBSTYLE_DROPDOWN As Long = &H8
  21. Private Const ILD_NORMAL As Long = &H0
  22. Private Const DST_TEXT = &H1&
  23. Private Const DST_ICON As Long = &H3
  24. Private Const DSS_DISABLED = &H20&
  25. Private Const CLR_NONE As Long = &HFFFFFFFF
  26. Private Const GWL_STYLE As Long = -16
  27. Private Const PS_SOLID As Long = 0
  28. Private Const TA_LEFT = 0
  29. Private Const TA_RIGHT = 2
  30. Private Const TA_CENTER = 6
  31. Private Const BF_FLAT = &H4000
  32. Private Const BF_BOTTOM = &H8
  33. Private Const BF_LEFT = &H1
  34. Private Const BF_RIGHT = &H4
  35. Private Const BF_TOP = &H2
  36. Private Const BF_RECT = (BF_LEFT Or BF_TOP Or BF_RIGHT Or BF_BOTTOM)
  37. Private Const BDR_RAISEDOUTER = &H1
  38. Private Const BDR_RAISEDINNER = &H4
  39. Private Const BDR_SUNKENINNER = &H8
  40. Private Const BDR_SUNKENOUTER = &H2
  41. Private Const BDR_OUTER = &H3
  42. Private Const EDGE_ETCHED = (BDR_SUNKENOUTER Or BDR_RAISEDINNER)
  43. Private Const EDGE_RAISED = (BDR_RAISEDOUTER Or BDR_RAISEDINNER)
  44. Private Const EDGE_SUNKEN = (BDR_SUNKENOUTER Or BDR_SUNKENINNER)
  45. Private Type BITMAP
  46.     bmType As Long
  47.     bmWidth As Long
  48.     bmHeight As Long
  49.     bmWidthBytes As Long
  50.     bmPlanes As Integer
  51.     bmBitsPixel As Integer
  52.     bmBits As Long
  53. End Type
  54. Private Type ICONINFO
  55.     fIcon As Long
  56.     xHotspot As Long
  57.     yHotspot As Long
  58.     hbmMask As Long
  59.     hbmColor As Long
  60. End Type
  61. Private Type RECT
  62.     Left As Long
  63.     Top As Long
  64.     Right As Long
  65.     Bottom As Long
  66. End Type
  67. Private Type POINTL
  68.     X As Long
  69.     Y As Long
  70. End Type
  71. Private Type Size
  72.     cx As Long
  73.     cy As Long
  74. End Type
  75. Private Type LOGFONT
  76.     lfHeight As Long
  77.     lfWidth As Long
  78.     lfEscapement As Long
  79.     lfOrientation As Long
  80.     lfWeight As Long
  81.     lfItalic As Byte
  82.     lfUnderline As Byte
  83.     lfStrikeOut As Byte
  84.     lfCharSet As Byte
  85.     lfOutPrecision As Byte
  86.     lfClipPrecision As Byte
  87.     lfQuality As Byte
  88.     lfPitchAndFamily As Byte
  89.     lfFaceName As String * 32
  90. End Type
  91. Private Type TBBUTTON
  92.     iBitmap As Long
  93.     idCommand As Long
  94.     fsState As Byte
  95.     fsStyle As Byte
  96.     bReserved(1) As Byte
  97.     dwData As Long
  98.     iString As Long
  99. End Type
  100. Private Type MemHdc
  101.     hdc As Long
  102.     Bmp As Long
  103.     obm As Long
  104. End Type
  105. Private Type NMHDR
  106.     hwndFrom As Long
  107.     idfrom As Long
  108.     code As Long
  109. End Type
  110. Private Type NMCUSTOMDRAW
  111.     hdr As NMHDR
  112.     dwDrawStage As Long
  113.     hdc As Long
  114.     rc As RECT
  115.     dwItemSpec As Long
  116.     uItemState As Long
  117.     lItemlParam As Long
  118. End Type
  119. Private Type NMTBCUSTOMDRAW
  120.     nmcd As NMCUSTOMDRAW
  121.     hbrMonoDither As Long
  122.     hbrLines As Long
  123.     hpenLines As Long
  124.     clrText As Long
  125.     clrMark As Long
  126.     clrTextHighlight As Long
  127.     clrBtnFace As Long
  128.     clrBtnHighlight As Long
  129.     clrHighlightHotTrack As Long
  130.     rcText As RECT
  131.     nStringBkMode As Long
  132.     nHLStringBkMode As Long
  133. End Type
  134. Private m_hWnd As Long
  135. Private m_lngBackColor As Long
  136. Private m_lngBrdStyle As Long
  137. Private m_lngTextColor As Long
  138. Private m_lngTextHiColor As Long
  139. Private m_strBkPicture As String
  140. Private m_lngBrdColor As Long
  141. Private mpicBk As StdPicture
  142. Private mlngImgList As Long
  143. Private mdcWhite As MemHdc
  144. Private mlngHotImgList As Long
  145. Private mlngDsbImgList As Long
  146. Private mlngBtnHiAlpha As Long
  147. Private mlngBtnDownAlpha As Long
  148. Private mlngIconWidth As Long
  149. Private mlngIconHeight As Long
  150. Private Font As LOGFONT
  151. '消息与管理类
  152. Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  153. Private Declare Function ShowWindow Lib "user32" Alias "ShowWindowAsync" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
  154. Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  155. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  156. Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
  157. Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
  158. 'GDI对象类
  159. Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
  160. Private Declare Function CreatePen Lib "gdi32.dll" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
  161. Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
  162. Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
  163. Private Declare Function DestroyIcon Lib "user32.dll" (ByVal hIcon As Long) As Long
  164. Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long
  165. Private Declare Function GetIconInfo Lib "user32" (ByVal hIcon As Long, piconinfo As ICONINFO) As Long
  166. Private Declare Function GetObj Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
  167. Private Declare Function CreatePatternBrush Lib "gdi32" (ByVal hBitmap As Long) As Long
  168. Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
  169. Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
  170. Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
  171. Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
  172. Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
  173. '区域、绘图、文本类
  174. Private Declare Function GetClientRect Lib "user32.dll" (ByVal hWnd As Long, lpRect As RECT) As Long
  175. Private Declare Function SetRect Lib "user32.dll" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  176. Private Declare Function FillRect Lib "user32.dll" (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
  177. Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTL, ByVal nCount As Long) As Long
  178. Private Declare Function DrawEdge Lib "user32" (ByVal hdc As Long, qrc As RECT, ByVal edge As Long, ByVal grfFlags As Long) As Long
  179. Private Declare Function FrameRect Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
  180. Private Declare Function MoveToEx Lib "gdi32.dll" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, lpPoint As Any) As Long
  181. Private Declare Function LineTo Lib "gdi32.dll" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
  182. Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long
  183. Private Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As Long, ByVal lpsz As String, ByVal cbString As Long, lpSize As Size) As Long
  184. Private Declare Function SetTextAlign Lib "gdi32" (ByVal hdc As Long, ByVal wFlags As Long) As Long
  185. Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
  186. Private Declare Function SetTextColor Lib "gdi32.dll" (ByVal hdc As Long, ByVal crColor As Long) As Long
  187. Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
  188. Private Declare Function DrawState Lib "user32.dll" Alias "DrawStateA" (ByVal hdc As Long, ByVal hBrush As Long, ByVal lpDrawStateProc As Long, ByVal hIco As Long, ByVal wParam As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal n3 As Long, ByVal n4 As Long, ByVal un As Long) As Long
  189. Private Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hdcDest As Long, ByVal nXOriginDest As Long, ByVal nYOriginDest As Long, ByVal nWidthDest As Long, ByVal hHeightDest As Long, ByVal hdcSrc As Long, ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, ByVal blendFunction As Long) As Long
  190. Private Declare Function RedrawWindow Lib "user32" (ByVal hWnd As Long, lprcUpdate As RECT, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
  191. 'ImageList类
  192. Private Declare Function ImageList_Draw Lib "comctl32.dll" (ByVal himl As Long, ByVal i As Long, ByVal hdcDst As Long, ByVal X As Long, ByVal Y As Long, ByVal fStyle As Long) As Long
  193. Private Declare Function ImageList_GetBkColor Lib "comctl32.dll" (ByVal himl As Long) As Long
  194. Private Declare Function ImageList_SetBkColor Lib "comctl32.dll" (ByVal himl As Long, ByVal clrBk As Long) As Long
  195. Private Declare Function ImageList_GetIcon Lib "comctl32.dll" (ByVal himl As Long, ByVal i As Long, ByVal flags As Long) As Long

复制代码
【VB】QQ群:1422505加的请打上VB好友
【易语言】QQ群:9531809  或 177048
【FOXPRO】QQ群:6580324  或 33659603
【C/C++/VC】QQ群:3777552
【NiceBasic】QQ群:3703755
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

快速回复 返回顶部 返回列表