PC Review


Reply
Thread Tools Rate Thread

Customize webbrowser

 
 
badzio
Guest
Posts: n/a
 
      29th Dec 2009
Hi, is it possible to customize default webbrowser control?
Actually I want to change the color of scrollbar in this control.
How can I do it?
 
Reply With Quote
 
 
 
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      29th Dec 2009
So, you've not told us 1) what version of Windows CE you are using or if you
are using Windows Mobile, 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,
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.

I will also ask, have you looked at WM_CTLCOLORSCROLLBAR?

Paul T.

"badzio" wrote:

> Hi, is it possible to customize default webbrowser control?
> Actually I want to change the color of scrollbar in this control.
> How can I do it?
> .
>

 
Reply With Quote
 
badzio
Guest
Posts: n/a
 
      29th Dec 2009
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.
 
Reply With Quote
 
badzio
Guest
Posts: n/a
 
      30th Dec 2009
On 30 Gru, 00:47, badzio <bad...@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
 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      30th Dec 2009
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...@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
> .
>

 
Reply With Quote
 
badzio
Guest
Posts: n/a
 
      3rd Jan 2010
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...@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.
 
Reply With Quote
 
badzio
Guest
Posts: n/a
 
      3rd Jan 2010
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?
 
Reply With Quote
 
Mark Erikson
Guest
Posts: n/a
 
      3rd Jan 2010
On Jan 3, 4:19*pm, badzio <bad...@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. *Itdepends
> > 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, youmight
> > 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?


Actually, it is possible. I've made a couple of previous posts about
it. See
http://groups.google.com/group/micro...474b597e144918
for one of them.
 
Reply With Quote
 
badzio
Guest
Posts: n/a
 
      3rd Jan 2010
On 3 Sty, 22:19, badzio <bad...@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. *Itdepends
> > 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, youmight
> > 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/arc...20/420551.aspx
and
https://blogs.msdn.com/netcfteam/arc...20/420551.aspx
Also I've added WindowsMessages as mentioned in
http://social.msdn.microsoft.com/For...5-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?
 
Reply With Quote
 
badzio
Guest
Posts: n/a
 
      3rd Jan 2010
On 3 Sty, 23:33, Mark Erikson <mark.erik...@gmail.com> wrote:
> On Jan 3, 4:19*pm, badzio <bad...@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?

>
> Actually, it is possible. *I've made a couple of previous posts about
> it. *Seehttp://groups.google.com/group/microsoft.public.dotnet.framework.comp...
> for one of them.


Yeah, I've found that (see my another post).
But for webbrowser event is never called for listview is called but
repainting doesn't work
case -177:
{
//IntPtr hdc = (IntPtr) wParam;
IntPtr hdc = hwnd;
Graphics g = Graphics.FromHdc(hdc);
//using (Graphics g = Graphics.FromHdc(hdc))
if (g != null)
{
System.Drawing.Brush brush;
brush = new System.Drawing.SolidBrush
(Color.Red);
g.FillRectangle(brush, 0, 0, 100, 100);
}

}
break;
(i've found that wm_ctlcolorscrollbar is -177, probably difference
between int and uint).
Graphics g = Graphics.FromHdc(hdc) - this line caused that event is
called again, line
if (g != null)
is never called
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect Popup fired by a webbrowser element to a second webbrowser Andre Rode Microsoft VB .NET 0 31st Mar 2008 10:27 AM
webbrowser control: how to capture event of mouse hovering over thelink or mouse click events in webbrowser only? P-GPS Microsoft VB .NET 1 15th Dec 2007 11:31 AM
Customize html output of WebBrowser Control or Get Cursor Position =?Utf-8?B?QVNQIERldmVsb3Blcg==?= Microsoft Dot NET Framework 1 29th Sep 2006 02:57 AM
How to Convert SHDocVw.WebBrowser to System.Windows.Forms.WebBrowser Qiang Microsoft C# .NET 2 22nd Sep 2006 03:33 PM
Create various instances of WebBrowser and store in a WebBrowser array, using VS.NET 2005 zorhel Microsoft Dot NET Framework Forms 2 24th Aug 2004 10:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:09 AM.