Is it possible to get to

Page 1 of 2 12 LastLast

  1. Posts : 97
    Windows 7 Ultimate x64
       #1

    Is it possible to get to


    A setting in the registry and change the screen resolution?
      My Computer


  2. whs
    Posts : 26,210
    Vista, Windows7, Mint Mate, Zorin, Windows 8
       #2

    Why don't you just change the resolution with the desktop right click option.
      My Computer


  3. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #3

    Why would you want to fool around with the registry for such a thing?
      My Computer


  4. Posts : 10,200
    MS Windows 7 Ultimate SP1 64-bit
       #4

    clay,

    a simple registry change there isn't, but by using my friend Goggle and search for "change display resolution with powershell" , I came up with a 'resolution changer".

    I've tried this script, but only on legit changes. Let's see first here is the link:
    Hey, Scripting Guy! How Can I Change My Desktop Monitor Resolution via Windows PowerShell? - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs

    Here's the actual script with a couple of explanation notes.

    Script:
    # ************************************************************
    # Change the display resolution
    # to use: change the Set-ScreenResolution statement from
    # Set-ScreenResolution 800 600
    # change to Set-ScreenResolution yourdesiredwidth yourdesiredheight
    #
    # Those two exit statements aren't neeed but I didn't want to
    # change my template.
    # **********************INSTRUCTIONS**************************
    # STEP 1 *****************************************************
    # RUN PowerShell as administrator
    # START ORB | type POWERSHELL | CTRL+SHIFT+ENTER key combo | ALT+Y keycombo
    # ************************************************************
    # STEP 2 *****************************************************
    # COPY, using CTRL+C, every line down thru both EXIT statements 
    # PASTE into Powershell == Right-Click at the PowerShell Prompt
    #  (Ctrl+V does not work)
    # Start copying with first line without a # at start of the line
    # Note: Actually, you can paste the entire file if you rather
    #       Lines starting with a # are ignored by PowerShell
    # ************************************************************

        

    Function Set-ScreenResolution {
    param (
    [
    Parameter(Mandatory=$true,
               
    Position 0)]
    [
    int]
    $Width,
    [
    Parameter(Mandatory=$true,
               
    Position 1)]
    [
    int]
    $Height
    )
    $pinvokeCode = @"
    using System;
    using System.Runtime.InteropServices;
    namespace Resolution
    {
        [StructLayout(LayoutKind.Sequential)]
        public struct DEVMODE1
        {
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
            public string dmDeviceName;
            public short dmSpecVersion;
            public short dmDriverVersion;
            public short dmSize;
            public short dmDriverExtra;
            public int dmFields;
            public short dmOrientation;
            public short dmPaperSize;
            public short dmPaperLength;
            public short dmPaperWidth;
            public short dmScale;
            public short dmCopies;
            public short dmDefaultSource;
            public short dmPrintQuality;
            public short dmColor;
            public short dmDuplex;
            public short dmYResolution;
            public short dmTTOption;
            public short dmCollate;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
            public string dmFormName;
            public short dmLogPixels;
            public short dmBitsPerPel;
            public int dmPelsWidth;
            public int dmPelsHeight;
            public int dmDisplayFlags;
            public int dmDisplayFrequency;
            public int dmICMMethod;
            public int dmICMIntent;
            public int dmMediaType;
            public int dmDitherType;
            public int dmReserved1;
            public int dmReserved2;
            public int dmPanningWidth;
            public int dmPanningHeight;
        };
        class User_32
        {
            [DllImport("
    user32.dll")]
            public static extern int EnumDisplaySettings(string deviceName, int modeNum, ref DEVMODE1 devMode);
            [DllImport("
    user32.dll")]
            public static extern int ChangeDisplaySettings(ref DEVMODE1 devMode, int flags);
            public const int ENUM_CURRENT_SETTINGS = -1;
            public const int CDS_UPDATEREGISTRY = 0x01;
            public const int CDS_TEST = 0x02;
            public const int DISP_CHANGE_SUCCESSFUL = 0;
            public const int DISP_CHANGE_RESTART = 1;
            public const int DISP_CHANGE_FAILED = -1;
        }
        public class PrmaryScreenResolution
        {
            static public string ChangeResolution(int width, int height)
            {
                DEVMODE1 dm = GetDevMode1();
                if (0 != User_32.EnumDisplaySettings(null, User_32.ENUM_CURRENT_SETTINGS, ref dm))
                {
                    dm.dmPelsWidth = width;
                    dm.dmPelsHeight = height;
                    int iRet = User_32.ChangeDisplaySettings(ref dm, User_32.CDS_TEST);
                    if (iRet == User_32.DISP_CHANGE_FAILED)
                    {
                        return "
    Unable To Process Your RequestSorry For This Inconvenience.";
                    }
                    else
                    {
                        iRet = User_32.ChangeDisplaySettings(ref dm, User_32.CDS_UPDATEREGISTRY);
                        switch (iRet)
                        {
                            case User_32.DISP_CHANGE_SUCCESSFUL:
                                {
                                    return "
    Success";
                                }
                            case User_32.DISP_CHANGE_RESTART:
                                {
                                    return "
    You Need To Reboot For The Change To Happen.\If You Feel Any Problem After Rebooting Your Machine\nThen Try To Change Resolution In Safe Mode.";
                                }
                            default:
                                {
                                    return "
    Failed To Change The Resolution";
                                }
                        }
                    }
                }
                else
                {
                    return "
    Failed To Change The Resolution.";
                }
            }
            private static DEVMODE1 GetDevMode1()
            {
                DEVMODE1 dm = new DEVMODE1();
                dm.dmDeviceName = new String(new char[32]);
                dm.dmFormName = new String(new char[32]);
                dm.dmSize = (short)Marshal.SizeOf(dm);
                return dm;
            }
        }
    }
    "
    @
    Add-Type $pinvokeCode -ErrorAction SilentlyContinue
    [Resolution.PrmaryScreenResolution]::ChangeResolution($width,$height)
    }

    Set-screenresolution 800 600

    EXIT
    EXIT

    # ***************** NOTE - POWERSHELL VERSION*****************
    # if you receive this error msg:
    #  Get-WinEvent: The system can not find the path specified
    # you need to update your PowerShell
    # you must be using Powershell 2.0 or later.
    #
    # To determine your Powershell version:
    #   Run PowerShell
    #   enter $host.version
    #   you should see at least:
    # Major  Minor  Build  Revision
    # -----  -----  -----  --------
    # 2      0      -1     -1
    #
    # If you do not see the above, update your Vista/Win 7.
    # ************************************************************
    # *************** NOTE - EXECUTION POLICY*********************
    # If you haven't set the execution policy, you may need to:
    #   Run PowerShell
    #   enter Set-ExecutionPolicy -executionpolicy remotesigned
    #
    # ************************************************************ 
      My Computer


  5. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #5

    Dam karl, all that for a resolution, have mercy.
      My Computer


  6. Posts : 10,200
    MS Windows 7 Ultimate SP1 64-bit
       #6

    I tried out the script and works smoothly. Didn't try wierd ones, but I just might on my Asus Netbook to see if I can set something other than their defaults which are a little off of what is needed.
      My Computer


  7. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #7

    I think I will just stick with Right Click on Desktop that suites my I.Q. level.
      My Computer


  8. Posts : 710
    Win7 Pro x64
       #8

    Layback Bear said:
    Dam karl, all that for a resolution, have mercy.
    Putting the 'kill' in 'overkill' - we gotta earn those Pro and Guru tags!!

    1. Receive email
    2. Press print button
    3. Remove printout of email, insert into scanner
    4. Scan printed email
    5. Save scanned image
    6. Open image in OCR program, convert into text
    7. Copy text, paste into email program
    8. Reply

    *salutes*

    Edit:
    Side note, probably OP has trouble with right click? Can you do this in Windows Starter? There's probably something we're missing here.
      My Computer


  9. Posts : 97
    Windows 7 Ultimate x64
    Thread Starter
       #9

    whs said:
    Why don't you just change the resolution with the desktop right click option.
    The desk top and control panel dont work....

    Trouble with control panel and desktop picture..
      My Computer


  10. Posts : 10,200
    MS Windows 7 Ultimate SP1 64-bit
       #10

    The script will work. Just be sure to give it a combo that is valid for your monitor.
      My Computer


 
Page 1 of 2 12 LastLast

Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:58.
Find Us