Link to home
Start Free TrialLog in
Avatar of cwilliso
cwilliso

asked on

Print Screen FCN in Borland C++ Builder

My users requested a screen print function in the Application that I created for them.  How can
I implement this??
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

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
Avatar of cwilliso
cwilliso

ASKER

any sample code??  It could be any application -- It would all be the same code to
print out the application's client area.  I don't have much time, unfortunately.
Can't find a Property or Method to get the DC of the printer.  How to send a WM_PRINT
message to the main application window?
>Can't find a Property or Method to get the DC of the printer.

Look into the Win32 SDK sample "Printer: Printing". The Printer sample shows how to print using both the CreateDC and the PrinterDlg methods for acquiring a printer HDC.

>How to send a WM_PRINT message to the main application window?

It is just like a normal message. Use PostMessage or SendMessage with the window handle, HDC and the flags.
The actual answer is:

this->Print();
I am not familiar with Borland C++ Builder. But I am sure this->Print() actually sends the WM_PRINT message. MFC also has a member function CWnd::Print, which wraps the WM_PRINT message.