Hirdetés
-
Mobilarena

Új hozzászólás Aktív témák
-
amargo
addikt
Adott egy Win XP sp2.. Egy hálózatba kötött nyomtató (lehet ezzel van baj?), mivel még localisat nem sikerült beszereznem. Ennek a lekérdezésnek, akkor is mennie kellene a végén a loggolás már tényleg elég buta, de semmi változást nem ad. Persze ciklusba hívom a függvényt, de semmi változás. Mindig 0-t kapok csak.
//----------------------------------------------------------------
DWORD GetPrinterStatus( char* szPrnName )
{
HANDLE hHandle = 0; // Handle of the printer
DWORD dwStatus = 0; // Printer status we should receive
// Few values for example:
// 0x00000000 - ready
// 0x00000001 - paused
// 0x00000002 - error
// 0x00000200 - busy
// 0x00000400 - printing
// for more info please see MSDN
DWORD dwSize = 0; // Size of memory we should
// allocate for PRINTER_INFO_2
PRINTER_INFO_2* pPrnInfo2 = 0; // Structure specifies detailed
// printer information
DEVMODE DevMode = {0}; // Structure contains information
// about the device initialization
// and environment of a printer
PRINTER_DEFAULTS PrnDef = { 0, &DevMode, PRINTER_ACCESS_USE };
// Open printer with name szPrnName
if( !OpenPrinter( szPrnName, &hHandle, &PrnDef ) )
return 0; // Error
// How many memory should be allocated for printer data?
GetPrinter( hHandle, 2, 0, 0, &dwSize );
if( !dwSize )
return 0; // Error
// Allocate memory
pPrnInfo2 = (PRINTER_INFO_2*)malloc( dwSize );
// Receive printer details
if(!GetPrinter( hHandle, 2, (LPBYTE)pPrnInfo2, dwSize, &dwSize ))
return 0; // Error
dwStatus = pPrnInfo2->Status;
// Free allocated memory
free( pPrnInfo2 );
// Close printer
ClosePrinter( hHandle );
FILE *log;
log = fopen(''nyomtat.log'', ''a+'');
fputs((char*)&dwStatus, log);
fclose(log);
return dwStatus;
}
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
- Samsung Galaxy A56 5G / 8/256GB / Kártyafüggetlen / 12Hó Garancia / BONTATLAN
- JBL STAGE 2 9634
- iPhone 13 mini 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS4065, 100% Akkumulátor
- Dell XPS 13 9370 - 9380 UHD touch, 16GB RAM, 256-512GB SSD, jó akku, szép állapot, számla, garancia
- Apple iPhone 13 128 GB Fekete 1 év Garancia Beszámítás Házhozszállítás
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest



