473,763 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to capture WebBrowser's OnAfterPrint event in C++?

Hi All,

I am writing a complex print job solution that requires the printing
of many HTML documents in an exactly defined order. Our application
uses the IE WebBrowser control to render the documents, then fire them
off to the printer. It is all fully automated, so no user interaction
is required.

However, some documents are larger than others and take longer to
spool. The standard behaviour of spoolers/print queues is FIFO, but
FIFO from when the document finishes spooling, not starts spooling.
So a large document can still be spooling when a smaller subsequent
one has spooled. The smaller doc will print first... disaster for my
clients.

I want to catch the OnAfterPrint event that I've read about in MSDN.
This way I can pause the process until the previous document has
spooled. I'm using VC++ 6 and MFC. I can not find anywhere that
gives an example of how to handle this event in C++.

The only example I have is in VB (of which I know very little). From
MSDN...

=============== ==============
Dim WithEvents win As HTMLWindow2
Attribute win.VB_VarHelpI D = -1

Private Sub Form_Load()
WebBrowser1.Nav igate "http://www.microsoft.c om"
End Sub

Private Sub Command1_Click( )
WebBrowser1.Exe cWB OLECMDID_PRINT, OLECMDEXECOPT_P ROMPTUSER,
Empty, Empty
End Sub

Private Sub WebBrowser1_Doc umentComplete(B yVal pDisp As Object, URL As
Variant)
If pDisp Is WebBrowser1.obj ect Then
Set win = pDisp.Document. parentWindow
End If
End Sub

Private Sub win_onafterprin t()
MsgBox ("Done printing!")
End Sub
=============== ==============

Any help will be most appreciated.

Thanks in advance,
Carl Manson.
Jul 22 '05 #1
0 1699

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5930
by: aimee | last post by:
Hi. Is there a way to capture the events fired in a PrintDialog? I would like to capture when the user presses "Print" so I can do some cleanup. The asp.net (IE6) application I'm working on has 6 pages, each of which has a link to a "print view" page. That "print view" page has a "print" button which calls a javascript function "printThis": function printThis() { alert('printThis')
5
7327
by: John Bowman | last post by:
Hi, I've been reading through the threads on using the WebBrowser control in C# app's and how to print it's contents. I've got that much working. However, the big problem is I can't figure out how to detect when the printing is finished. I've read the article "Printing with the Internet Explorer WebBrowser Control" and it mentions some sample code in pwaitvb. This example pretty much useless to me because VB hides the how to do it. I...
2
7952
by: Don Tucker | last post by:
Sorry, I attempted to tab in the previous post and accidentally posted prematurely. I am trying to use the WebBrowser control from Visual Studio 2005 to load a web page and display its HTML content in a text box on a Form of a Windows Application. I have a button on the Form that invokes the following code when clicked: webBrowser1.Url = new Uri("http://www.microsoft.com"); textBox1.Text = webBrowser1.DocumentText;
6
10445
by: Clif | last post by:
Hi, I would like to find out exactly what is being sent when a web page uses the post request method. My thought was to use the webbrowser control together with the HTTPWebRequest class, but am having trouble tying the two together. Any ideas? Thanks, Clif
0
1686
by: Vin | last post by:
The .Net 2.0's webbrowser is neat and pretty. But I am not able to capture Key events when the focus is on the webbrowser control in my winform. Options tried. 1. Wrote a class which extends this WebBrowser and override its onkeyup event - didn't work. 2. Same as option 1 but override preprocessmessage - didn't work. 3. Same as option 1 but override WndProc - doesn't capture any key events happening in the browser.
1
4507
by: JP2006 | last post by:
I'm trying to write a control that will take a screen capture of a particular website when a user submits a form in a web application; one of the form fields is for a URL - the control needs to get an image of that web site so that it can be displayed later as a thumbnail image. I have code for taking a normal screen capture using GDI+ which works fine. What I am now trying to do is to modify it so the screen capture is of a remote...
2
5858
by: =?Utf-8?B?c25naWxi?= | last post by:
The WebBrowser control is described as exposing numerous public mouse events. See: http://msdn2.microsoft.com/en-us/library/ayestehw.aspx. many of the event are described as: "This event is not supported by this control. (inherited from WebBrowserBase)". Does this mean that I can't access these? I am using VS Express C#. Otherwise how do I capture webBrowser mouse events? I am trying to have a DISPLAY-ONLY browser window (i.e. no...
5
8078
by: kimiraikkonen | last post by:
Hi, I couldn't find a necessary class which shows when mouse hovers on a link in Webbrowser control. Think of there's a status bar(text), when mouse comes on a link, the URL must be shown in this status bar. How can i do this? Thanks.
1
5040
by: P-GPS | last post by:
Hi, 1. I have a webbrowser control in a VB .NET (3.5) application. 2. I want to capture the event and call a function whenever the mouse is hovering over a hyperlink. How do I do this? 3. I also want to capture the mouse clicks only in the web-browser. How do I do this? I don't want to use the mouse clicks for the whole form. Thanks.
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.