• In progress
  • Rotating the Screen

    To rotate the screen you can use the ChangeDisplaySettingsEx()-function.

    LONG ChangeDisplaySettingsEx( LPCTSTR lpszDeviceName, LPDEVMODE lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam );

    View Microsoft documentation of this function.

    Here is a sample on how it is done:

    void RotateScreen( UINT position) { DEVMODE devMode = {0}; devMode.dmSize = sizeof (devMode); devMode.dmFields = DM_DISPLAYQUERYORIENTATION; if (DISP_CHANGE_SUCCESSFUL != ChangeDisplaySettingsEx(NULL, &devMode, NULL, CDS_TEST, NULL)) { RETAILMSG( 1, (TEXT("Failed to get RotationAngles"))); return; } devMode.dmFields = DM_DISPLAYORIENTATION; switch ( position) { case 0: devMode.dmDisplayOrientation = DMDO_0; break; case 90: devMode.dmDisplayOrientation = DMDO_90; break; case 180: devMode.dmDisplayOrientation = DMDO_180; break; case 270: devMode.dmDisplayOrientation = DMDO_270; break; } ChangeDisplaySettingsEx(NULL,&devMode,NULL, CDS_RESET,NULL); }

    Download

    Sample Application:

    See Also

    http://msdn.microsoft.com/en-us/library/ms908108.aspx