Private Declare Function AngleArc& Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal dwRadius As Long, ByVal eStartAngle As Single, ByVal eSweepAngle As Single)
Private Declare Function MoveToEx Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
Private Declare Function CreatePatternBrush Lib "gdi32" (ByVal hBitmap As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long
Private Declare Function FillRect Lib "user32" (ByVal hDC As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function DrawEdge& Lib "user32" (ByVal hDC As Long, qrc As RECT, ByVal edge As Long, ByVal grfFlags As Long)
Private Declare Function InflateRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function DrawFrameControl Lib "user32" (ByVal hDC As Long, lpRect As RECT, ByVal un1 As Long, ByVal un2 As Long) As Long
Const pi = 3.141578
Private Const EDGE_BUMP = &H9&
Private Const EDGE_ETCHED = &H6&
Private Const EDGE_RAISED = &H5&
Private Const EDGE_SUNKEN = &HA&
Private Const BF_ADJUST = &H2000
Private Const BF_BOTTOM = &H8
Private Const BF_BOTTOMLEFT = &H9
Private Const BF_BOTTOMRIGHT = &HC
Private Const BF_DIAGONAL = &H10
Private Const BF_FLAT = &H4000
Private Const BF_LEFT = &H1
Private Const BF_MIDDLE = &H800
Private Const BF_MONO = &H8000
Private Const BF_RECT = &HF
Private Const BF_RIGHT = &H4
Private Const BF_SOFT = &H1000
Private Const BF_TOP = &H2
Private Const BF_TOPLEFT = &H3
Private Const BF_TOPRIGHT = &H6
Private Const DFC_BUTTON = 4
Private Const DFC_CAPTION = 1
Private Const DFC_MENU = 2
Private Const DFC_SCROLL = 3
Private Const DFCS_BUTTON3STATE = &H8
Private Const DFCS_BUTTONCHECK = &H0
Private Const DFCS_BUTTONRADIO = &H4
Private Const DFCS_BUTTONRADIOIMAGE = &H1
Private Const DFCS_BUTTONRADIOMASK = &H2
Private Const DFCS_CAPTIONCLOSE = &H0
Private Const DFCS_CAPTIONHELP = &H4
Private Const DFCS_CAPTIONMAX = &H2
Private Const DFCS_CAPTIONMIN = &H1
Private Const DFCS_CAPTIONRESTORE = &H3
Private Const DFCS_CHECKED = &H400
Private Const DFCS_FLAT = &H4000
Private Const DFCS_INACTIVE = &H100
Private Const DFCS_MENUARROW = &H0
Private Const DFCS_MENUARROWRIGHT = &H4
Private Const DFCS_MENUBULLET = &H2
Private Const DFCS_MENUCHECK = &H1
Private Const DFCS_MONO = &H8000
Private Const DFCS_PUSHED = &H200
Private Const DFCS_SCROLLCOMBOBOX = &H5
Private Const DFCS_SCROLLDOWN = &H1
Private Const DFCS_SCROLLLEFT = &H2
Private Const DFCS_SCROLLRIGHT = &H3
Private Const DFCS_SCROLLSIZEGRIP = &H8
Private Const DFCS_SCROLLSIZEGRIPRIGHT = &H10
Private Const DFCS_SCROLLUP = &H0
Private Sub Command1_Click()
Dim di&
Dim pt As POINTAPI
di = MoveToEx(hDC, 0, 0, pt)
di = AngleArc(hDC, 100, 100, 50, 90, 90)
End Sub
Private Sub Command2_Click()
Dim rc As RECT
Dim di&
Dim newbrush&
di = GetClientRect(hwnd, rc)
newbrush = CreatePatternBrush(Picture1.Picture)
di = FillRect(hDC, rc, newbrush)
di = DeleteObject(newbrush)
End Sub
Private Sub Command3_Click()
Dim di&
Dim rc As RECT
di = GetClientRect(hwnd, rc)
di = InflateRect(rc, -5, -5)
di = DrawEdge(hDC, rc, EDGE_RAISED, BF_TOPLEFT)
di = DrawEdge(hDC, rc, EDGE_RAISED, BF_BOTTOMRIGHT)
End Sub
Private Sub Command4_Click()
Dim di&
Dim rc As RECT
rc.Left = 20
rc.Top = 20
rc.Right = 40
rc.Bottom = 40
di = DrawFrameControl(hDC, rc, DFC_BUTTON, DFCS_BUTTONCHECK Or DFCS_CHECKED)