From: "Paul G. Tobey [eMVP]" paul tobey _AT_ earthlink _DOT_ on
There's a scroll bar control on there somewhere, I think. If so, you should
be able to get its window handle and send that handle messages just like any
other window. As mentioned, find the window handle for the scroll bar and
subclass it is your best chance. If you can't make that work, the only way
I know to change the scroll color would be to change the global color
setting for scroll bars, all scroll bars, in all applications.

Paul T.

"badzio" <badzio(a)gmail.com> wrote in message
news:901d7c68-1bc4-4ea4-9a50-db639b232fda(a)c34g2000yqn.googlegroups.com...
On 30 Gru 2009, 19:45, Paul G. Tobey [eMVP] <paultobey _at_ earthlink
_dot_ net> wrote:
> Have you tried my other suggestion of using WM_CTLCOLORSCROLLBAR. It
> depends
> on the parenting of the controls whether you can easily use this or not,
> of
> course. If the Web browser control is the parent of the scroll bar, you
> might
> try subclassing the Web browser window and taking over processing of
> WM_CTLCOLORSCROLLBAR.
>
> You can use Remote Spy to examine what windows belong to what parent
> windows
> for your application...
>
> Paul T.
>
> "badzio" wrote:
> > On 30 Gru, 00:47, badzio <bad...(a)gmail.com> wrote:
> > > On 29 Gru, 20:21, Paul G. Tobey [eMVP] <paultobey _at_ earthlink _dot_
>
> > > net> wrote:
> > > > So, you've not told us 1) what version of Windows CE you are using
> > > > or if you
> > > > are using Windows Mobile,
>
> > > Windows Mobile 6 (both profesional and standard)
>
> > > 2) what browser you are using (the availability of
>
> > > > several depends on what version of CE, of course), 3) whether you
> > > > are trying
> > > > to customize a binary version of the browser or if you have the
> > > > source code,
>
> > > Sorry, not enough informations :)
> > > I'm developing application in c# (CF .Net 2.0) on WM6 (pro/standard).
> > > I'm using control System.Windows.Forms.WebBrowser so I don't have
> > > sources of that.
>
> > > > 4) whether you are willing to accept a change to the color of all
> > > > scroll bars
> > > > as the price of changing the color of the one in your browser.
>
> > > Yes if all scrollbars means all scrollbars only in my application
> > > (probably next step will be changing scrollbar color in listview) :)
> > > If all scrollbars in all applications that probably not but I can
> > > consider that (workarround - changing default color for scrollbar when
> > > my application get/lost focus).
>
> > > Or maybe do you know any webbrowser control which I could use (LGPL or
> > > similar license - I must use it in commercial application).
> > > The best if it would be for free :)
> > > I heard about resco controls but not sure if I can change colors
> > > there.
>
> > I tried to put VScrollBar on the form and hide scrollbar included in
> > webbrowser. But I don't have access to webbrowser's scrollbars so I
> > cannot scroll the page, I don't know how big should scrollbar etc
> > .

