Print this window

GetProfileString("windows", "device", ",,,", device, 120);  // Query the Win.ini file for the default printer name
 
if (pPrinter = strtok(device, ",")) // Parse the return of the GetProfileString function
pPrintName = strdup(pPrinter);
else
bIsPrinter = false;
if (bIsPrinter) // Got the printer, now try to get the handle of the printer
printDC = CreateDC(NULL, pPrintName, NULL, NULL); // Get a handle to the printer