rotate display 90°

  • Thread starter Thread starter Mads
  • Start date Start date
M

Mads

Help !!

I want to rotate the display 90°, I wrote these few lines below but nothing
happends running it under XP.
Anyone have any ideas ???

{

LPCTSTR lpszDeviceName = NULL; // name of display device

DEVMODE DevMode; // graphics mode

HWND hwnd = NULL; // not used; must be NULL

DWORD dwflags = 0; // graphics mode options

LPVOID lParam = NULL; // video parameters (or NULL)


DISPLAY_DEVICE DisplayDevice;

DisplayDevice.cb = sizeof(DISPLAY_DEVICE);

DWORD iDevNum = 0;

DWORD dwFlags = 0;



EnumDisplayDevices(NULL,iDevNum,&DisplayDevice, dwFlags);

DevMode.dmSize = sizeof(DEVMODE);


EnumDisplaySettings(DisplayDevice.DeviceName, ENUM_CURRENT_SETTINGS,
&DevMode);


dwFlags = 0;

DevMode.dmPelsHeight = 640;

DevMode.dmPelsWidth = 480;

DevMode.dmBitsPerPel = 16;

DevMode.dmDisplayOrientation = DMDO_90;

ChangeDisplaySettingsEx(DisplayDevice.DeviceName,&DevMode, hwnd, dwflags,
lParam);


}
 
First of all your graphic card has to support this.


If it does you will probably have to edit a few registry settings... Thats
what i did anyway...
 
Back
Top