Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 904629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:05:09+00:00 2026-05-15T16:05:09+00:00

I’ve been getting weird results with ChangeDisplaySettings and my Intel Graphics card. I find

  • 0

I’ve been getting weird results with ChangeDisplaySettings and my Intel Graphics card. I find that when I try to go fullscreen, it won’t do it in the same way as other programs.

My Intel control panel lets me handle different resolutions in 3 ways: Stretching the image, using the original resolution but centering the image, or Maintaining the aspect ratio with letterboxing. I set the default to maintain the aspect ratio, and some old games on my computer end up doing that. However, my program won’t do the same. Instead, it gets centered.

Here’s the code I’m using:

#include "windows.h"
DEVMODE DevMode;
DEVMODE UsedDevMode;  
struct stOptions
{
    char szFiles[260];
    int xres;
    int yres;
    int bpp;
    bool bMultiMon;
};
stOptions options;

void ApplyOptions(HWND hWnd)
{
    int iModeNum=0;
    bool bRes, bBpp, bFreq;
    bRes=bBpp=bFreq=false;
    bool bResult=true;
    bool bChanged=false;
    int iFreq;
    EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &DevMode); //Get the current frequency
    iFreq=DevMode.dmDisplayFrequency;  
    //With this, I try to find a DevMode that will work for the display. If it can't match all of the user's
    //preferences, it will at least try to match as much as it can.
    while (bResult)
    {
        bResult=EnumDisplaySettings(NULL, iModeNum, &DevMode);
        if ((DevMode.dmPelsWidth==options.xres)&&(DevMode.dmPelsHeight==options.yres))
        {
            if (!bRes) EnumDisplaySettings(NULL, iModeNum, &UsedDevMode);
            bRes=true; bChanged=true;
            if (DevMode.dmBitsPerPel==options.bpp)
            {
                if (!bBpp) EnumDisplaySettings(NULL, iModeNum, &UsedDevMode);
                bBpp=true;
                if (DevMode.dmDisplayFrequency==iFreq)
                {
                    EnumDisplaySettings(NULL, iModeNum, &UsedDevMode);
                    bFreq=true;
                    break;
                }
            }
        }
        iModeNum++;
    }  
    if (!bChanged)
    {
        //TODO: add error handling
    }  
    ChangeDisplaySettings(&UsedDevMode, CDS_FULLSCREEN);
    MoveWindow(hWnd, 0, 0, options.xres, options.yres, true);
}

I’d like to know if anyone else with an intel card has this problem.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:05:10+00:00Added an answer on May 15, 2026 at 4:05 pm

    I tried a simpler function and it more like I expected this time:

    
    void ApplyOptions(HWND hWnd)
    {
        DEVMODE dmScreenSettings;                                           // Device Mode
        ZeroMemory (&dmScreenSettings, sizeof (DEVMODE));                   // Make Sure Memory Is Cleared
        dmScreenSettings.dmSize             = sizeof (DEVMODE);             // Size Of The Devmode Structure
        dmScreenSettings.dmPelsWidth        = options.xres;                     // Select Screen Width
        dmScreenSettings.dmPelsHeight       = options.yres;                     // Select Screen Height
        dmScreenSettings.dmBitsPerPel       = options.bpp;                  // Select Bits Per Pixel
        dmScreenSettings.dmFields           = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
        if (ChangeDisplaySettings (&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
        {
            MessageBox(NULL, "Fail", "Error", MB_ICONHAND);
        }
    
        //ChangeDisplaySettings(&UsedDevMode, CDS_FULLSCREEN);
        MoveWindow(hWnd, 0, 0, options.xres, options.yres, true);
    }

    I still don’t know why this would be any different, but I guess it has something to do with dmScreenSettings.dmFields.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I have a French site that I want to parse, but am running into
I know there's a lot of other questions out there that deal with this
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.