Seitenleiste


Access to information is restricted depending on your login. Request login-information through our contact form.

service:wince:appnotepub:rotatescreen

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: http://msdn.microsoft.com/en-us/library/ms908108.aspx

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

Cookies helfen bei der Bereitstellung von Inhalten. Durch die Nutzung dieser Seiten erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Rechner gespeichert werden. Weitere Information
service/wince/appnotepub/rotatescreen.txt · Zuletzt geändert: 2015/10/14 11:14 von