1. ListView Selection Bar Color

Does anyone know how to set the color of a ListView selection bar color? I know
it can be done without creating an owner drawn control, but I am not 100% sure
how.
I am using Win32Lib....

new topic     » topic index » view message » categorize

2. Re: ListView Selection Bar Color

No one knows how to do this?

C Bouzy wrote:
> 
> Does anyone know how to set the color of a ListView selection bar color? I
> know
> it can be done without creating an owner drawn control, but I am not 100% sure
> how. 
> I am using Win32Lib....


----If you continue to do what you have always done,
you will get what you have always gotten.----

new topic     » goto parent     » topic index » view message » categorize

3. Re: ListView Selection Bar Color

C Bouzy wrote:
> 
> No one knows how to do this?
> 
> C Bouzy wrote:
> > 
> > Does anyone know how to set the color of a ListView selection bar color? I
> > know
> > it can be done without creating an owner drawn control, but I am not 100%
> > sure
> > how. 
> > I am using Win32Lib....
> 
> 
> ----If you continue to do what you have always done,
> you will get what you have always gotten.----

Hello there,

I searched the MS site and couldnt find anything on changing the
selection bar color.  It's possible there is no way to do this
without going to an owner drawn style.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

4. Re: ListView Selection Bar Color

Al Getz wrote:
> 
> C Bouzy wrote:
> > 
> > No one knows how to do this?
> > 
> > C Bouzy wrote:
> > > 
> > > Does anyone know how to set the color of a ListView selection bar color? I
> > > know
> > > it can be done without creating an owner drawn control, but I am not 100%
> > > sure
> > > how. 
> > > I am using Win32Lib....
> > 
> > 
> > ----If you continue to do what you have always done,
> > you will get what you have always gotten.----
> 
> Hello there,
> 
> I searched the MS site and couldnt find anything on changing the
> selection bar color.  It's possible there is no way to do this
> without going to an owner drawn style.
> 
> 
> Take care,
> Al
> 
> And, good luck with your Euphoria programming!
> 
> My bumper sticker: "I brake for LED's"


I didn't try it, but:
The color of a highlighted item in a control is a system color whose identifier
is COLOR_HILIGHT. Using SetSysColor() (in the Window API), and passing it 
this index into the system palette and the new desired color, you'll obtain 
what you wish, well almost.

Almost, because the changes will be visible next time your control is painted 
again.

Almost, because all windows visible at the time of the call will be affected.
The M$ doc recommends calling SetSysColor() whe the app window is maximised, 
for this reason. You can circumvent this by trapping WM_SYSCOLORCHANGE to let 
only your app know about it.

Almost, because you must take care to save and restore the modified system 
color when your app gains/loses focus. Otherwise, the results could be ...
interesting.

I forgot to mention that the above applies to ay of the systel colors you can 
get by GetSysColors().

HTH
CChris

new topic     » goto parent     » topic index » view message » categorize

5. Re: ListView Selection Bar Color

> posted by: C Bouzy <eucoder at hotmail.com>
> 
> No one knows how to do this?
> 
> C Bouzy wrote:
> > 
> > Does anyone know how to set the color of a ListView selection bar color? I
> > know
> > it can be done without creating an owner drawn control, but I am not 100%
> > sure
> > how. 
> > I am using Win32Lib....
I can use LVM_SETTEXTBKCOLOR, LVM_SETTEXTCOLOR, and LVM_SETBKCOLOR
(which do not
affect the selection bar colour), however I noticed LVM_SETSELECTIONMARK
for which
I cannot find any documentation. Does that ring a bell?

Regards,
Pete
-- 
  
  petelomax at fastmail.fm

-- 
http://www.fastmail.fm - Accessible with your email software
                          or over the web

new topic     » goto parent     » topic index » view message » categorize

6. Re: ListView Selection Bar Color

petelomax wrote:
> 
> > posted by: C Bouzy <eucoder at hotmail.com>
> > 
> > No one knows how to do this?
> > 
> > C Bouzy wrote:
> > > 
> > > Does anyone know how to set the color of a ListView selection bar color? I
> > > know
> > > it can be done without creating an owner drawn control, but I am not 100%
> > > sure
> > > how. 
> > > I am using Win32Lib....
> I can use LVM_SETTEXTBKCOLOR, LVM_SETTEXTCOLOR, and LVM_SETBKCOLOR
> (which do not
> affect the selection bar colour), however I noticed LVM_SETSELECTIONMARK
> for which
> I cannot find any documentation. Does that ring a bell?
> 
> Regards,
> Pete
> -- 
>   
>   petelomax at fastmail.fm
> 
> -- 
> <a href="http://www.fastmail.fm">http://www.fastmail.fm</a> - Accessible with
> your email software
>                           or over the web
> 
> 

