I am currently create a simple additional button to my Internet Explorer 7, toolbar. The button works. I am using Visual C++.
But now, I would like to create a to create a button during my Internet Explorer is running. Means, on certain condition, my program (a dll registered with regsvr32) will add a button to the toolbar. and after certain condition, the button also can be disappeared.
How can I achieve this?
update:
I tried using this line:
ShowWindow(hWndButton, SW_HIDE);
It hides my Internet Explorer browser. Under Task Manager, it is still running. How to make it hide only the button object?
edit:
I want to modify this code..
STDMETHODIMP CButtonDemoBHO::Exec(const GUID*, DWORD nCmdID, DWORD d, VARIANTARG*, VARIANTARG* pvaOut){
ATLTRACE("CButtonDemoBHO::Exec\n");
switch (nCmdID){
case BUTTON_PRESSED:
MessageBox(m_hWnd, L"You have pressed the button", L"Button Pressed", MB_OK);
<------- I would like to hide the button here.
break;
case MENU_ITEM_SELECT:
MessageBox(m_hWnd, L"You have simulated a button press with the menu ", L"Menu Pressed", MB_OK);
break;
}
return S_OK;
}