mkumar12345 0 Newbie Poster

Hi experts, I am trying to find the current level of zoom in a webbrowser control. I know how to zoom but the same doesn't work for retrieving the current level of zoom.

I am trying the following:

Dim  currentZoom As Integer
          
DirectCast(Me.ActiveXInstance, SHDocVw.WebBrowser).ExecWB(Exec.OLECMDID_OPTICAL_ZOOM, ExecOpt.OLECMDEXECOPT_PROMPTUSER, IntPtr.Zero, currentZoom)

But I keep getting a value of 0 in currentZoom.

Here is the MSDN documentation on this:
http://msdn.microsoft.com/en-us/library/ms691264%28VS.85%29.aspx

In the documentation you will see the following information regarding extracting the current zoom level:

"To query the current zoom value. The caller of IOleCommandTarget::Exec passes OLECMDEXECOPT_DONTPROMPTUSER as the execute option in nCmdExecOpt and NULL for pvIn. The object returns the current zoom value in pvaOut. When the object goes UI active, it retrieves the current zoom value from the container's frame object using this same mechanism and updates its zoom control with the returned value."

Is it a bug or am I not using it the correct way? Please help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.