Hi there Pete,


I think the set selection mark thing only sets the first item in
a set of selected items.  It shouldnt affect the color in any way.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

7. Re: ListView Selection Bar Color

CChris wrote:
> 
> Al Getz wrote:
> > 
> > C Bouzy wrote:
> > > 
> > > No one knows how to do this?
> > > 
> > > C Bouzy wrote:
> > > > 
> > > > Does anyone know how to set the color of a ListView selection bar color?
> > > > I know
> > > > it can be done without creating an owner drawn control, but I am not
> > > > 100% sure
> > > > how. 
> > > > I am using Win32Lib....
> > > 
> > > 
> > > ----If you continue to do what you have always done,
> > > you will get what you have always gotten.----
> > 
> > Hello there,
> > 
> > I searched the MS site and couldnt find anything on changing the
> > selection bar color.  It's possible there is no way to do this
> > without going to an owner drawn style.
> > 
> > 
> > Take care,
> > Al
> > 
> > And, good luck with your Euphoria programming!
> > 
> > My bumper sticker: "I brake for LED's"
> 
> 
> I didn't try it, but:
> The color of a highlighted item in a control is a system color whose
> identifier
> is COLOR_HILIGHT. Using SetSysColor() (in the Window API), and passing it 
> this index into the system palette and the new desired color, you'll obtain
> 
> what you wish, well almost.
> 
> Almost, because the changes will be visible next time your control is painted
> 
> again.
> 
> Almost, because all windows visible at the time of the call will be affected.
> The M$ doc recommends calling SetSysColor() whe the app window is maximised,
> 
> for this reason. You can circumvent this by trapping WM_SYSCOLORCHANGE to let
> 
> only your app know about it.
> 
> Almost, because you must take care to save and restore the modified system 
> color when your app gains/loses focus. Otherwise, the results could be ...
> interesting.
> 
> I forgot to mention that the above applies to ay of the systel colors you can
> 
> get by GetSysColors().
> 
> HTH
> CChris

Hi there,

I've always found it strange what Windows API "Lets" you change and what
it doesnt.  It's like someone has to sit down one day and say:
"ok, we wont let them change the color of this because we dont think
it should change and what we think is better than what anybody else
thinks".
Strange too, because somewhere in the system dll it has to do:
  color=GetSystemColor(x)
to get the color.  One more stinky little function call:
  SetBarColor(color)
and you could set the bar color of any control that has a selection
bar, but noooo that would be too good :)
Are they afraid someone will set it to the same color as the text and
then the text wont be visible?  I could think of a million other ways
to screw up an app and they havent been afraid of that, and they sure
weren't afraid of hackers when surfing with IE he he.

Perhaps in Windows9000 op sys you'll be able to do it :)


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

8. Re: ListView Selection Bar Color

Using SkinCrafter and other similar skin libs allows you to do this with ease,
the problem is
SkinCrafter currently does not support customizing the selection bar in
ListViews. It does support
customizing the selection bar in a plain list control. I never understood why
Windows did not allow
the customizing of all controls without going through the trouble of owner draw
controls.
 From what I hear Windows Vista will allow better customizing of controls.


> Hi there,
> 
> I've always found it strange what Windows API "Lets" you change and what
> it doesnt.  It's like someone has to sit down one day and say:
> "ok, we wont let them change the color of this because we dont think
> it should change and what we think is better than what anybody else
> thinks".
> Strange too, because somewhere in the system dll it has to do:
>   color=GetSystemColor(x)
> to get the color.  One more stinky little function call:
>   SetBarColor(color)
> and you could set the bar color of any control that has a selection
> bar, but noooo that would be too good :)
> Are they afraid someone will set it to the same color as the text and
> then the text wont be visible?  I could think of a million other ways
> to screw up an app and they havent been afraid of that, and they sure
> weren't afraid of hackers when surfing with IE he he.
> 
> Perhaps in Windows9000 op sys you'll be able to do it :)
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu