Subj : Re: How to select a non-default printer? To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Tue Jan 06 2004 07:50 am David Ayre wrote: >I use a routine that automatically selects the default printer, >But I would now like to be able to override the default selection >and select another printer. You the User, or You the Programmer? For You the User, remove sPd.Flags = PD_RETURNDEFAULT; For You the Programmer, you could use EnumPrinters with PRINTER_INFO_2 to get the same data your are saving. > lpDevNames = (LPDEVNAMES)GlobalLock(sPd.hDevNames); > lpcDriver = (LPSTR)lpDevNames + lpDevNames->wDriverOffset; > lpcDevice = (LPSTR)lpDevNames + lpDevNames->wDeviceOffset; > lpcPort = (LPSTR)lpDevNames + lpDevNames->wOutputOffset; > GlobalUnlock(sPd.hDevNames); > ptr = (LPDEVMODE)GlobalLock(sPd.hDevMode); .