Not sure if understand properly. Scrollbar is part of WebBrowser
control (scrollbar is controled by webbrowser, I cannot check what's
the status of scroll, cannot set new position etc).
I've checked RemoteSpy - dependency is: "No name" (#NETCF_AGL_BASE)-
>"No name" (#NETCF_AGL_BASE)->(...)->"No name" (#NETCF_AGL_CONTAINER)-
>"No name" (IExplore)->{"No name" (MSPIE Status), "No name" (PIEHTML)}
Also is some window "No name" (Url Moniker Notification Window).
Also another window, related with my application but without childs
It's strange because WebBrowser is not separate application, it's a
control in my application, on Panel.


From: "Paul G. Tobey [eMVP]" paul tobey _AT_ earthlink _DOT_ on
It's not necessarily true that some particular event handler will work for a
WebBrowser control. Do what I suggested and properly subclass the control,
in C, if necessary, to familiarize yourself with what needs to be done.
Then port that code to managed code.

Paul T.

"badzio" <badzio(a)gmail.com> wrote in message
news:61aa2a43-51c4-4779-8109-9f5016c8fdd3(a)s31g2000yqs.googlegroups.com...
On 3 Sty, 22:19, badzio <bad...(a)gmail.com> wrote:
> On 30 Gru 2009, 19:45, Paul G. Tobey [eMVP] <paultobey _at_ earthlink
>
> _dot_ net> wrote:
> > Have you tried my other suggestion of using WM_CTLCOLORSCROLLBAR. It
> > depends
> > on the parenting of the controls whether you can easily use this or not,
> > of
> > course. If the Web browser control is the parent of the scroll bar, you
> > might
> > try subclassing the Web browser window and taking over processing of
> > WM_CTLCOLORSCROLLBAR.
>
> I've found that .Net CF doesn't allow to override WndProc. How to
> solve that problem? :(

I've found some workarround for WndProc:
https://blogs.msdn.com/netcfteam/archive/2005/05/20/420551.aspx
and
https://blogs.msdn.com/netcfteam/archive/2005/05/20/420551.aspx
Also I've added WindowsMessages as mentioned in
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/211058d5-f052-49ef-aab5-38baf5b3703e

Following these articles I've created class WebBrowserEx:WebBrowser,
overrided method OnParentChanged and implemented method
WM_Notify_Handler.
But WM_Notify_Handler is never called :(
So I tried with ListView (because ListView is another control where I
must customize scrollbars).
And WM_NOTIFY_HANDLER is called many times. When listview is created
and when is scrolled. But nmHdr.code contains strange values - it's 0
or some big number, nothing similar to defined values.
Any help?


From: badzio on
On 4 Sty, 03:54, "Paul G. Tobey [eMVP]" <paul tobey _AT_ earthlink
_DOT_ net> wrote:
> There's a scroll bar control on there somewhere, I think.  If so, you should
> be able to get its window handle and send that handle messages just like any
> other window.  As mentioned, find the window handle for the scroll bar and
> subclass it is your best chance.  

Checked again. Remote spy doesn't find any scrollbar window for
listview and webbrowser. But if Form contains scrollbar than I can
find it in remote spy.

> If you can't make that work, the only way
> I know to change the scroll color would be to change the global color
> setting for scroll bars, all scroll bars, in all applications.

Can I (from code, at runtime) change global color settings for
scrollbar? SystemColors (which contains default colors for all
controls, windows, elements) attributes are read only. I've found that
it's not possible to change SystemColors attributes and the only way
to customize is custom paiting
But for webbrowser webbrowser:
1) I'm not able to handle message WM_CTLCOLORSCROLLBAR
2) I don't have any information about scrolling, scrollbar's position
and size so I cannot manually paint the scrollbar rectangle
From: Paul G. Tobey [eMVP] paultobey _at_ earthlink _dot_ on
Try P/Invoking GetSysColor() and SetSysColors() for COLOR_SCROLLBAR to change
the colors for all scroll bars on the device.

I would try, as mentioned before in C, to handle the scrollbar control color
message by subclassing the browser window. While you're at it, you could
also handle it in the main window procedure. Maybe it ends up there...

Paul T.

"badzio" wrote:

> On 4 Sty, 03:54, "Paul G. Tobey [eMVP]" <paul tobey _AT_ earthlink
> _DOT_ net> wrote:
> > There's a scroll bar control on there somewhere, I think. If so, you should
> > be able to get its window handle and send that handle messages just like any
> > other window. As mentioned, find the window handle for the scroll bar and
> > subclass it is your best chance.
>
> Checked again. Remote spy doesn't find any scrollbar window for
> listview and webbrowser. But if Form contains scrollbar than I can
> find it in remote spy.
>
> > If you can't make that work, the only way
> > I know to change the scroll color would be to change the global color
> > setting for scroll bars, all scroll bars, in all applications.
>
> Can I (from code, at runtime) change global color settings for
> scrollbar? SystemColors (which contains default colors for all
> controls, windows, elements) attributes are read only. I've found that
> it's not possible to change SystemColors attributes and the only way
> to customize is custom paiting
> But for webbrowser webbrowser:
> 1) I'm not able to handle message WM_CTLCOLORSCROLLBAR
> 2) I don't have any information about scrolling, scrollbar's position
> and size so I cannot manually paint the scrollbar rectangle
> .
>