Changeset 10598 for trunk/src


Ignore:
Timestamp:
May 6, 2004, 2:40:21 PM (21 years ago)
Author:
sandervl
Message:

Update the hDevNames member of the printer dialog structure whenever the user chooses another printer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comdlg32/printdlg.c

    r10593 r10598  
    10841084        GlobalUnlock(lppd->hDevMode);
    10851085
     1086#ifdef __WIN32OS2__
     1087    //Yes, we need to update the device names in the printer dialog structure
     1088    //Some applications actually rely on that to change when the user chooses
     1089    //another printer
     1090    {
     1091            DEVMODEA *lpdm = PrintStructures->lpDevMode, *lpdmReturn;
     1092            PRINTER_INFO_2A *pi = PrintStructures->lpPrinterInfo;
     1093            DRIVER_INFO_3A *di = PrintStructures->lpDriverInfo;
     1094
     1095            if (lppd->hDevNames != 0) {
     1096                WORD locks;
     1097                if((locks = (GlobalFlags(lppd->hDevNames) & GMEM_LOCKCOUNT))) {
     1098                    WARN("hDevNames has %d locks on it. Unlocking it now\n", locks);
     1099                    while(locks--)
     1100                        GlobalUnlock(lppd->hDevNames);
     1101                }
     1102            }
     1103            PRINTDLG_CreateDevNames(&(lppd->hDevNames),
     1104                    di->pDriverPath,
     1105                    pi->pPrinterName,
     1106                    pi->pPortName
     1107            );
     1108    }
     1109#endif
     1110
    10861111    lpdm = PrintStructures->lpDevMode;  /* use this as a shortcut */
    10871112
Note: See TracChangeset for help on using the changeset viewer.