- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a piece of code that prints the contents of a portion of the screen using the printdlg function.However I am not able to change some properties of the print operation such as number of copies.Do I need to use a PrintHookProc?If so what should I write under WM_COMMAND under loword(lparam)=IDOK/IDCANCEL?
I am using the StretchBlt function with the first parameter as pd%hdc where pd is my variable of type printdlg.
Should I change this for modifying my print output(landscape/portrait etc.)?
Thanks.
--rswy
I have a piece of code that prints the contents of a portion of the screen using the printdlg function.However I am not able to change some properties of the print operation such as number of copies.Do I need to use a PrintHookProc?If so what should I write under WM_COMMAND under loword(lparam)=IDOK/IDCANCEL?
I am using the StretchBlt function with the first parameter as pd%hdc where pd is my variable of type printdlg.
Should I change this for modifying my print output(landscape/portrait etc.)?
Thanks.
--rswy
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you setting the appropriate "Flags" in the PringDlg argument?
James
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The following are the flags I am setting for
the printdlg structure:
pd%lStructSize= sizeof(pd)
pd%hwndOwner= ghwndmain
pd%Flags=PD_RETURNDC
pd%lpfnPrintHook =null
Should I set them differently?
When I tried using the printhookproc I set the following:
pd%lStructSize= sizeof(pd)
pd%hwndOwner= ghwndmain
pd%Flags=ior(PD_RETURNDC,PD_ENABLEPRINTHOOK)
pd%lpfnPrintHook =loc(PrintHookProc)
Please let me know if there's something wrong.
-rswy
The following are the flags I am setting for
the printdlg structure:
pd%lStructSize= sizeof(pd)
pd%hwndOwner= ghwndmain
pd%Flags=PD_RETURNDC
pd%lpfnPrintHook =null
Should I set them differently?
When I tried using the printhookproc I set the following:
pd%lStructSize= sizeof(pd)
pd%hwndOwner= ghwndmain
pd%Flags=ior(PD_RETURNDC,PD_ENABLEPRINTHOOK)
pd%lpfnPrintHook =loc(PrintHookProc)
Please let me know if there's something wrong.
-rswy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think if the print driver does multiple copies you will always see a "1" for number of copies. You can see what the user sets by setting a flag like PD_COLLATE (which of course may or may not be desirable depending on what you are doing).
James
James

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page