LPDEVMODE lpdevmode = (LPDEVMODE)GlobalLock(hDevMode); lpdevmode->dmOrientation = DMORIENT_LANDSCAPE; GlobalUnlock(hDevMode);