In the custom browser control, use some items and functions in the IE default right-click menu to remove those annoying junk items and view the source code. The method is as follows: idochostuihandler_my: showcontextmenu (DWORD dwid, point _ rpc_far * PPT,
Iunknown _ rpc_far * pcmdtreserved,
Idispatch _ rpc_far * pdispreserved)
{
Hwnd;
Ccomptr <iolecommandtarget> spct;
Ccomptr <iolewindow> spwnd;
Hresult hR = pcmdtreserved-> QueryInterface (iid_iolecommandtarget, (void **) & spct );
HR = pcmdtreserved-> QueryInterface (iid_iolewindow, (void **) & spwnd );
HR = spwnd-> getwindow (& hwnd );
Hinstance hinstshdoclc = loadlibrary (text ("shdoclc. dll "));
If (hinstshdoclc = NULL)
{
// Loading module error -- use the default browser control for handling
Return e_notimpl;
}
Hmenu = loadmenu (hinstshdoclc, makeintresource (24641 ));
Hmenu = getsubmenu (hmenu, dwid );
Int num = getmenuitemcount (hmenu );
Uint ID;
For (INT I = num-1; I>-1; I --) // delete all other menus {
Id = getmenuitemid (hmenu, I );
If (ID = 16 | id = 15 | id = 26 | id = 31 | id = 2270 | id = 17) continue; // retain cut, copy, paste, select all, save the image as, delete
If (ID> 2379 & id <2387) break; // vertical scroll bar: Scroll up, down, up, down, scroll up
If (ID> 2386 & amp; id <2393) break; // horizontal scroll bar
Deletemenu (hmenu, ID, mf_bycommand );
}
If (getmenuitemcount (hmenu)> 0)
{
// Display the shortcut menu
Int iselection =: trackpopupmenu (hmenu, tpm_leftalign | tpm_rightbutton | tpm_returncmd,
PPT-> X, PPT-> Y, 0, hwnd, (rect *) null );
// Send the command of the selected shortcut menu item to the shell
Lresult LR =: sendmessage (hwnd, wm_command, iselection, null );
}
Freelibrary (hinstshdoclc );
Return s_ OK;
}