Jump to content



Photo

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


  • Please log in to reply
73 replies to this topic

#21 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 30 August 2009 - 08:08 AM

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, 30 August 2009 - 08:10 AM.






#22 XxXGoD

XxXGoD

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 397 posts

Posted 02 September 2009 - 05:04 PM

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

#23 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 25 October 2009 - 07:11 PM


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, 25 October 2009 - 07:11 PM.


#24 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,512 posts

Posted 25 October 2009 - 07:23 PM


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?

:)

#25 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 25 October 2009 - 11:14 PM

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

#26 hbonwit

hbonwit

    Seeker

  • New Members
  • 1 posts

Posted 28 April 2010 - 05:29 PM

[quote name='KaFu' date='23 June 2009 - 11:01 PM' timestamp='1245794495' post='699291']

Along the same lines, I'd really like to be able to control the resolution on two monitors -- one built in laptop, the other external LCD. I think you've already provided the method for this, but I can't figure out how to specify which monitor to change resolution on. Can you help?

(My external LCD often boots at a low resolution, and even using the windows slider bar in right-click, display properties, settings, doesn't allow the slider to move to the right far enough (it doesn't know it's a 1920x1200 resolution capable).)

#27 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 28 April 2010 - 06:24 PM

No multi-display support... yet :idea:, it's on my list.

#28 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 15 January 2011 - 06:07 PM

Updated to v1.0 (at least a decent version number :x). Fixed the annoying (and self introduced) UAC bug.

#29 hypertyper

hypertyper

    Seeker

  • Active Members
  • 30 posts

Posted 10 February 2011 - 11:07 AM

Love this tool. It seems that on my virtual machine though the resolution associated with a hotkey changes when I restart the PC. Can you don't save the resolution associated with a particular hotkey?

It seems that it does actually work but it gets displayed differently on the GUI. Strange. Either way, that's all I need. It works, who cares what it looks like :)

Edited by hypertyper, 10 February 2011 - 11:08 AM.


#30 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 10 February 2011 - 11:30 AM

It seems that it does actually work but it gets displayed differently on the GUI. Strange. Either way, that's all I need. It works, who cares what it looks like ;)

Will take a look why the GUI is not updated correctly, glad you like it :)...

#31 hypertyper

hypertyper

    Seeker

  • Active Members
  • 30 posts

Posted 10 February 2011 - 11:38 AM

I just double checked and it's not just the gui that's not updating. After the reboot the hotkeys remain, the resolutions both point to the current resolutions and the hotkeys don't work.

I set the resolutions with their relevant hotkeys, then I reboot the VM and when I start HRC again, the hotkeys are still there but they both point to the current resolution.

Maybe save the resolution with the hotkey? I'm not sure whether this is any different when using a normal PC rather than a VM.

#32 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 10 February 2011 - 12:21 PM

Thanks for pointing out the different scenarios, I'll check it out this evening :).

Edited by KaFu, 10 February 2011 - 12:21 PM.


#33 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 10 February 2011 - 08:41 PM


Changelog v1.0 > v1.1


General
  • Fixed hotkey assignment issue, thanks hypertyper for pointing out :)
  • Fixed HRC restart issue
  • Fixed DEP error
Source and Executable are available at
http://www.funk.eu

Best Regards

#34 hypertyper

hypertyper

    Seeker

  • Active Members
  • 30 posts

Posted 15 February 2011 - 09:45 PM

I've installed the new version, deleted the old ini and after a restart both hotkeys still point to the same resolution. I'm using VMware workstation which I assume is part of the problem.

How about saving the relevant resolution with its hotkey in the ini file? That way the restart won't have an impact.

It would be really cool if you could get it to work. If I have time I might have a look at the source code and see if I can come up with something...

Danke

#35 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 15 February 2011 - 10:40 PM


Changelog v1.1 > v1.2


General
  • Version 1.2 should fix another “save settings” issue (hopefully :) )
Source and Executable are available at
http://www.funk.eu

Thanks for pointing this out ;)...

#36 hypertyper

hypertyper

    Seeker

  • Active Members
  • 30 posts

Posted 15 February 2011 - 10:51 PM

Great update! It now works with restarts and everything. Thanks a lot for this nice little tool and the super quick updates!

#37 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 15 February 2011 - 10:54 PM

Thank YOU for pointing out the errors ;) , hell, 8514 downloads and no feedback on these ones until now :idiot: :D :) :idiot: !

#38 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 15 February 2011 - 11:14 PM

Behavior on change number of hotkeys was still not right, pls re-download v1.2...

Edit: And tray icon was shown to early, might confuse the app... pls re-download again...

Edit2: And while I'm at it, I added a trick I've learned today to make the font DPI aware ;)... you know the game... pls re-download again :)...

Edited by KaFu, 15 February 2011 - 11:43 PM.


#39 Ascend4nt

Ascend4nt

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,072 posts

Posted 16 February 2011 - 01:26 AM

Hey, just a question.. have you noticed that the HotKey UDF breaks when you lock the workstation or do a Ctrl-Alt-Del in Windows 7 and use the hotkey while on the selection screen? Try it, go back into Windows, and then try your hotkeys again. I've noticed this behavior in programs I've written using the HotKey UDF. I've tried workarounds like re-hooking the hotkey callback, but it starts looking ugly after a while.

From what I've read on this before, it seems there is new behavior in Windows 7 (or was it Vista?), where it will remove hooks from the chain if they take too long to respond. But in all honesty, the hook code doesn't look like it takes much time at all (especially if it has a small list to go through).

I've tried the alternative 'GetAsyncKeyState' API call ('_IsPressed'), but that function fails when a program with a higher privilege level is running in the foreground - all keys return as not pressed! Oy, this stuff is driving me mad.

*edit: Actually, you don't even need to press the hotkey in the Ctrl-Alt-Del selection screen. Just go to it or the lock-workstation screen a few times, and eventually the hook will fall out on its own!

Edited by Ascend4nt, 16 February 2011 - 01:30 AM.


#40 KaFu

KaFu

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

  • MVPs
  • 3,162 posts

Posted 16 February 2011 - 07:34 AM

That's a really great find m8 :). Never noticed this in HRC, but in another program if mine and couldn't track down why the HotKeys suddenly stop to work. Maybe unhooking and re-hooking the keys with a callback like this will do?

Edit:
http://social.msdn.microsoft.com/Forums/en/windowsgeneraldevelopmentissues/thread/56093d14-c1bc-4d0a-a915-57fef0695191
http://stackoverflow.com/questions/1639331/using-global-keyboard-hook-wh-keyboard-ll-in-wpf-c
https://gist.github.com/471698

Looking at _WinAPI_SetWindowsHookEx() in HotKey.au3 is see that the dwThreadId is 0 by default ("the hook procedure is associated with all existing threads"). Maybe setting this to the calling thread with _WinAPI_GetWindowThreadProcessId($hWnd, $PID) will fix this? Will check out later ;)...

Edited by KaFu, 16 February 2011 - 08:11 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users