Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Querformat drucken mit ShellExecute

Empfohlene Antworten

Veröffentlicht

Hallo,

Weiss jemand von euch wie man mit ShellExecute eine Textdatei in Querformat druckt ???

Für eine schnelle Antwort wäre ich sehr dankbar !!!

mit der shell weiss ichs net, aber mit der winapi gehts *ggg*

Könntest du vielleicht einmal ins Forum posten wie das mit der WINAPI geht.

Es ist eigentlich egal wies funzt, Huaptsache es geht !!!

THX

Aus einer Applikation die bei uns läuft:

///////////////////// Drucken über Netzwerkdrucker ////////////////

LOGFONT lf;

lf.lfHeight=2100;

lf.lfWidth=0;

lf.lfEscapement=0;

lf.lfOrientation=0;

lf.lfWeight=FW_BOLD;

lf.lfItalic=FALSE;

lf.lfUnderline=FALSE;

lf.lfStrikeOut=0;

lf.lfCharSet=ANSI_CHARSET;

lf.lfOutPrecision=OUT_DEFAULT_PRECIS;

lf.lfClipPrecision=CLIP_DEFAULT_PRECIS;

lf.lfQuality=DEFAULT_QUALITY;

lf.lfPitchAndFamily=DEFAULT_PITCH | FF_SWISS;

strcpy(lf.lfFaceName,"Courier New");

HFONT hFont=CreateFontIndirect(&lf);

DOCINFO di;

HDC ghdc;

LPDEVMODE DruckerInfos;

HANDLE hPrinter;

DWORD wert;

/////////////////////////// Rechnername checken /////////////////

char PC_Name[50];

AfxSocketInit();

::gethostname(PC_Name,50); // Name ist ermittelt

if(strcmp(PC_Name,"Versand8")!=0) // prüfen wer wo drucken will

{

// if(!(OpenPrinter("HP LaserJet 5L",&hPrinter,NULL)))

if(!(OpenPrinter("\\\\EXTRA\\395_q.logistik.extra",&hPrinter,NULL)))

{

MessageBox("Kann Drucker nicht öffnen !");

return;

}

//wert=DocumentProperties(NULL,hPrinter,"HP LaserJet 5L",NULL,NULL,0); // Schritt eins

wert=DocumentProperties(NULL,hPrinter,"\\\\EXTRA\\395_q.logistik.extra",NULL,NULL,0); // Schritt eins

DruckerInfos=(LPDEVMODE)malloc(wert);

//DocumentProperties(NULL,hPrinter,"HP LaserJet 5L",DruckerInfos,NULL,DM_OUT_BUFFER); // Schritt zwei

DocumentProperties(NULL,hPrinter,"\\\\EXTRA\\395_q.logistik.extra",DruckerInfos,NULL,DM_OUT_BUFFER); // Schritt zwei

DruckerInfos->dmOrientation=DMORIENT_LANDSCAPE ;

//wert=DocumentProperties(NULL,hPrinter,"HP LaserJet 5L",DruckerInfos,DruckerInfos,DM_IN_BUFFER | DM_OUT_BUFFER);

wert=DocumentProperties(NULL,hPrinter,"\\\\EXTRA\\395_q.logistik.extra",DruckerInfos,DruckerInfos,DM_IN_BUFFER | DM_OUT_BUFFER);

if (wert != IDOK)

{

/* if failure, cleanup and return failure */

free(DruckerInfos);

return ;

}

ClosePrinter(hPrinter);

// if(!(ghdc=CreateDC("HP LaserJet 5L","HP LaserJet 5L","LPT1:",DruckerInfos)))

if(!(ghdc=CreateDC("HP LaserJet 2100 Series PCL 6","\\\\EXTRA\\395_q.logistik.extra","\\\\EXTRA\\395_q.logistik.extra",DruckerInfos)))

{

MessageBox("Fail");

free(DruckerInfos);

return ;

}

di.cbSize = sizeof(DOCINFO);

di.lpszDocName = "Palettendruck";

di.lpszOutput = NULL;

StartDoc (ghdc, &di);

m_strWeNr.Insert(0,"WE ");

for(len=0; len<atoi(m_strAnzahl); len++) // Druckanzahl

{

SaveDC(ghdc);

StartPage (ghdc);

lf.lfHeight=2100;

hFont=CreateFontIndirect(&lf);

SelectObject (ghdc, hFont);

TextOut(ghdc,1,200,m_strArtnr,m_strArtnr.GetLength());

lf.lfHeight=600;

hFont=CreateFontIndirect(&lf);

SelectObject (ghdc, hFont);

TextOut(ghdc,4200,3500,m_strDatum,m_strDatum.GetLength());

TextOut(ghdc,10,3500,m_strWeNr,m_strWeNr.GetLength());

EndPage (ghdc);

RestoreDC(ghdc,-1);

}

EndDoc(ghdc);

DeleteDC (ghdc); ///// !!!!!!!!!!!!!!!!

free(DruckerInfos);

////////////////////////////////////////////////////////////////////

LANDSCPAE ist soweit ich noch weiss die Einstellung um quer zu drucken...in der MSDN sind alle relevanten Methoden beschrieben....musst halt gucken :-)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.