Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long Private Declare Function Ellipse Lib "gdi32" (ByVal hDC As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long Private Declare Function SelectObject Lib "gdi32" (ByVal hDC As Long, ByVal hObject As Long) As Long Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long Private Sub CommandButton_Click() Dim hWnd As Long, hDC As Long, hBrush As Long, hPen As Long hWnd = FindWindow("ThunderDFrame", Me.Caption) hDC = GetDC(hWnd) hBrush = CreateSolidBrush(vbBlack) hPen = CreatePen(1, 2, vbBlack) SelectObject hDC, hBrush SelectObject hDC, hPen Ellipse hDC, 0, 0, 10, 10 DeleteObject hBrush DeleteObject hPen End Sub |