Mombu 2012-04-24 22:23:56
I am trying to add a button to a custom IE toolbar that will print the
currently displayed website. (Before a get a bunch of posts… I know
this can be done by using File => Print).
Using a number of different examples, I have a custom with a button
that displays a message box when the user clicks on. I have been
struggling with this for a few days and desperately seeking help.
This is what I have so far:
on the SetSite() function I create the toolbar with code below:
// We need to create an Invisible Child Window using the Parent
Window, this will also be used to reflect Command
// messages from the rebar
m_parent.Create(m_rebar, _rcClientParent, NULL, WS_CHILD);
// Now we can create the Tool Bar, using the Invisible Child
m_toolbar.m_hWnd = m_toolbar.CreateSimpleToolBarCtrl(m_parent,
IDR_TOOLBAR, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);
//Get and keep the IInputObjectSite pointer.
m_pSite = _pSite;
//Here I pass the pointer of the IE window to the class that contains
//the button functionality
m_parent.get_ie_handle ( m_pSite );
//this is a code snippet from the CParent class.
//Here have access to the handle to the IE window by retrieving the
LRESULT OnButtonDollar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND
/*hWndCtl*/, BOOL& /*bHandled*/)
//I want to print the current page
void get_ie_handle(IInputObjectSite *m_pSite)
*_m_pSite = *m_pSite;
Hopefully this is clear?
Sorry for the XPosting but I at a wits end