Discussion:
Static control style "SS_RIGHTJUST" doesn't work at all
(too old to reply)
N***@runtime.com
2004-09-23 13:08:34 UTC
Permalink
Or am I doing something wrong?

The SS_RIGHTJUST flag is supposed to anchor the static control (bitmap or icon) on its bottom
right corner when the control is resized. I'm resizing the window like this:
SetWindowPos( 0, 0, 0, nWidth, nHeight, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE )
and it is being anchored on the top, left. I've also tried loading new, different sized bitmaps into
the control, but it is still being anchored on the top, left corner when it is resized.

Is SS_RIGHTJUST even supported anymore? Is so, could someone please give me an example
of it in action?
Christian ASTOR
2004-09-24 19:06:04 UTC
Permalink
Post by N***@runtime.com
Or am I doing something wrong?
The SS_RIGHTJUST flag is supposed to anchor the static control (bitmap or icon) on its bottom
SetWindowPos( 0, 0, 0, nWidth, nHeight, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE )
and it is being anchored on the top, left. I've also tried loading new, different sized bitmaps into
the control, but it is still being anchored on the top, left corner when it is resized.
Is SS_RIGHTJUST even supported anymore? Is so, could someone please give me an example
The Static control doesn't use this style...
Sigurd Stenersen
2004-09-24 20:16:28 UTC
Permalink
Post by N***@runtime.com
The SS_RIGHTJUST flag is supposed to anchor the static control
(bitmap or icon) on its bottom right corner when the control is
resized.
"SS_RIGHTJUST Specifies that the lower right corner of a static control with
the SS_BITMAP or SS_ICON style is to remain fixed when the control is
resized. Only the top and left sides are adjusted to accommodate a new
bitmap or icon."

This seems to mean that when you assign a new bitmap or icon to the control,
it will adjust the top left corner of the control to keep the lower right
corner in the same spot.
Post by N***@runtime.com
SetWindowPos( 0, 0, 0, nWidth, nHeight, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE )
and it is being anchored on the top, left.
The docs do not state that your resizing of the control is supported in the
same manner.
--
Sigurd
http://utvikling.com
Nollie
2004-09-25 07:16:33 UTC
Permalink
On Fri, 24 Sep 2004 22:16:28 +0200, "Sigurd Stenersen"
Post by Sigurd Stenersen
The docs do not state that your resizing of the control is supported in the
same manner.
You mean this manner? -->
I've also tried loading new, different sized bitmaps into
the control, but it is still being anchored on the top, left corner
when it is resized.

I'm convinced the style isn't implemented anymore. I don't think
anyone will prove me wrong on this.
Gary Chanson
2004-09-25 08:25:10 UTC
Permalink
Post by Nollie
On Fri, 24 Sep 2004 22:16:28 +0200, "Sigurd Stenersen"
Post by Sigurd Stenersen
The docs do not state that your resizing of the control is supported in the
same manner.
You mean this manner? -->
I've also tried loading new, different sized bitmaps into
the control, but it is still being anchored on the top, left corner when it is resized.
I'm convinced the style isn't implemented anymore. I don't think
anyone will prove me wrong on this.
That could be except that it's documented in current issues of MSDN and
not in older issues, which suggests that it's new instead of old.
--
-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
-***@mvps.org
Sigurd Stenersen
2004-09-25 12:30:05 UTC
Permalink
Post by N***@runtime.com
I've also tried loading new, different sized bitmaps into
the control, but it is still being anchored on the top, left corner when it is resized.
I'm convinced the style isn't implemented anymore. I don't think
anyone will prove me wrong on this.
I've been trying to use it myself now, and I think you may be right. Except
for the "anymore" part as SS_RIGHTJUST is rather new.

