Seite 1 von 1

PRINTER API

Verfasst: Mi, 21. Mai 2008 14:47
von Shuliakovsky
Hallo.
Wie kann man das mit Hilfe von Alaska Xbase++ machen :cry:
http://support.microsoft.com/kb/160456/en-us
------------------------------BEGIN---------------------------
HOWTO: How To Change the Work Offline Status of a Printer

1. Retrieve a PRINTER_INFO_2 structure for the printer by calling the GetPrinter function multiple times.
2. Change the PRINTER_ATTRIBUTE_WORK_OFFLINE bit of a PRINTER_INFO_2 structure's Attribute member. The following sample code illustrates how to clear or set a bit of this bitfield properly:
if (pi2->Attributes & PRINTER_ATTRIBUTE_WORK_OFFLINE)
{
DWORD dwStatusMask;

/* set, so clear the bit */
dwStatusMask = ~(DWORD)(PRINTER_ATTRIBUTE_WORK_OFFLINE);
pi2->Attributes = pi2->Attributes & dwStatusMask;
}
else
{
/* not set, so set it */
pi2->Attributes = pi2->Attributes | PRINTER_ATTRIBUTE_WORK_OFFLINE;
}

3. Call the SetPrinter function to set the state of the printer by passing the modified structure.
--------------------------END-----------------------------------------------

Verfasst: Mi, 21. Mai 2008 16:39
von Rolf Ramacher
Hi

schau dir mal die XbpPrinter() und XbpPrintDialog() an. Vielleicht hilft es dir weiter