Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

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


  • Please log in to reply
73 replies to this topic

#1 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,396 posts

Posted 20 June 2009 - 03:31 PM

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, 16 May 2012 - 10:33 AM.








#2 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,396 posts

Posted 21 June 2009 - 09:38 AM


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

#3 James

James

    Universalist

  • MVPs
  • 10,285 posts

Posted 21 June 2009 - 09:53 AM

I think that the labels showing the hotkeys should be:

CTRL+ALT



#4 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,396 posts

Posted 21 June 2009 - 10:18 AM

:D , noted for next release.

#5 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 21 June 2009 - 12:17 PM

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

#6 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,396 posts

Posted 21 June 2009 - 12:33 PM

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
AutoIt         
; 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, 21 June 2009 - 12:34 PM.


#7 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 22 June 2009 - 01:19 PM

[quote name='KaFu' post='698302' date='Jun 21 2009, 03:33 PM']I query the possible resolutions via WMI
AutoIt         
; 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


#8 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,396 posts

Posted 22 June 2009 - 01:43 PM

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.

AutoIt         
; <a href='http://www.autoitscript.com/forum/index.php?showtopic=70679' class='bbc_url' title=''>http://www.autoitscript.com/forum/index.php?showtopic=70679</a> ; 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


#9 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 22 June 2009 - 02:04 PM

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.

#10 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,396 posts

Posted 22 June 2009 - 02:06 PM

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 .

#11 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,396 posts

Posted 22 June 2009 - 05:34 PM


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

#12 colafrysen

colafrysen

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 266 posts

Posted 23 June 2009 - 09:41 PM

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, 24 June 2009 - 11:47 AM.

Use the helpfile, It´s one of the best exlusive features of Autoit.http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCsScience flies us to the moon. Religion flies us into buildings.http://bit.ly/cAMPZV

#13 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,396 posts

Posted 23 June 2009 - 10:01 PM

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.

#14 Ascend4nt

Ascend4nt

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,359 posts

Posted 24 June 2009 - 08:14 AM

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!

#15 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 24 June 2009 - 04:14 PM

funny :D
I don't see the point to it though..

#16 James

James

    Universalist

  • MVPs
  • 10,285 posts

Posted 24 June 2009 - 05:17 PM

funny :D
I don't see the point to it though..

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

#17 KaFu

KaFu

    Hey, it's just me, KhaFoo...

  • MVPs
  • 3,396 posts

Posted 24 June 2009 - 05:23 PM

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)...

#18 asionwu

asionwu

    Seeker

  • Active Members
  • 17 posts

Posted 25 June 2009 - 03:27 PM

hehe very good

#19 ludocus

ludocus

    Possibly inventive crap going on right here

  • Active Members
  • PipPipPipPipPipPip
  • 668 posts

Posted 25 June 2009 - 06:52 PM

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

#20 Hyflex

Hyflex

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 471 posts

Posted 29 August 2009 - 09:11 PM

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...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users