Solved

history in IE Object

Posted on 2002-07-10
10
306 Views
Last Modified: 2013-11-20
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.?
0
Comment
Question by:eakkung
  • 3
  • 2
  • 2
10 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7143225
Try

IOmHistory Interface
0
 

Author Comment

by:eakkung
ID: 7145023
do you have any sample? I don't know how to use it.
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7145196
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
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:eakkung
ID: 7145638
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
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7145760
Please wait

I'm looking into the problem..
0
 

Expert Comment

by:JaguarWinner
ID: 7923294
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;
   }
}
0
 

Accepted Solution

by:
JaguarWinner earned 250 total points
ID: 7923428
In addition,you could disable or enable the toolbar's button with this code:

//in the Message Map for CMainFrame
ON_UPDATE_COMMAND_UI(ID_GO_BACK, OnUpdateGoBack)
ON_UPDATE_COMMAND_UI(ID_GO_FORWARD, OnUpdateGoForward)
...

//OnUpdateGoBack function
void CMainFrame::OnUpdateGoBack(CCmdUI* pCmdUI)  
{
   pCmdUI->Enable(m_bBackBtnEnabled);
}
//OnUpdateGoForward function
void CMainFrame::OnUpdateGoForward(CCmdUI* pCmdUI)  
{
   pCmdUI->Enable(m_bForwardBtnEnabled);
}

//your CHtmlView code
CMyView::OnCommandStateChange(long nCommand,BOOL bEnable)
{
  CMainFrame* pMF=(CMainFrame*)AfxGetApp()->m_pMainWnd;
  switch(nCommand)
  {
  case CSC_NAVIGATEBACK:
     pMF->m_bBackBtnEnabled=bEnable;
     break;
  case CSC_NAVIGATEFORWARD:
     pMF->m_bForwardBtnEnabled=bEnable;
     break;
  default:
     break;
  }
}
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now