drucker settings + winapi ???

Von Ausgaben mit der Gra-Engine über Generatoren bis zum Export in diversen Formaten

Moderator: Moderatoren

Antworten
Shuliakovsky
Rookie
Rookie
Beiträge: 3
Registriert: Mo, 12. Mai 2008 8:19
Kontaktdaten:

drucker settings + winapi ???

Beitrag von Shuliakovsky »

Guten tag.

Ich habe eininge Fragen zur Benutzung von XBase++:

1. Wie kann man den Status des Druckers mit dem Namen "myprinter" mit Hilfe eines Programms auf "OFFLINE" setzen?

2. Wie kann man die Warteliste des Druckers mit dem Namen "myprinter" entfernen?
Benutzeravatar
brandelh
Foren-Moderator
Foren-Moderator
Beiträge: 15696
Registriert: Mo, 23. Jan 2006 20:54
Wohnort: Germersheim
Hat sich bedankt: 66 Mal
Danksagung erhalten: 33 Mal
Kontaktdaten:

Beitrag von brandelh »

Hi,

soweit ich das sehe, kann XbpPrinter() keine Warteschlange manipulieren.
Dazu braucht man wohl API Funktionen für Druckjobs und die nötigen Zugriffsrechte ... Es gab hier mehrere Threads mit dem Thema der Ermittlung vom Druckerstatus, die alle letztlich auf die Druckjobs hinauslaufen ... Lösungen gab es - meine ich - nicht.

Suche doch mal nach 'status drucker'
Gruß
Hubert
Shuliakovsky
Rookie
Rookie
Beiträge: 3
Registriert: Mo, 12. Mai 2008 8:19
Kontaktdaten:

Beitrag von Shuliakovsky »

Hello.
I found information how do it, but I can not know how do it with Alaska XBase++ :cry:
------------------------Begin------------------------------------------
HOWTO: How To Change the Work Offline Status of a Printer

1.Retrieve a PRINTER_INFO_2 (pi2) 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-------------------------------------------------
Antworten