Or perhaps there is some obscure way of getting it to work - I don't want to
waste any more time on this, it's quite easy to implement the desired
functionality anyway.
--
Sigurd
http://utvikling.com
Christian ASTOR
2004-09-25 13:12:27 UTC
Permalink
Post by Sigurd Stenersen
Or perhaps there is some obscure way of getting it to work
No, because it *is not* implemented in Static control.
Sigurd Stenersen
2004-09-25 13:24:22 UTC
Permalink
Post by Christian ASTOR
Post by Sigurd Stenersen
Or perhaps there is some obscure way of getting it to work
No, because it *is not* implemented in Static control.
RTFM. According to the *docs* it *is*
--
Sigurd
http://utvikling.com
Christian ASTOR
2004-09-25 13:23:14 UTC
Permalink
Post by Sigurd Stenersen
RTFM. According to the *docs* it *is*
Docs are wrong.
Sigurd Stenersen
2004-09-25 13:59:05 UTC
Permalink
Post by Christian ASTOR
Post by Sigurd Stenersen
RTFM. According to the *docs* it *is*
Docs are wrong.
That is what we're saying here. That they seem to be, that is...
--
Sigurd
http://utvikling.com
Christian ASTOR
2004-09-25 14:25:39 UTC
Permalink
Post by Sigurd Stenersen
That is what we're saying here. That they seem to be, that is...
I was just saying it was sure that the Static control doesn't use
SS_RIGHTJUST style, because it doesn't test it at all in its WM_PAINT
handler...
Sigurd Stenersen
2004-09-25 15:22:00 UTC
Permalink
Post by Christian ASTOR
Post by Sigurd Stenersen
That is what we're saying here. That they seem to be, that is...
I was just saying it was sure that the Static control doesn't use
SS_RIGHTJUST style, because it doesn't test it at all in its WM_PAINT
handler...
Well, if you'd stated a bit earlier that you have access to the static
control source code for the latest few versions of Windows and that
SS_RIGHTJUST isn't in it, you could have saved us all a lot of time... ;o(
--
Sigurd
http://utvikling.com
Sigurd Stenersen
2004-09-25 15:23:38 UTC
Permalink
Post by Christian ASTOR
Post by Sigurd Stenersen
That is what we're saying here. That they seem to be, that is...
I was just saying it was sure that the Static control doesn't use
SS_RIGHTJUST style, because it doesn't test it at all in its WM_PAINT
handler...
It wouldn't have to be in the WM_PAINT handler. SS_RIGHTJUST is supposed to
adjust the window rectangle in such a way that the code for drawing a bitmap
or icon would be the same either way...
--
Sigurd
http://utvikling.com
Nollie
2004-09-27 01:27:31 UTC
Permalink
Jeff Partch [MVP]
2004-09-27 01:55:18 UTC
Permalink
Below you'll find a documentation bug report I submitted to MS back in
December. I'm still waiting for any sort of feedback...

The current documentation of the SS_REALSIZEIMAGE style...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/staticcontrols/staticcontrolreference/staticcontrolstyles.asp

says that it: "Adjusts the static icon control to the size of the icon
without centering".

How does this explain what this style actually does? Doesn't a standard
SS_ICON style static already resize itself to fit its icon? And if the
control sizes itself to fit the image, and the image is rendered to fit the
control, what does "without centering" actually mean?

FWIW, this current wording appears to be an attempted fix of earlier
documentation that also got it wrong. The Oct 2001 MSDN Library says about
this style that it, "Prevents ... static controls that have the SS_ICON or
SS_BITMAP style... from being resized as it is loaded or drawn". So where
before it says it 'prevents' resizing, it now implies that it 'causes'
resizing. It appears to have no influence on the resizing behavior at all.
It does not appear to be used by SS_BITMAP style controls at all. It did try
to get across the fact that it only has effect as the control is being
"loaded", but I'm not sure what it meant by the "as it is drawn" part. The
control does not appear to resize itself while painting.

The true implications of this style are seemingly: 1) It is only used during
WM_CREATE processing when an ICON resource name is specified, and is
considered only if the control has the SS_ICON style. 2) By default the
control will use LoadIcon when loading the ICON resource. This style causes
it to instead use LoadImage(hMod, szResName, IMAGE_ICON, 0, 0, 0), and which
I think means it ends up loading the best display matching icon using the
size of the first icon in the RT_GROUP_ICON. 3) It then does a standard
STM_SETICON which does the resizing of the control to fit the icon.

This LoadImage over LoadIcon preference appears to be the only difference.
To me this means it effectively does nothing unless you arrange to have an
icon of a particular size first in the icon group. How common is that? And
if that's the case, how does the current documentation even begin to explain
it?
--
Jeff Partch [VC++ MVP]
Loading...