Hi greco558,
When the code execution comes to a window procedure, Ebx, Edi and Esi registers have been saved and they will be restored at the end of the proc. Also they are saved when calling an Easy Code method in visual projects. However, in your own procedures you are the responsible for saving them if you want to keep their values in any part of your code (saving them or not has no effect on EC). As said before, when the code execution returns to EC the values for Ebx, Edi and Esi are restored to the values they had when the window procedure was called.
Fo example:
Window1Procedure Proc Private hWnd:HWND, ...
.If uMsg == WM_CREATE
Invoke GlobalAlloc, GPTR, 1024
Mov Ebx, Eax
Invoke YourProc, ...
Invoke GlobalFree, Ebx
.EndIf
Return FALSE
Window1 EndP
In the example above, if you are going to modify Ebx in YourProc, you must save it as it contains the address of the allocated memory that has to be freed later.
Regards,
Ramon