markers string need a little modification:;-------------------------------------------------------------------------------------
; _CalcXYFromAngle - Gets sin and cos of angle specified and returns as x and y coords
;
; xpos = r * cos(theta)
; ypos = r * sin(theta)
;-------------------------------------------------------------------------------------
_CalcXYFromAngle PROC PRIVATE USES EBX hCbarControl:DWORD, angle:REAL4, xpos:DWORD, ypos:DWORD
LOCAL pCbarData:DWORD
LOCAL ProgressWidth:DWORD
LOCAL rect:RECT
LOCAL WinHt:DWORD, WinWd:DWORD
LOCAL ClientY:DWORD, ClientX:dword
Invoke _GetCbarDataPtr, hCbarControl
mov pCbarData, eax
mov ebx, pCbarData
mov eax, [ebx].CBAR_DATA.ProgressWidth
mov ProgressWidth, eax; 20d
mov eax, ProgressWidth
shl eax, 1
add eax, 16d
;sub eax, 10d
;add eax, ProgressWidth ;, 8d
;add eax, ProgressWidth
mov ProgressWidth, eax
Invoke GetClientRect, hCbarControl, Addr rect
sub rect.right, 2d
sub rect.bottom, 2d
mov eax, rect.bottom
sub eax, ProgressWidth
mov ClientY, eax
mov eax, rect.right
sub eax, ProgressWidth
mov ClientX, eax
finit
fld angle
fld rads
fdiv
fldpi
fmul
fcos
mov eax, ClientX
shr eax, 1
mov WinWd, eax
fild WinWd
fmul
fld someval
fmul
fild WinWd
fadd
fistp WinWd
mov eax, WinWd
;sub eax, 1
mov ebx, dword ptr [xpos]
mov [ebx], eax
fld angle
fld rads
fdiv
fldpi
fmul
fsin
mov eax, ClientY
shr eax, 1
mov WinHt, eax
fild WinHt
fmul
fld someval
fmul
fild WinHt
fadd
fistp WinHt
mov eax, WinHt
;sub eax, 5
mov ebx, dword ptr [ypos]
mov [ebx], eax
ret
_CalcXYFromAngle endp
If control is a perfect circle then result is exactly that of original.