sasi_kumar_irtt
November 30th, 2006, 05:26 AM
I want to change the orientation of the window in my application. To achieve this functionality i use the function ChangeDisplaySettingsEx.
Here is the values i specified.
DEVMODE devmode;
LONG ReturnValue;
devmode.dmSize = sizeof(DEVMODE);
SystemParametersInfo(SPI_GETWORKAREA,NULL,&rectValue,0);
rectResult.left = rectValue.left;
rectResult.top = rectValue.top;
rectResult.right = (rectValue.right - rectValue.left);
rectResult.bottom = (rectValue.bottom - rectValue.top);
devmode.dmFields = DM_DISPLAYORIENTATION;
devmode.dmPelsWidth = rectResult.right/2;
devmode.dmPelsHeight = rectResult.bottom;
devmode.dmDisplayOrientation = DMDO_90;
devmode.dmFields = DM_DISPLAYORIENTATION;
ReturnValue=ChangeDisplaySettingsEx(NULL, &devmode, NULL, 0, NULL);
The return value i obtained is DISP_CHANGE_BADMODE (-2)
Please help me what i have done work, and help me to achieve the functionality
Sasi
Here is the values i specified.
DEVMODE devmode;
LONG ReturnValue;
devmode.dmSize = sizeof(DEVMODE);
SystemParametersInfo(SPI_GETWORKAREA,NULL,&rectValue,0);
rectResult.left = rectValue.left;
rectResult.top = rectValue.top;
rectResult.right = (rectValue.right - rectValue.left);
rectResult.bottom = (rectValue.bottom - rectValue.top);
devmode.dmFields = DM_DISPLAYORIENTATION;
devmode.dmPelsWidth = rectResult.right/2;
devmode.dmPelsHeight = rectResult.bottom;
devmode.dmDisplayOrientation = DMDO_90;
devmode.dmFields = DM_DISPLAYORIENTATION;
ReturnValue=ChangeDisplaySettingsEx(NULL, &devmode, NULL, 0, NULL);
The return value i obtained is DISP_CHANGE_BADMODE (-2)
Please help me what i have done work, and help me to achieve the functionality
Sasi