Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Webbrowser hWnd Fails?

Status
Not open for further replies.

SolarStorm

Programmer
Joined
Aug 6, 2000
Messages
1
Location
CA
Anyone know how to get the hwnd of the web browser control in VB 6.0?<br><br>I want to replace the winproc of the web browser control with my own.&nbsp;&nbsp;But<br>if I use the Webbrowser.hWnd property of the control, I always get the<br>message<br><br>Method 'HWND' of object 'IWebBrowser2' failed&nbsp;&nbsp;#-2147467259<br><br>What I really want to do is suppress the standard popup menu for the<br>Webbrowser control with my own.&nbsp;&nbsp;My intention was to replace the<br>webbrowser's winproc with<br><br>Function WindowProc(ByVal hw As Long, _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByVal uMsg As Long, _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByVal wParam As Long, _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByVal lParam As Long) As Long<br>&nbsp;&nbsp;&nbsp;&nbsp;Select Case uMsg<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case WM_RBUTTONUP<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frmBrowser.PopupMenu frmBrowser.mnuKidsmenu<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Case Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WindowProc = CallWindowProc(lpPrevWndProc, hw, _<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uMsg, wParam, lParam)<br>&nbsp;&nbsp;&nbsp;&nbsp;End Select<br>End Function<br><br>But in order to replace the Winproc, I need the hwnd of the of the web<br>browser.<br><br>Any help here would be appreciated.<br><br>Bob Bryenton<br><A HREF="mailto:bbryenton@solstorm.com">bbryenton@solstorm.com</A><br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top