The W2K Programming: the first way to obtain a printer device context is to use CreateDC function. The second way is to call PrintDlgEx function, which displays the Print common dialog box that allows the user to set various printing options.