Public Type lpPoint
x As Long
y As Long
End Type
Public BC As Double, AC As Double, AB As Double
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public Declare Function GetCursorPos Lib "user32" (ByRef pos As lpPoint) As Boolean
Public Sub boostStart(Optional ByVal unDo$ = "")
'Optimization = True
EventsEnabled = False
ActiveDocument.SaveSettings
'ActiveDocument.PreserveSelection = False
End Sub
Public Sub boostFinish()
'ActiveDocument.PreserveSelection = True
ActiveDocument.RestoreSettings
EventsEnabled = True
'Optimization = False
Application.Refresh
End Sub
Sub GreenEllipse()
Dim p As lpPoint, x As Double, y As Double, l As Layer, sh As Shape, curX As Double, curY As Double, start
boostStart
GetCursorPos p
ActiveDocument.ActiveWindow.ScreenToDocument p.x, p.y, x, y
Set sh = ActiveLayer.CreateEllipse2(x, y, 0.2)
sh.Fill.UniformColor.RGBAssign 0, 255, 0
Application.Refresh
Do While GetAsyncKeyState(vbKeyEscape) = 0
DoEvents
GetCursorPos p
ActiveDocument.ActiveWindow.ScreenToDocument p.x, p.y, x, y
sh.GetPosition curX, curY
If curX <> x Or curY <> y Then
sh.SetPosition x - 0.2, y + 0.2
Application.Refresh
End If
Loop
boostFinish
End Sub