Hello folks! I'm working on a front-end for Microsoft Internet Explorer which incorporates tabbed browsing and Direct Document Object Model Editing. Anyway, I've run into a strange problem with the code I'm using to hook the Favorites menu. The Favorites menu works flawlessly, but when I click the ComboBox I'm using as an address bar, the application crashes immediately. This happens in debug mode and as a stand-alone EXE. When I comment out the code to hook the menu, everything works fine, except I cannot open my Favorites. Here's the code I am using to hook my Favorites menu:
And here is the MenuProc function:
I am going insane trying to figure out why this hook would interfere with anything on the form, let alone a ComboBox!? Any help with this problem will be extremely appreciated 
Code:
ProcRet& = GetWindowLong(Main.HwND, GWL_WNDPROC)
Call SetWindowLong(Main.HwND, GWL_WNDPROC, AddressOf MenuProc)
Code:
Public Function MenuProc(ByVal HwND As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If wMsg& = WM_CLOSE Then
Call SetWindowLong(HwND&, GWL_WNDPROC, ProcRet)
ElseIf wMsg& = WM_COMMAND Then
If wParam& >= 1000 Then
Main.Web(Controller(Main.Tabs.SelectedItem.index)).Navigate FavoriteLinks(wParam - 1000)
End If
End If
MenuProc = CallWindowProc(ProcRet&, HwND&, wMsg&, wParam&, lParam&)
End Function
