i am calling GetCursorPos to get the current mouse position so i can call TrackPopupMenu.
instead of using a global variable POINT, i made room on the stack then did this
virtual at esp
.curpos POINT
end virtual
lea ebx, [.curpos]
push ebx
call [GetCursorPos]
however, the popup menu is placed in the bottom left of screen (0, 0 coordinates).
if i change it to
lea esi, [esp]
virtual at ESI
...same as above
it works and the menu is placed correctly.
now, i thought esi will be the same value as esp because of the LEA instruction so i dont understand how using LEA and ESI makes the code work.
am i doing something wrong ?
i used
virtual at esp
.wc WNDCLASSEX
end virtual
to set window class properties and RegisterClassEx with the WNDCLASSEX on the stack and that works. thats why i cant understand why it doesnt work with the GetCursorPos.[/code]