how would i gow about changing the color of the scroll bar in the edit control?
but i dun think that works
of course i dun think i have the right invokes with it
so think anybody can help mee???

thanks a ton in advance
Posted on 2001-07-27 18:36:15 by sToNeRiFiK
I'd like to hear about this one too.
Posted on 2001-07-27 18:50:54 by karl
This all has been done before... its not much work!!

Here is the source code i worked off of in one of my recient projects...

Check it out.. it has exactly what you want..

Posted on 2001-07-28 00:15:23 by NaN
Excuse me... (i've been into the Glenlivet tonight)

I missed the part about being in an Edit control the first time around... To deal with this, you do the same stuff except you need to sub-class your edit control such that you can place the code to deal with the color message withing the scope of the window that will recieve it...

So sub class the edit control.. and then check for the WM_CRTLCOLOREDIT messge, and do your coloring.... else, send the messge on to the normal proc...

That should about wrap up your problem... I think... feeling a bit wooozy at the moment! heehehe

Posted on 2001-07-28 00:27:42 by NaN
uh you think you could post a code example of that?
cuz i didnt understand what quite what u said

Posted on 2001-07-30 12:06:51 by sToNeRiFiK
Okee... Im happy to help one learn :)

But I to warn you, I have never done this particular problem before.. but my stategy seem sound to me anyways...

I iwll give it a hack tomorrow if i find the time.. (its late tonight.. and again im a weeee bit in the bag.. something about summers in canada.... :) )

gOTTA Luv us Canadians :grin:


Posted on 2001-07-31 00:00:12 by NaN
ok thanks i guess i can wait...j/k
Posted on 2001-07-31 10:30:44 by sToNeRiFiK
Well i gave it a long hard look and came to the conclusion you cant do it with a standard Edit Control... (i didnt look into riched tho.. more likely there..)

The problem is simple.. Whomever Microsoft paid to design the EDIT class control, didnt make use of the SCROLLBAR class that exists to us. Instead i can only figure that they directly copied the code into the edit class..

I came to this conclusion as both sub-classing AND window-spy dont recognize the scroll bars in an EDIT window. I also followed a bunch of custom messages (100h and 200h ) in the Edit subclass and tried to systematically lock out messages until the scroll bars stopped working.. but i gave up looking for the needle in this haystack...

However... you can still do it.. but it will be a longer road.... :(

Basically place an edit window WITHOUT scroll bars... Then create 1 or 2 scroll bars and place then next to your edit window. Then handle the WM_CTLCOLORSCROLL message in your main program when it arrives to color your scroll bars... Problem is.. you need to write code to link up with your edit window to properly adjust when a new line occours... this will be a bit of work... :rolleyes:

** It would have been sooooo simple if the M$ morons re-used their existing code, rather than cut & pasting in the same code and creating custom messages...

If you still want help on my alternative, i will hack it out then... Its late again.. (but im sober!!)

Posted on 2001-07-31 22:05:52 by NaN
I just looked at RichEdit and it too doesnt have its scroll bars Registered within the RichEdit window.... So its looking like you may need to create your own custom window to do this stuff...

(( Unless some GUI guru knows something im overlooking.. ))

Posted on 2001-07-31 22:12:35 by NaN

This all has been done before... its not much work!!
Here is the source code i worked off of in one of my recient projects...
Check it out.. it has exactly what you want..
Translated from C by Ron Thomas

I have been trying to change the colours of the scroll bar in many
ways by changing Ron's code in so many different ways
by means of sub classing, super classing etc. without success.

I tried WM_CTLCOLORSCROLLBAR but it work only on the part where
the slide is under the thumb.

I found that the arrow end parts and the thumb are windows bitmaps.
There is no way to change the colour unless you affect all other windows.

I believe that the only option which remain is to skin these parts of
the scroll bar window. I call it scroll bar window as it is a window,
created with scrollbar class.

This is my two little coins contribution.
Posted on 2001-08-01 03:27:44 by forge
Explorer seems to change the scroll bars pretty nicely with this message board :)
Posted on 2001-08-01 12:27:12 by karl
damn so no luck huh....ok thanks for ur help guys
Posted on 2001-08-01 12:45:47 by sToNeRiFiK
Forge.. ya i noticed the WM_NCPAINT message alot when i was out hunting... you could sub-class and paing your own scroll bars... but this as well would require alot of code...

Posted on 2001-08-01 15:58:39 by NaN
How do you guys think MS Internet Explorer does it?
Posted on 2001-08-01 17:02:28 by karl
karl, i dunno, as it is a bit wierd.
Classes I found in the iexplorer are just without any meaning to me.
;) m$

IExplorer.exe - Main Window:         

Class - IEFrame Caption - Win32ASM Community messageboard - Microsoft Internet Explorer
First child:
Class - Shell DocObject View
Second child:
Class - Internet Explorer_Server
Third child:
Class - Internet Explorer_TridentCmboBx

IMHO the second child window paste the scrollbar
as a bitmap into a DC.
Posted on 2001-08-02 05:55:56 by forge