News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Check if printer is ready

Started by Magnum, March 05, 2013, 04:54:02 AM

Previous topic - Next topic

sinsi

OK, when my other computer is off, I get that status, because it's a shared network printer. Makes sense, PRINTER_STATUS_SERVER_OFFLINE
Quote from: Win8 SDK winspool.h
#define PRINTER_STATUS_SERVER_UNKNOWN    0x00800000
#define PRINTER_STATUS_POWER_SAVE        0x01000000
#define PRINTER_STATUS_SERVER_OFFLINE    0x02000000
#define PRINTER_STATUS_DRIVER_UPDATE_NEEDED    0x04000000
Still not sure about PRINTER_INFO_6, it's still defined as a dword but needs 8 bytes.

dedndave

hmmmm
a 64-bit OS, no doubt
i can't find anything on it with google

i figured the "ready" status is returned because the spooler is always ready   :P

dedndave

i wanted to make it UNICODE aware
made a few other changes, also

1) little better error handling in GetDefPrn routine
2) made room for 8 bytes in printer status, per Sinsi (GetPrnStatus routine)
that way, it should work in 32 or 64-bit environment
3) UNICODE aware

Magnum

Didn't work.

I thought this worked the first thru Olly, but not later ?

I think it's one of those M.S. undocumented "Let's mess with the developer" APIs. a.k.a LMWTD


start:

; If the function succeeds, the return value is greater than zero.

invoke  StartPage, _hpdc

.if EAX == ERROR_INVALID_HANDLE

;fn MessageBox,0,LastError$(),"Last Error Text",MB_OK

.else

.endif

final:

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org