Вниз
Скачать: 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.02 c
4-63458
goliath
2003-11-16 16:31
2004.01.20
WM_COPYDATA


1-63100
Jenaxx
2004-01-08 01:19
2004.01.20
Как получить инфу о пользователе, всю ту что можно получить


6-63284
Novenkij
2003-11-18 01:31
2004.01.20
Пересылка файлов


14-63405
Undert
2003-12-27 19:38
2004.01.20
Как впихать wav или лучше MP3 в ресурсы Delphi и застваить чем-ни


3-63017
Trad
2003-12-22 21:40
2004.01.20
арифметика с данными из БД




   Наверх