• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

VC++: How can print an external file within my application.

I am saving my document in a txt format and would like to print this file within my application.
TX
m3
0
m3
Asked:
m3
  • 3
  • 2
1 Solution
 
jkrCommented:
Simply use 'ShellExecute()' and supply the name of the text file as the 'lpFile' parameter and "print" as the 'lpOperation' parameter, which will cause the file to be printed...
0
 
m3Author Commented:
Is there a way to specify the setup for the printing before it prints?

0
 
jkrCommented:
Sorry, there's no way to do this, as the printing is actually done by the program that is registered for the '*.txt' file type (usually 'notepad.exe')...
0
 
m3Author Commented:
When I use the .doc extention to save my file, and SW_HIDE as flag for the ShellExecute() function. the word document is not hided and is showed when printing. I would like to know whether there's a way to really hide it or why notepad.exe is hided but not Word.exe?
0
 
jkrCommented:
Well, i just can guess that the 'Word' programmers simply have chosen to ignore the 'SW_HIDE' flag - it's up to the application whether it uses it or not...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now