I'm making a procedure that would move the white elipse to the center of the window. i'm doing this using BeginPaint, EndPaint, Ellipse procedures. When there is no cycle, it works Ok, showing the elipse on the bottom, but when i'm using a cycle it moves the elipse where i need and than stops responding (I suppose procedure doesn't return control). How to fix this issue? I have even started to do the copies of registegrs values.
WM_Paint:
invoke BeginPaint, hWnd, addr ps ;
mov hdc, eax ;
invoke GetClientRect, hWnd, addr rect; invoke DrawInitialElipse
invoke DrawInitialElipse
Procedure:
DrawInitialElipse proc
LOCAL tempEAL:BYTE
LOCAL tempEAX:DWORD
LOCAL tempEDX:DWORD
LOCAL tempECX:DWORD
mov tempEAL, al
mov tempEAX, eax
mov tempEDX, edx
mov tempECX, ecx
finit
fld initialColorStep
fld currentColorDouble
fadd
fst currentColorDouble
fistp dword ptr currentColorInt
mov al, byte ptr [currentColorInt]
mov tempColor, al
mov esi, currentInitialCirclePositionY
.WHILE (esi != ydiv2)
.if stepNumber1==0
mov edi, startY
mov currentInitialCirclePositionY, edi
.else
dec currentInitialCirclePositionY
.endif
inc stepNumber1
mov edi, currentInitialCirclePositionY
sub edi,cnst_10
mov topLeftY, edi
mov edi, startX
sub edi, cnst_5
mov topLeftX, edi
mov edi, currentInitialCirclePositionY
add edi, cnst_10
mov bottomRightY, edi
mov edi, startX
add edi, cnst_5
mov bottomRightX, edi
invoke CreateBrush, 240,240,240
mov initialBrush, edi
invoke SelectObject, hdc, initialBrush
invoke Ellipse, hdc, topLeftX,topLeftY,bottomRightX,bottomRightY; //рисуем другим перо
invoke Sleep, 10
.ENDW
mov al, tempEAL
mov eax,tempEAX
mov edx,tempEDX
mov ecx,tempECX
ret
DrawInitialElipse endp