How to swiftly move window without TitleBar and border?

Started by CoR, March 30, 2007, 09:20:41 PM

Previous topic - Next topic

ramguru

Don't expect simple answer for advanced question  :wink
In my dialog editor I use EnumChildWindows, then I use:

[in enum proc (lParam = DWORD(pt.y,pt.x))]
GetParent ; to get parent window handle
GetWindowRect ; to get child window rect
ClientToScreen ; to translate coor
PtInRect ; to check if mouse was pressed in child window

That involves also z-order, if controls overlaps, also some controls are composite and complicate things...
That's just to get window handle

CoR

Ok, thanks. That will be a good guideline. I'll post code as soon as make something half usable  :wink

ramguru

I should mention one thing, that might be not what you want and not work in your app, besides in dialog editor everything is different: all windows are disabled...


CoR

Quote from: ramguru on April 10, 2007, 05:42:44 PM
Don't expect simple answer for advanced question  :wink
Hehehe  :bg

I have putted this problem on a side because I thought it was out of my grasp. For I while I coded some EditBoxes for window resizing. Well I do not know (yet) how to pass values from EditBox to variable but here's the solution for EditBoxDragging:


    invokel CreateWindowEx,.......
         mov  hEDIT,eax
       
invoke SetWindowLong,hEDIT,GWL_WNDPROC,myDraggingEDITboxProc
mov hEDITold,eax           ;places addr of an OLD (default) window editbox proc

EDITboxProc proc hWnd:DWORD, uMsg:DWORD, wParam :DWORD, lParam :DWORD

@@:;_______________________no return value!!!!!
cmp uMsg,WM_MOUSEMOVE
jne @f
some code
jmp TheEnd

@@:;_________________________no return value!!!!!
cmp uMsg,WM_LBUTTONDOWN
jne @F
some code
jmp TheEnd
@@:
bla,bla,bla code for REGULAR window movement. Basically it's exactly the same parts of proc that Limo or I have posted earlier.
jmp TheEnd

@@:
TheEnd:
invoke CallWindowProc,hEDITold,hWnd,uMsg,wParam,lParam
   ret
EDITboxProc endp


You just have to be sure that NewEditBox has no ret's in any WM_check! To be able to pass msg parameters to Default EditBox proc. It's works like a charm.

So simple, clean, nice... I am starting to think good about Window creators. As a concept is seems that they did good job!


keywords: child control edit box move drag