Jump to content

Resolution switcher (mainly for Win8 on the HTC Shift and similar devices, but should be easy to modify for whatever)

Recommended Posts

The original resolution switcher by HTC works good on earlier Windows, but has two problems on Win8.

  • When activated it creates a window telling the current resolution. It is given focus and thus forces Metro back to the desktop.
  • It switches between the native 800x480 and 1024x600 which is to low to run Metro apps.
To fix this I started with a simple script that switches to 1152x864 with a window that displays the resolution without grabbing focus.

Later I added some extras:

  • Option to skip the window altogether
  • Separate resolution in desktop and Metro
  • A simple installer/uninstaller for the HTC Shift (or other devices that use a synaptics touchpad in the same matter, check the code).

Code moved to attachment. See next post for screenshots.

ResSwitch source.rar

  • The .au3 itself
  • Modified (removed duplicate const's)
  • Modified (removed duplicate const's and commented WinXP (+ earlier) code to reduce file size)
ResSwitch.rar (previous downloads: 51)
  • A compiled .exe (if you don't have AutoIt? lol)
  • .bat file calling the installer/uninstaller function (optional)
  • .ini file containing the standard settings (optional)
Edited by AdmiralAlkex
Link to post
Share on other sites

I made a thread in the HTC Shift subsection at xda-developers, Another resolution changer (the biggest and the only Shift forum I know).

Anyone know of any other forums I should post this in?

Some screenshots:

Posted Image

Posted Image

(notice how the font is smooth as a baby's butt thanks to _GDIPlus_SetTextRenderingHint())

Also, do I get bonus points for the first example script that uses Null? ;) (even if it's just used for my pleasure and is not really needed at all?)

Link to post
Share on other sites
  • 3 months later...

-></( UPDATE )><-

  • I changed the script to use the IAppVisibility API to detect Metro instead of the previous kludge. Now also detects Metro apps and not just the Start screen. I don't think I mentioned that limitation before. Oops!
  • Does not jump to a lower resolution while in Metro (by default). Metro copes with resolution changes by closing all applications. Very annoying.
I have not done any work on supporting multiple monitors, but it kinda works as long as the internal display is the "main" one.

Download from first post.

Link to post
Share on other sites
  • 1 year later...

Having issues pushing PC images on Windows 8.1 that are completely refusing to retain resolution and desktop icon layout from the original image for some reason. Until we can figure out why, this is a great temporary solution for at least the resolution issue (which we can run as a batch job). Thank you for sharing this code!

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Danyfirex
      In the past I had problems adding an application as a default for an extension in Windows 10. (It was easy in windows 7 using Registry) But since Windows 8 It requires to do some steps more. I wrote a tool (in other programming language) months ago for handling it. But now I just want to share an AutoIt version.
      Check on GitHub.
    • By AutID

      I will put it as simple as possible
      Why this code runs perfectly on 32bit and it fails on 64bit?
      Local $hWND = WinGetProcess("[CLASS:LSS_app]") ConsoleWrite($hWND & @LF) Local $hModuleList = _WinAPI_EnumProcessModules($hWND) If @error Then ConsoleWrite("Error: " & @error & @LF) For $i = 0 To $hModuleList[0][0] - 1 ;~ If StringInStr($hModuleList[$i][1], "sysCap64.dll") Then ConsoleWrite($hModuleList[$i][0] & @LF) ;~ EndIf Next As the title says EnumProcessModules returns error 10 which I have no clue what it is.
      It must be something with autoit or my lack of coding because a similar code in C# will work like a charm on both x86 and x64
      Process[] Processes = Process.GetProcessesByName("winLSS64Cap"); Process nProcess = Processes[0]; Handle = OpenProcess(0x10, true, (uint)nProcess.Id); for(int i = 0; i < nProcess.Modules.Count; i++) { Console.WriteLine(nProcess.Modules[i].ModuleName); }  
    • By Rickname
      I want to switch from Windows 7 to Windows 8.1 ( x86 ) but I still want to code in AutoIt. Now I saw in the Description file that is only compatible upto Windows 7, but will it work also on 8 ? And yes Im referring to the latest Autoit version available !
    • By badapple89
      I basically want to create a Windows 8 Training script for new users, so need a popup to show when they open the start menu.
        WinWait and WinWaitActive are never detecting on my Win8 64 bit computer when waiting for the new start screen window.
      I have used "Start menu" and "[CLASS:ImmersiveLauncher]" for the title, even "[CLASS:DirectUIHWND]"
      Below is the Window info the the Start Screen
      >>>> Window <<<< Title: Start menu Class: ImmersiveLauncher Position: 1920, 0 Size: 1920, 1080 Style: 0x96000000 ExStyle: 0x00200008 Handle: 0x0000000000010190 >>>> Control <<<< Class: DirectUIHWND Instance: 0 ClassnameNN: DirectUIHWND0 Name: Advanced (Class): [CLASS:DirectUIHWND; INSTANCE:0] ID: Text: Position: 0, 0 Size: 1920, 1080 ControlClick Coords: 138, 174 Style: 0x56000000 ExStyle: 0x00000000 Handle: 0x0000000000010192 >>>> Mouse <<<< Position: 2058, 174 Cursor ID: 0 Color: 0x180053 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< >>>> Hidden Text <<<< Explorer Browser Control   I have this setup to run as a test when I press a hotkey:
      $title = WinGetTitle ("[ACTIVE]")
      $state = WinGetState  ($title)
      ConsoleWrite ($title &" "& $state)
      I get "Start menu 0" its always 0 no matter what (it works correctly with other programs)
      I can get the PID of start menu but how can I then check when its active from that?
      Any help appreciated
      EDIT: I can only get the PID, Handle or anything else if the Start window is open. I cannot use win wait with any of this info though.
  • Create New...