RE: Bug? Setting Scrollbar Width on XP
- From: Peter Ritchie <PRSoCo@xxxxxxxxxxxxxxxxx>
- Date: Mon, 19 Jun 2006 13:00:02 -0700
It is not a bug in Windows, it is a bug in your application.
Under no circumstances should you expect that setting a system-wide
parameter or metric for a short duration of time will only affect your
application. It may appear, under certain circumstances, that it works; but
in others it will not. And, as you've noticed there are other side-effects.
If your application is run on a multi-core or multi-processor computer this
would increase the likelihood that another application could be drawing its
scrollbar while your fiddling with system values.
The scrollbar width is a system-wide setting that you should assume the user
has explicitly set. To ignore that setting, or to circumvent it; as you have
done, is basically ignoring what the user is telling you to do. ...sign of a
poorly designed application with a fragile and user-unfriendly user interface.
--
http://www.peterRitchie.com/
"MarkA" wrote:
I am using the SystemParametersInfo API call, using.
SPI_GETNONCLIENTMETRICS /SPI_SETNONCLIENTMETRICS calls to set the width
of the scroll bar on Windows XP (NONCLIENTMETRICS.iScrollWidth).
Under Windows 2000 the code works a-ok, allowing me to resize the
scrollbars back and forth between normal/large modes without any
problems.
On Windows XP, interestingly, in addition to the resize of the
scrollbars (which work ok), the icons in the system tray (notification
area, whatever you want to call it) are also resized larger when the
scrollbars are sized larger, but they never return smaller once the
scrollbars are returned to normal width.
I was curious about this so did a bit of extra investigation. If I call
SystemParametersInfo and do a Get, directly followed by a Set, the same
thing happens, the icons in the system tray go large. The only way of
changing them back to normal size is to switch theme back to windows
classic then back to XP.
I have traced all the size-based values of the NONCLIENTMETRICS
structure between the gets and sets, and the int based size values do
not change (or in the case of settging the scrollbar width, only the
scrollbar width changes). The only thing I can think of is that I have
an error in my struct (I am using C#, so my struct is defined there)
and have something, somewhere offset or missing.
Any thoughts would be most appreciated!
Mark
PS. These bits are used by one of our enterprise apps to provide an
"enhanced view" (high contrast/big scrollbars) for use on mobile tablet
applications when outdoors. I mention this to avoid any trolls who'se
only input may be snidely suggest that we shouldnt be doing this in the
first place, the functionality is a requirement of the client.
- Follow-Ups:
- Re: Bug? Setting Scrollbar Width on XP
- From: MarkA
- Re: Bug? Setting Scrollbar Width on XP
- References:
- Bug? Setting Scrollbar Width on XP
- From: MarkA
- Bug? Setting Scrollbar Width on XP
- Prev by Date: Re: problem getting info on menuitems
- Next by Date: Re: DLGITEMTEMPLATEEX - id member
- Previous by thread: Bug? Setting Scrollbar Width on XP
- Next by thread: Re: Bug? Setting Scrollbar Width on XP
- Index(es):
Relevant Pages
|