Hi! When I add WM_MOUSEMOVE code, WM_LBUTTONDOWN, WM_LBUTTONUP didn't work. ;-( Why?
Posted on 2004-04-02 18:35:11 by Deli
How about posting a bit of code so we can help you. I process those messages regularly without any problem.

Raymond
Posted on 2004-04-02 19:44:38 by Raymond
;##############################################
NewWindowProc proc hWin :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD

.if uMsg == WM_LBUTTONDOWN

mov eax, lParam ; X-coordinate
and eax, 0FFFFh
mov ctr_X, eax

mov eax, lParam ; Y-coordinate
shr eax, 16
mov ctr_Y, eax

return 0

.elseif uMsg == WM_LBUTTONUP

mov eax, lParam ; X-coordinate
and eax, 0FFFFh
sub eax, ctr_X
mov ctr_width, eax

mov eax, lParam ; Y-coordinate
shr eax, 16
sub eax, ctr_Y
mov ctr_height, eax

; creating control with CreateWindowEx

return 0

.elseif uMsg == WM_MOUSEMOVE

mov eax, lParam ; X-coordinate
and eax, 0FFFFh
mov ctr_X, eax

mov eax, lParam ; Y-coordinate
shr eax, 16
mov ctr_Y, eax

invoke SendMessage, hStatus, SB_SETTEXT, 255, SADD("Pos: ")
.endif

NewWindowProc endp
;##############################################

Without WM_MOUSEMOVE all works fine.
Posted on 2004-04-03 06:28:05 by Deli
You seem to be using the ctr_X and ctr_Y variables for two different purposes. One of them seems to be for updating the current position of the mouse pointer in your status bar.

Your other purpose is to store the starting coordinates for defining a rectangular area by draging the mouse with the left button down. By the time you release that left mouse button, the WM_MOUSEMOVE section has been continuously changing the starting coordinates which should be the same values as when the button is released.

Try using different variables for those two purposes.

Raymond
Posted on 2004-04-03 11:09:13 by Raymond
Big thx 4 help, I have one more question: which the way is the best to convert/display numerical values (i.e. X and Y coordinates in the status bar) as a string?

Best regards,
Posted on 2004-04-03 13:18:05 by Deli