From: <in...@us...> - 2002-05-26 10:06:03
|
Update of /cvsroot/mingw/runtime/samples/print In directory usw-pr-cvs1:/tmp/cvs-serv1023/samples/print Modified Files: jamfile prntest.c Log Message: Convert some text files to Unix format Index: jamfile =================================================================== RCS file: /cvsroot/mingw/runtime/samples/print/jamfile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** jamfile 4 Jun 2001 23:26:03 -0000 1.1.1.1 --- jamfile 26 May 2002 10:06:00 -0000 1.2 *************** *** 1,9 **** ! # ! # A simple example which prints a message on a selected printer. This won't ! # work right unless you make PRINTDLG a packed structure! ! # ! ! Main prntest.exe : prntest.c ; ! ! Gui prntest.exe ; ! --- 1,9 ---- ! # ! # A simple example which prints a message on a selected printer. This won't ! # work right unless you make PRINTDLG a packed structure! ! # ! ! Main prntest.exe : prntest.c ; ! ! Gui prntest.exe ; ! Index: prntest.c =================================================================== RCS file: /cvsroot/mingw/runtime/samples/print/prntest.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** prntest.c 4 Jun 2001 23:26:03 -0000 1.1.1.1 --- prntest.c 26 May 2002 10:06:00 -0000 1.2 *************** *** 1,65 **** ! ! #include <stdio.h> ! #include <stdlib.h> ! #include <string.h> ! #include <windows.h> ! ! main () ! { ! PRINTDLG pd; ! DOCINFO di; ! char* szMessage; ! ! memset (&pd, 0, sizeof(PRINTDLG)); ! memset (&di, 0, sizeof(DOCINFO)); ! ! di.cbSize = sizeof(DOCINFO); ! di.lpszDocName = "Test"; ! ! pd.lStructSize = sizeof(PRINTDLG); ! pd.Flags = PD_PAGENUMS | PD_RETURNDC; ! pd.nFromPage = 1; ! pd.nToPage = 1; ! pd.nMinPage = 1; ! pd.nMaxPage = 1; ! ! szMessage = 0; ! ! if (PrintDlg (&pd)) ! { ! if (pd.hDC) ! { ! if (StartDoc (pd.hDC, &di) != SP_ERROR) ! { ! StartPage (pd.hDC); ! ! TextOut (pd.hDC, 0, 0, "Hello, printer!", 15); ! ! EndPage (pd.hDC); ! ! EndDoc (pd.hDC); ! ! szMessage = "Printed."; ! } ! else ! { ! szMessage = "Could not start document."; ! } ! } ! else ! { ! szMessage = "Could not create device context."; ! } ! } ! else ! { ! szMessage = "Canceled or printer could not be setup."; ! } ! ! if (szMessage) ! { ! MessageBox (NULL, szMessage, "Print Test", MB_OK); ! } ! ! return 0; ! } --- 1,65 ---- ! ! #include <stdio.h> ! #include <stdlib.h> ! #include <string.h> ! #include <windows.h> ! ! main () ! { ! PRINTDLG pd; ! DOCINFO di; ! char* szMessage; ! ! memset (&pd, 0, sizeof(PRINTDLG)); ! memset (&di, 0, sizeof(DOCINFO)); ! ! di.cbSize = sizeof(DOCINFO); ! di.lpszDocName = "Test"; ! ! pd.lStructSize = sizeof(PRINTDLG); ! pd.Flags = PD_PAGENUMS | PD_RETURNDC; ! pd.nFromPage = 1; ! pd.nToPage = 1; ! pd.nMinPage = 1; ! pd.nMaxPage = 1; ! ! szMessage = 0; ! ! if (PrintDlg (&pd)) ! { ! if (pd.hDC) ! { ! if (StartDoc (pd.hDC, &di) != SP_ERROR) ! { ! StartPage (pd.hDC); ! ! TextOut (pd.hDC, 0, 0, "Hello, printer!", 15); ! ! EndPage (pd.hDC); ! ! EndDoc (pd.hDC); ! ! szMessage = "Printed."; ! } ! else ! { ! szMessage = "Could not start document."; ! } ! } ! else ! { ! szMessage = "Could not create device context."; ! } ! } ! else ! { ! szMessage = "Canceled or printer could not be setup."; ! } ! ! if (szMessage) ! { ! MessageBox (NULL, szMessage, "Print Test", MB_OK); ! } ! ! return 0; ! } |