Link to home
Start Free TrialLog in
Avatar of eakkung
eakkung

asked on

history in IE Object

Hi all,
   I use CHtmlView in my app and I can go back and go forward in history with  GoBack() and GoForward() funtion.  But I have some question How can I know the end of history
so I can disable the back button or forward button.

Does anyone has any idea please suggest me.?
Avatar of Roshan Davis
Roshan Davis
Flag of United States of America image

Try

IOmHistory Interface
Avatar of eakkung
eakkung

ASKER

do you have any sample? I don't know how to use it.
Find "HOWTO: Disable the Default Pop-up Menu for CHtmlView" in MSDN, you can find how to get IWebBrowser2.

From IWebBrowser2, yu will get the IOmHistory.

Good Luck
Avatar of eakkung

ASKER

I used  code like this to get interface
 
     IOmHistory* m_phistObj;
     HRESULT hr1 = lpUnk->QueryInterface(IID_IOmHistory, (void**) &m_phistObj);

but I can not get it. Do you have any idea to suggest me.

I upgrage point to 250
Please wait

I'm looking into the problem..
use CHtmlView::OnCommandStateChange(long nCommand,BOOL bEnable) message handle,program like this:

CMyView::OnCommandStateChange(long nCommand,BOOL bEnable)
{
   switch(nCommand)
   {
   case CSC_NAVIGATEBACK:
      BackButton.Enable=bEnable;
      break;
   case CSC_NAVIGATEFORWARD:
      ForwardButton.Enable=bEnable;
      break;
   default:
      break;
   }
}
ASKER CERTIFIED SOLUTION
Avatar of JaguarWinner
JaguarWinner

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial