Skip to content

Conversation

@iPhilip
Copy link
Contributor

@iPhilip iPhilip commented Mar 10, 2025

Corrected dmDisplayOrientation table. The test code below seems to indicate that the angles are counter-clockwise (not clockwise) from DMDO_DEFAULT.

#include <iostream>
#include <windows.h>

int main()
{
    DEVMODE dm;
    // initialize the DEVMODE structure
    ZeroMemory(&dm, sizeof(dm));
    dm.dmSize = sizeof(dm);

    if (0 != EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm))
    {
        // rotate the display 90 degrees from DMDO_DEFAULT

        DWORD dwCurrentWidth = dm.dmPelsWidth;
        DWORD dwCurrentHeight = dm.dmPelsHeight;
        dm.dmPelsWidth = dwCurrentHeight;
        dm.dmPelsHeight = dwCurrentWidth;
        dm.dmDisplayOrientation = DMDO_90;
        ChangeDisplaySettings(&dm, 0);

        std::cout << "Press Enter to continue..." << std::endl;
        std::cin.get();

        // restore the default orientation

        dm.dmPelsWidth = dwCurrentWidth;
        dm.dmPelsHeight = dwCurrentHeight;
        dm.dmDisplayOrientation = DMDO_DEFAULT;
        ChangeDisplaySettings(&dm, 0);
    }
}

@prmerger-automator
Copy link

@iPhilip : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@stevewhims stevewhims merged commit 1879191 into MicrosoftDocs:docs Mar 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants