When I call PageSetupDlg I get an handle to a devmode structure.
I lock the handle with GlobalLock and I read this structure.
The only info I want to know is the paper size.
With my windows Xp Pro, the dmFields has the DM_PAPERSIZE bit set but DM_PAPERLENGTH and DM_PAPERWIDTH are clear.
But dmPaperLenght and dmPaperWidth contains valid data.

With Win98 dmPaperLenght and dmPaperWidth are set to 0, so the only way to know the paper size is to use the dmPaperSize field.

Is there a function to convert the constant in dmPaperSize into a valid height and width or should I create a table to convert all the 93 :o possible values?

When I have finished with DEVMODE I call GlobalUnlock. Should I deallocate this memory or not?
Posted on 2004-09-22 09:03:32 by greenant