Sign in to follow this  
Followers 0

HRC - HotKey Resolution Changer [Updated 2012-May-16]

74 posts in this topic

Posted (edited)

Hello Community,

here's my latest idea...

HRC - HotKey Resolution Changer

Posted Image

Current Version: v2.1 (2012-May-16)

Do you also have a multi monitor setup and are annoyed with always having to change the resolution manually?

Then HCR will be as helpful to you as it is to me...

HRC - HotKey Resolution Changer

  • starts minimized (add shortcut to Startup to start with windows)
  • sits silently in the tray
  • define 2 to 9 shortcuts for different resolutions
  • switch resolution with just a keypress!
  • HotKeys can be set dynamically

Posted Image

HRC works fine at least on the XP SP3 and Win7 64bit SP1 machines I've tested it on. If you find bugs please let me know.

I share this program with NO WARRANTIES and NO LIABILITY FOR DAMAGES!

The executable and the source can be downloaded from my site: http://www.funk.eu

HRC utilizes HotKey.au3 and HotKeyInput.au3 by Yashied, Kudos for those functions m8!

Enjoy HRC, and let me know what you think of it...

Best Regards

Edited by KaFu

Share this post


Link to post
Share on other sites



Posted

Changelog v0.0.1.4 > v0.0.1.6

General

  • Minor design changes
  • Changed / optimized code, not bug related
Source and Executable are available at

http://www.funk.eu

Best Regards

Share this post


Link to post
Share on other sites

Posted

I think that the labels showing the hotkeys should be:

CTRL+ALT

Share this post


Link to post
Share on other sites

Posted

:D , noted for next release.

Share this post


Link to post
Share on other sites

Posted

320x200? This is not true for Windows. May be better to propose to select only working monitor resolutions, but not all.

Share this post


Link to post
Share on other sites

Posted (edited)

320x200? This is not true for Windows. May be better to propose to select only working monitor resolutions, but not all.

I query the possible resolutions via WMI

; Generated by AutoIt Scriptomatic June 21, 2009

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$Output=""
$Output &= "Computer: " & $strComputer  & @CRLF
$Output &= "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_VideoSettings", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
      $Output &= "Element: " & $objItem.Element & @CRLF
      $Output &= "Setting: " & $objItem.Setting & @CRLF
      if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
      $Output=""
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_VideoSettings" )
Endif

and 320x200 is returned as a valid resolution.... tested and it worked on my computer, though you can't see too much :D ... but I would be curious to know a better way to obtain valid resolutions.

Edited by KaFu

Share this post


Link to post
Share on other sites

Posted

I query the possible resolutions via WMI

; Generated by AutoIt Scriptomatic June 21, 2009

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$Output=""
$Output &= "Computer: " & $strComputer  & @CRLF
$Output &= "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_VideoSettings", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
      $Output &= "Element: " & $objItem.Element & @CRLF
      $Output &= "Setting: " & $objItem.Setting & @CRLF
      if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
      $Output=""
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_VideoSettings" )
Endif

Share this post


Link to post
Share on other sites

Posted

Yes, all right, all resolutions which returns your code, supported by the monitor, but does not make sense to offer low resolution for users. Suddenly, he accidentally clicked on such a resolution (eg 320x200). After this long would have to sort the icons on desktop. Even Windows does not offer the resolution less than 800x600.

Yep, you're absolutly right. Next version will only contain resolutions >= 800x600 and Freq. <= 75 Hertz (don't want anyone to blow up his monitor). Thanks for the hint.

By the way, to obtain the all valid resolutions can be done as follows.

Thanks, did some research myself in the meantime and will implement this in the next version too, no WMI anymore.

; http://www.autoitscript.com/forum/index.php?showtopic=70679
; Mix from rasim and other replies

Global Const $EDS_RAWMODE = 0x2

Dim $DEVMODE, $DllRet

Global Const $ENUM_CURRENT_SETTINGS = -1
Global Const $ENUM_REGISTRY_SETTINGS = -2
Global $ENUM_ALL_SETTINGS = 0

$DEVMODE = DllStructCreate("char dmDeviceName[32];ushort dmSpecVersion;ushort dmDriverVersion;short dmSize;" & _
		"ushort dmDriverExtra;dword dmFields;short dmOrientation;short dmPaperSize;short dmPaperLength;" & _
		"short dmPaperWidth;short dmScale;short dmCopies;short dmDefaultSource;short dmPrintQuality;" & _
		"short dmColor;short dmDuplex;short dmYResolution;short dmTTOption;short dmCollate;" & _
		"byte dmFormName[32];dword dmBitsPerPel;int dmPelsWidth;dword dmPelsHeight;" & _
		"dword dmDisplayFlags;dword dmDisplayFrequency")

DllStructSetData($DEVMODE, "dmSize", DllStructGetSize($DEVMODE))

; =============================================

