The Answers On Microsoft's Site
Hi Lyla,
I clicked the link which you have in your post and i found the answer there
http://msdn.microsoft.com/workshop/b...#wb_print_hook
Quote:
HCBT_ACTIVATE notifies us when a window is about to receive the WM_ACTIVATE message. It is at this point that we can take control of the dialog. The idea is to send messages to the window to make it think that the user is interacting with the dialog. You can enter text into textboxes, set checkboxes and radio buttons, and click OK or Cancel. The easiest way to identify controls in the dialog is to find out their resource ID's with a tool like Spy++. Then you can call GetDlgItem to obtain the HWND of the control and SendMessage to interact with it
That means that whether the control that controls the fetaures you want to diable/enable/modify is a menu option or button or ANY OTHER control that has a resource Id, and thats nearly all of them.
Quote:
The code that does all of the dirty work in the samples is implemented in a reusable class named CWebBrowserPrint. This is defined in the WebBrowserPrint.h and WebBrowserPrint.cpp files. This makes it easy to incorporate the ability to set custom print settings in any C++ application that is hosting the WebBrowser control. The public aspects of the class are shown below.
Code:
class CWebBrowserPrint
{
public:
enum Orientation {
OrientationUndefined,
OrientationPortrait,
OrientationLandscape };
enum PrintRange {
PrintRangeUndefined,
PrintRangeAll,
PrintRangePages,
PrintRangeSelection };
enum PrintFrames {
PrintFramesUndefined,
PrintFramesScreen,
PrintFramesSelected,
PrintFramesIndividually };
void SetWebBrowser(IWebBrowser2* pWebBrowser);
bool Print();
bool ReadDlgSettings();
CString GetPrinterName(ULONG lIndex);
ULONG GetPrinterCount();
CStrin GetDefaultPrinterName();
// Page Setup dialog settings
CString m_sPaperSize;
CString m_sPaperSource;
CString m_sHeader;
CString m_sFooter;
Orientation m_Orientation;
float m_fLeftMargin;
float m_fTopMargin;
float m_fRightMargin;
float m_fBottomMargin;
// Print dialog settings
CString m_sPrinterName;
bool m_bPrintToFile;
PrintRange m_PrintRange;
ULONG m_lPrintRangePagesFrom;
ULONG m_lPrintRangePagesTo;
ULONG m_lCopies;
bool m_bCollate;
PrintFrames m_PrintFrames;
bool m_bPrintLinks;
bool m_bPrintLinkTable;
};
Thats just a tiny piece of the many many samples and documents, i must admit it took d=some reading, also a point worth noticing is that MS say it work with WIN2000 due to the differences in the new Print Dialog architecture.
DocZaf
{;->
[Edited by Zaf Khan on 08-02-2000 at 09:55 PM]