Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Is it possible to get to


08 Jul 2012   #1

Windows 7 Ultimate x64
 
 
Is it possible to get to

A setting in the registry and change the screen resolution?


My System SpecsSystem Spec
.

08 Jul 2012   #2
whs
Microsoft MVP

Vista, Windows7, Mint Mate, Zorin, Windows 8
 
 

Why don't you just change the resolution with the desktop right click option.
My System SpecsSystem Spec
08 Jul 2012   #3

Windows 7 Pro. 64/SP-1
 
 

Why would you want to fool around with the registry for such a thing?
My System SpecsSystem Spec
.


08 Jul 2012   #4

MS Windows 7 Ultimate SP1 64-bit
 
 

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 System SpecsSystem Spec
08 Jul 2012   #5

Windows 7 Pro. 64/SP-1
 
 

Dam karl, all that for a resolution, have mercy.
My System SpecsSystem Spec
08 Jul 2012   #6

MS Windows 7 Ultimate SP1 64-bit
 
 

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 System SpecsSystem Spec
08 Jul 2012   #7

Windows 7 Pro. 64/SP-1
 
 

I think I will just stick with Right Click on Desktop that suites my I.Q. level.
My System SpecsSystem Spec
08 Jul 2012   #8

 

Quote   Quote: Originally Posted by Layback Bear View Post
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 System SpecsSystem Spec
08 Jul 2012   #9

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by whs View Post
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 System SpecsSystem Spec
08 Jul 2012   #10

MS Windows 7 Ultimate SP1 64-bit
 
 

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

 Is it possible to get to




Thread Tools



Our Sites

Site Links

About Us

Find 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 11:35 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33