News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Flat dialog sizing

Started by ragdog, February 12, 2013, 07:34:50 PM

Previous topic - Next topic

ragdog

Hi

I have a Flat dialog with a Bitmap now search i a function to sizing the dialog with WM_LBUTTONDOWN
Have your an idea how i can make it?

I think this is a right way Or?
ok the rect calc is not right but this is not the question

.elseif uMsg == WM_LBUTTONDOWN
            invoke SetCapture,hWnd
invoke GetCursorPos,addr OldPos
.elseif uMsg==WM_MOUSEMOVE
            invoke GetWindowRect,hWnd,addr Rect
invoke GetCursorPos,addr NewPos
mov eax,NewPos.x
mov ecx,eax
add eax,OldPos.x
mov OldPos.x,ecx
add eax,Rect.left
mov ebx,NewPos.y
mov ecx,ebx
add ebx,OldPos.y
mov OldPos.y,ecx
add ebx,Rect.top
mov ecx,Rect.right
sub ecx,Rect.left
mov edx,Rect.bottom
sub edx,Rect.top
invoke MoveWindow,hWnd,eax,ebx,0,0,TRUE
invoke ReleaseCapture


Regards..

hfheatherfox07

Hello ragdog,
I got help with this here:
http://www.masmforum.com/board/index.php?topic=17332.15
Is this what you want ?
It resizes flat window

Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

dedndave

i think he is doing something a little different
he wants to drag-size the window - i don't remember us doing that on the old thread

you shouldn't have to call GetCursorPos, as WM_LBUTTONDOWN, WM_LBUTTONUP, and WM_MOUSEMOVE
all give you the cursor coordinates in lParam (client coordinates)

in the case of WM_NCLBUTTONDOWN,  WM_NCLBUTTONUP, and  WM_NCMOUSEMOVE,
they all pass a pointer to a POINT structure that has screen coordinates

i think those are the messages you actually want to handle because you are outside the client area
(NC = non-client)

i would SetCapture for WM_NCLBUTTONDOWN if the coordinates lie on the border and set a flag
and, if the flag is set, ReleaseCapture for WM_NCLBUTTONUP and clear the flag
you can then use WM_CAPTURECHANGED to do any clean-up after ReleaseCapture

also, i prefer SetWindowPos over MoveWindow as it is more powerful
but, that may not be necessary

ragdog

Hey dave

Thanks for your idea i have found a other solution  :t

.elseif uMsg == WM_LBUTTONDOWN
    invoke SendMessage,hWnd,WM_NCLBUTTONDOWN,HTBOTTOM,0

ragdog

Hehe is a bad idea to use
invoke SendMessage,hWnd,WM_NCLBUTTONDOWN,HTBOTTOM,0

dedndave

yah - that didn't make any sense
especially without setting lParam to the screen coordinates

i guess i have to ask....
why not set the style bits so it is a sizable window ?   :P

ragdog

#6
Quotei guess i have to ask....
why not set the style bits so it is a sizable window ?   :P

Hehe i need this without the size border frame

I think  it is enought if i get the mouse pos + calc the window rect for sizing the window or?

.ELSEIF uMsg==WM_LBUTTONDOWN
      mov eax,lParam
      mov edx,eax
      and eax,0ffffh ; eax=x
      shr edx,16      ; edx=y

I try to make this panel from  http://www.un4seen.com/xmplay.html

ragdog

Know any to works this?

I know only this have 3 Window forms
And left or right panel dock on Main dialog

My docking have i finish but with this size panel on Mouse move have i problems

But i have try to find a example in c++ or any but i cannot find any

dedndave

WM_LBUTTONDOWN, WM_LBUTTONUP, and WM_MOUSEMOVE
messages are sent to a window when the mouse is in the client area

the border of a window is in the non-client area
so, i would think WM_NCLBUTTONDOWN,  WM_NCLBUTTONUP, and
WM_NCMOUSEMOVE are the messages you want to handle

hfheatherfox07

@ragdog,
Look here:
Resizing borderless form

http://masm32.com/board/index.php?topic=1340.0

Although zunex.zip  crashes for me even with the fixes
Does it work for you?
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

qWord

The example in the attachment shows a concept how it could be done. Remarks that there are some details that has not been worked out.
MREAL macros - when you need floating point arithmetic while assembling!

hfheatherfox07

Hey qWord
It fails here on XP
It seems to go between a dialog type window and flat...
Unstable
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

dedndave

are you using WS_POPUP or WS_DLGFRAME style flags ?

i was playing a little bit - it appears that WS_DLGFRAME gives me a 1-pixel border

if i use (WS_POPUP or WS_VISIBLE or WS_CLIPCHILDREN), i get a window with no frame

hfheatherfox07

Quote from: dedndave on February 13, 2013, 05:56:54 AM
are you using WS_POPUP or WS_DLGFRAME style flags ?

i was playing a little bit - it appears that WS_DLGFRAME gives me a 1-pixel border

if i use (WS_POPUP or WS_VISIBLE or WS_CLIPCHILDREN), i get a window with no frame

Which one are you referring to ? qWord's example or  http://masm32.com/board/index.php?topic=1340.0
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

dedndave

neither - lol

i was asking ragdog   :P