Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing problems

Status
Not open for further replies.

CetGabbe

Programmer
Apr 12, 2002
18
0
0
SE
Good evening.
I wonder if anybody knows how to print some lines from a text-file on C:\ from a Visual C++ project automaticly, without the user to click any buttons.
It's a log-file that I automaticly want to print repeatatly.
Would be very greatful if somebody could help me with this.

regards CetGabbe.
 
Try this:

#include<windows.h>
#include<shellapi>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{

ShellExecute(NULL,&quot;print&quot;,&quot;C:\\mytext.txt&quot;,NULL,NULL,SW_SHOWNORMAL);
return 0;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top