Do
	$DllRet = DllCall("user32.dll", "int", "EnumDisplaySettingsEx", "ptr", 0, "dword", $ENUM_ALL_SETTINGS, _
			"ptr", DllStructGetPtr($DEVMODE), "dword", 0)
	$DllRet = $DllRet[0]

	$ENUM_ALL_SETTINGS += 1

	ConsoleWrite("Width = " & DllStructGetData($DEVMODE, "dmPelsWidth") & " " & _
			"Height = " & DllStructGetData($DEVMODE, "dmPelsHeight") & " " & _
			"Bits = " & DllStructGetData($DEVMODE, "dmBitsPerPel") & " " & _
			"Frequency = " & DllStructGetData($DEVMODE, "dmDisplayFrequency") & @LF)
Until $DllRet = 0

; =============================================
ConsoleWrite("Current from Display" & @CRLF)

$DllRet = DllCall("user32.dll", "int", "EnumDisplaySettingsEx", "ptr", 0, "dword", $ENUM_CURRENT_SETTINGS, _
		"ptr", DllStructGetPtr($DEVMODE), "dword", 0)
$DllRet = $DllRet[0]


ConsoleWrite("Width = " & DllStructGetData($DEVMODE, "dmPelsWidth") & " " & _
		"Height = " & DllStructGetData($DEVMODE, "dmPelsHeight") & " " & _
		"Bits = " & DllStructGetData($DEVMODE, "dmBitsPerPel") & " " & _
		"Frequency = " & DllStructGetData($DEVMODE, "dmDisplayFrequency") & @LF)


; =============================================
ConsoleWrite("Current from Registry" & @CRLF)

$DllRet = DllCall("user32.dll", "int", "EnumDisplaySettingsEx", "ptr", 0, "dword", $ENUM_REGISTRY_SETTINGS, _
		"ptr", DllStructGetPtr($DEVMODE), "dword", 0)
$DllRet = $DllRet[0]


ConsoleWrite("Width = " & DllStructGetData($DEVMODE, "dmPelsWidth") & " " & _
		"Height = " & DllStructGetData($DEVMODE, "dmPelsHeight") & " " & _
		"Bits = " & DllStructGetData($DEVMODE, "dmBitsPerPel") & " " & _
		"Frequency = " & DllStructGetData($DEVMODE, "dmDisplayFrequency") & @LF)


; =============================================
ConsoleWrite(@CRLF & "First try to obtain from Display, then from Registry" & @CRLF)

$DllRet = DllCall("user32.dll", "int", "EnumDisplaySettingsEx", "ptr", 0, "dword", $ENUM_CURRENT_SETTINGS, _
		"ptr", DllStructGetPtr($DEVMODE), "dword", 0)
If $DllRet[0] = 0 Then
	ConsoleWrite(@CRLF & "From reg" & @CRLF)
	$DllRet = DllCall("user32.dll", "int", "EnumDisplaySettingsEx", "ptr", 0, "dword", $ENUM_REGISTRY_SETTINGS, _
	"ptr", DllStructGetPtr($DEVMODE), "dword", 0)
EndIf

ConsoleWrite("Width = " & DllStructGetData($DEVMODE, "dmPelsWidth") & " " & _
		"Height = " & DllStructGetData($DEVMODE, "dmPelsHeight") & " " & _
		"Bits = " & DllStructGetData($DEVMODE, "dmBitsPerPel") & " " & _
		"Frequency = " & DllStructGetData($DEVMODE, "dmDisplayFrequency") & @LF)


; =============================================
$DEVMODE = 0

Share this post


Link to post
Share on other sites

Posted

Yep, you're absolutly right. Next version will only contain resolutions >= 800x600 and Freq. <= 75 Hertz (don't want anyone to blow up his monitor).

LCD monitors operate at 60Hz frequency.

Share this post


Link to post
Share on other sites

Posted

LCD monitors operate at 60Hz frequency.

Good to know that that's the standard, will restrict release to <= 60 Hertz... though my second 'monitor' supports 100 Hertz :D , connected my computer to my living-rooms TV-Set :D .

Share this post


Link to post
Share on other sites

Posted

Changelog v0.0.1.6 > v0.0.2.2

General

  • Fixed dynamic update of Combos
  • Fixed Redraw of large combo if no new value is selected
  • WMI is not used anymore, pure API calls
Source and Executable are available at

http://www.funk.eu

Best Regards

Share this post


Link to post
Share on other sites

Posted (edited)

It's great but it would be more awesome if it supported dual-screen modes.

Also, the link to your website points to SMF

Edit:Spelling

Edited by colafrysen

Share this post


Link to post
Share on other sites

Posted

It's great but it would be more awesome if it supported dual-screen modes.

Yeah, good idea, will take a look at that... it's on the ToDo List :D .

Also, you link to you website points to SMF

Upsa, copy&paste :D , it's corrected.

Share this post


Link to post
Share on other sites

Posted

