News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

DeferWindowPos flags

Started by dedndave, February 02, 2011, 01:14:51 PM

Previous topic - Next topic

dedndave

i understand most of what i read at msdn - lol
but, this one makes no sense to me
;SWP_DRAWFRAME      EQU 0020h
;Draws a frame (defined in the window's class description) around the window.
;
;SWP_FRAMECHANGED   EQU 0020h
;Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed.
;If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.

fortunately, i am not using this (these) flag(s) for what i am doing now
but, i want to understand it (them)

also, this one for BeginDeferWindowPos makes no sense, either
QuoteIf any of the windows in the multiple-window-position structure have the
SWP_HIDEWINDOW or SWP_SHOWWINDOW flag set, none of the windows are repositioned.

can anyone shed light on these ???

EDIT - one more question
exactly what does it mean to make a window "active" ?

japheth

Quote from: dedndave on February 02, 2011, 01:14:51 PM
EDIT - one more question
exactly what does it mean to make a window "active" ?

See

http://msdn.microsoft.com/en-us/library/ms632599%28v=vs.85%29.aspx#zorder

especially items Z-Order and Active Window.

donkey

Hi Dave,

When you change the border style of a window with SetWindowLong (GWL_STYLE) you have to recalculate the size of the windows non-client area since it will be slightly smaller or larger. If you don't use SetWindowPos with SWP_FRAMECHANGED the WM_NCCALCSIZE will not be sent and SetWindowLong will have no apparent effect. For SWP_DRAWFRAME, the frame of a window is the border style, for example sunken or 3d, when you use it with SetWindowPos it forces the window to redraw its border (non-client area). For DeferWindowPos, I think I sent you an example of how to use it once, not completely sure if it was you though. DeferWindowPos has a few restrictions, like the ones you mentioned but as I always say "real men use DeferWindowPos, the rest use MoveWindow"  :bg. Seriously though if you have more than two windows to resize or reposition, DeferWindowPos is the best way to accomplish it.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

thanks Edgar
as i said, i am not using these flags   :bg
but, the real question is, how can they have such different descriptions, yet they are the same pin   :dazzled:

this is something like you might expect to see
;SWP_NOOWNERZORDER  EQU 0200h
;Does not change the owner window's position in the Z order.
;
;SWP_NOREPOSITION   EQU 0200h
;Same as the SWP_NOOWNERZORDER flag.


thanks Andreas - i knew it was in there someplace - i just couldn't find it   :P

dedndave

by the way
yes, Edgar - that was me   :U

i am using DeferWindowPos to answer WM_SIZE - actually, that part isn't too bad
here are the pins that i plan on using - i may play with them to see what yields the best results
SWP_NOZORDER or SWP_NOACTIVATE or SWP_NOOWNERZORDER or SWP_NOSENDCHANGING

i figure anything i do to help the function be faster is a good thing
no change in Z-order
no activate - if they are sizing the window, it's already active
no send - i don't handle the WM_WINDOWPOSCHANGING message - no need to send it   :bg

baltoro

Dave,
I always defer to Edgar, when the problem involves anything Windows-related, he's omnicient,...
But, if you want a second opinion,...here is: What's the point of DeferWindowPos?, by Raymond Chen.
Baltoro

dedndave

thanks Baltoro
that made for an interesting read