hello every
There is a window , but it doesn't have title bar. Suppose i want to move it as if it has the title bar.what should i do? Sorry for my English
Best regards
There is a window , but it doesn't have title bar. Suppose i want to move it as if it has the title bar.what should i do? Sorry for my English
Best regards
On WM_LBUTTONDOWN do:
There was also an easier approach, iirc - on WM_LBUTTONDOWN posting a WM_NCLBUTTONDOWN message.
.data
IsDragged db 0
DragPt POINT <>
.code
.elseif msg==WM_LBUTTONDOWN ; in your WndProc
invoke SetCapture,hWnd
mov IsDragged,1
... ; fill in DragPt with current mouse position
.elseif msg==WM_MOUSEMOVE && IsDragged
get current mouse position and
move the window with MoveWindow
.elseif msg==WM_LBUTTONUP && IsDragged
invoke ReleaseCapture
mov IsDragged,0
There was also an easier approach, iirc - on WM_LBUTTONDOWN posting a WM_NCLBUTTONDOWN message.
[...]
cmp , WM_LBUTTONDOWN
je _wmlbuttondown
[...]
_wmlbuttondown:
invoke SendMessage, , WM_NCLBUTTONDOWN, HTCAPTION, 0
[...]
Damn Ultrano, you were faster :P
Put the following message handler in the main loop, and it will allow you to move the window whenever the mouse is pressed down, just like if it was on the titlebar.
Nick
Nick
.elseif eax == WM_NCHITTEST
mov eax, HTCAPTION
ret
Thank you all , it really works fine
i use this one:
mov eax,umsg
...
.elseif eax==WM_MOUSEMOVE
;---move Dialog on clicking anywhere---
mov eax,wparam
.if eax==1
invoke SendMessage,hDialogFrame,WM_SYSCOMMAND,0F012h,0
.endif
...
xor eax,eax
ret
I've used something similar to Nick's routine for quite a while, and never noticed anything bad - works like a charm.