LCD monitors operate at 60Hz frequency.

Um, maybe some do, but not all. I can operate mine at up to 75Hz. I've heard of them going up to 120Hz. Depends on the pixel response time. (divide 1000/response-time-in-ms, and you get a rough estimate of the maximum refresh frequency)

Btw, Kafu - as usual, keep up the good work. Gotten some nice ideas from this thread and your program!

Share this post


Link to post
Share on other sites

Posted

funny :D

I don't see the point to it though..

Share this post


Link to post
Share on other sites

Posted

funny :D

I don't see the point to it though..

Are you sure this is the right thread for, "funny"?

Share this post


Link to post
Share on other sites

Posted

Are you sure this is the right thread for, "funny"?

It's a translation thing, he's Dutch :D ... "leuk vinden" (lit.: to find nice/funny)...

Share this post


Link to post
Share on other sites

Posted

hehe very good

Share this post


Link to post
Share on other sites

Posted

lol :D

not really though.. I just think it's kinda funny :D (and good)

Share this post


Link to post
Share on other sites

Posted

How can I make a setting to disable screen 2 and then a setting to enable screen 2 ?? when I play games I normally want screen 2 disabled...

Share this post


Link to post
Share on other sites

Posted (edited)

How can I make a setting to disable screen 2 and then a setting to enable screen 2 ?? when I play games I normally want screen 2 disabled...

I'm not sure :D, definitively not with this script :D...

Though I did some research, but sadly without a satisfying solution. This one

http://www.autoitscript.com/forum/index.php?showtopic=87625&view=findpost&p=629215

can be used to toggle the monitors power. It sends a message to a window, in the example it seems to be the Desktop window itself. Maybe it works, if you first enumerate your desktop size and monitors position, create an own small invisible window on the respective monitor and than send the message to that window? Give it a try :D...

Edit: My Google search didn't came up with a satisfying solution for dual / secondary monitors either, lots of questions there but no real answers.

Edited by KaFu

Share this post


Link to post
Share on other sites

Posted

I'm not sure :D, definitively not with this script :D...

Though I did some research, but sadly without a satisfying solution. This one

http://www.autoitscript.com/forum/index.php?showtopic=87625&view=findpost&p=629215

can be used to toggle the monitors power. It sends a message to a window, in the example it seems to be the Desktop window itself. Maybe it works, if you first enumerate your desktop size and monitors position, create an own small invisible window on the respective monitor and than send the message to that window? Give it a try :D...

Edit: My Google search didn't came up with a satisfying solution for dual / secondary monitors either, lots of questions there but no real answers.

I did just find something, I never knew this was in ATI Catalyst Control Center.

Basically you setup your settings for your two screens and then go Options > Profiles > Profile Manager.

Select "all Catalyst Control Center Settings Fill in a name at the top of the screen for example: Dual and a description: Dual Screen Settings.

Now click on Activation, Tick Hotkeys assignment and below you should see "select hotkeys modifier keys" mine is set to CTRL + ALT

The box below is "Enter a Hotkeys Selection" I have set for all this one 2 so if I press CTRL + ALT + 2 it will only keep two of my screens on.

You can also tick the box "Desktop Shortcut" which puts a shortcut on your desktop so ifyou doubble click it then your settings will change to your Dual Screen Profile

You can then go set your settings so only 1 screen is on and follow the same guide above and set it to CTRL + ALT + 1 and then when you press this it will change to 1 screen and if you do CTRL + ALT + 2 it will switch back to two screens.

I have 4 hotkeys set and so easy now

Share this post


Link to post
Share on other sites

Posted (edited)

Changelog v0.0.2.2 > v0.0.2.7

General

  • Custom allocation of HotKeys (utilizes HotKey.au3 and HotKeyInput.au3 by Yashied, Kudos for those functions m8!)
  • Added button to re-detect supported resolutions
Source and Executable are available at

http://www.funk.eu

Best Regards

Edited by KaFu

Share this post


Link to post
Share on other sites

Posted

Changelog v0.0.2.2 > v0.0.2.7

General

  • Custom allocation of HotKeys (utilizes HotKey.au3 and HotKeyInput.au3 by Yashied, Kudos for those functions m8!)
  • Added button to re-detect supported resolutions
Source and Executable are available at

http://www.funk.eu

Best Regards

Nice, but why 0.0.2.7? Maybe 2.7 is better?

:)

Share this post


Link to post
Share on other sites

Posted

Nice, but why 0.0.2.7? Maybe 2.7 is better? :P

Thanks :idea:... I always start my scripts as version 0.0.0.1 (Version property supports four digits) and then enumarte it up, so it seldom has to say anything about the scripts maturity :)... maybe I'll switch to v1 when releasing next time, v1.0.2.7 sounds better :) ...

Share this post


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
Sign in to follow this  
Followers 0




  • Recently Browsing   0 members

    No registered users viewing this page.