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
Posted on 2005-08-23 03:23:45 by Rey
On WM_LBUTTONDOWN do:

.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.
Posted on 2005-08-23 04:08:33 by Ultrano

[...]
        cmp    , WM_LBUTTONDOWN
        je      _wmlbuttondown
[...]
  _wmlbuttondown:
        invoke  SendMessage, , WM_NCLBUTTONDOWN, HTCAPTION, 0 
[...]


Damn Ultrano, you were faster :P
Posted on 2005-08-23 04:09:26 by bazik
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


.elseif eax == WM_NCHITTEST
    mov eax, HTCAPTION
    ret
Posted on 2005-08-23 08:26:50 by Nick
Thank you all , it really works fine
Posted on 2005-08-24 22:25:30 by Rey
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
Posted on 2005-08-28 05:58:09 by diablo2oo2
I've used something similar to Nick's routine for quite a while, and never noticed anything bad - works like a charm.
Posted on 2005-08-28 11:16:29 by f0dder