Вниз
Скачать: CL | DM;

WinSpool.OpenPrinter   Найти похожие ветки 

← →
--olg-   (2003-11-06 11:15) [0]

Как открыть принтер функцией WinSpool.OpenPrinter с правами PRINTER_ALL_ACCESS
в Helpe не все понятно.


← →
--olg-   (2003-11-06 12:49) [1]

Я набросал такой код
OpenPrinter возвращает ошибку 1804
Неверные параметры передаются в OpenPrinter
А почемe не пойму?
var
Prt : TPrinter;
HPrt: THandle;
Device, Driver, Port: array[0..255] of Char;
hDevMode: THandle;
b,Level : DWORD;
PPrintInfo : PPrinterInfo2;
PPrintInfo6 : PPrinterInfo6; //for NT
PrinterStruct: PPrinterDefaults;
begin
Prt := Printer;
Prt.GetPrinter(Device, Driver, Port, hDevmode);
PrinterStruct.pDevMode.dmSize := WinSpool.DeviceCapabilities
(Device, Port, DC_Size, nil, nil);
PrinterStruct.DesiredAccess := PRINTER_ALL_ACCESS ;
if not OpenPrinter(Device,HPrt,PrinterStruct) then ShowMessage("Open printer "+IntTostr(GetLastError));
if HPrt = 0 then
raise(Exception.Create("



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.025 c
3-62962
ish
2003-12-24 18:25
2004.01.20
Фильтрация


1-63055
Rasa
2004-01-11 10:21
2004.01.20
Виртуальный ли CD-ROM?


7-63428
Antonn
2003-11-04 12:39
2004.01.20
Перехват клавиш.


14-63311
FenixXaoC
2003-12-24 18:45
2004.01.20
Команды кодеров


14-63343
_none_
2003-12-30 12:40
2004.01.20
можете ли вы на новый год не пить?




   Наверх