topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 18, 2024, 9:22 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Monitor Dimmer  (Read 33185 times)

mmdoogie

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 14
    • View Profile
    • My Projects
    • Donate to Member
Monitor Dimmer
« on: January 23, 2008, 01:43 AM »
I guess this program could be a little more flexible, and its not that amazing, but I wanted to share it as it fulfilled a need I had.
Also, I wanted to share the technique I used as it took me a while to get it to work the way I wanted.

Background:

I have two monitors.
Often, I'll watch a movie or play a game on the left one, while I will also be browsing web pages and chatting with people on the right one.
If the movie or game is dark, and I'm looking a mostly white webpage, there is too much light.

Solution:

This program creates a window.  A variable-alpha-transparency, black, always-on-top window, with no titlebar, etc.
It covers my entire right monitor.  BUT, by setting WS_EX_TRANSPARENT, its made transparent to events, and thus mouse clicks, keystrokes, etc. are passed on through to the windows below it.

Win Numpad+ darkens the screen, Win Numpad- lightens the screen, Win Numpad* toggles the overlay on/off.

Getting WS_EX_TRANSPARENT set in an AHK script is as simple as adding +E0x20 to the Gui creation command.

So, without further ado, I present -- MonitorDimmer.
In both AHK and EXE.

Enjoy!
--matt


jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Monitor Dimmer
« Reply #1 on: January 23, 2008, 05:48 PM »
:D cool!
Thanks matt

Ehtyar

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,237
    • View Profile
    • Donate to Member
Re: Monitor Dimmer
« Reply #2 on: January 23, 2008, 06:16 PM »
If you're interested in setting the brightness of the entire screen, you can try the Windows gamma ramp API. I've used it myself, very helpful.

Ehtyar.

mmdoogie

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 14
    • View Profile
    • My Projects
    • Donate to Member
Re: Monitor Dimmer
« Reply #3 on: January 23, 2008, 07:11 PM »
Thanks for the API link Ehtyar.

When I started this, a friend suggested I look at the gamma settings of my graphics card.

However, I have my monitors color-managed, and the control panel disabled the gamma setting because of that,
so I have a suspicion that something like this would not work in my case.

Here is a much nicer version of the program.
It works with arbitrary monitor numbers, (instead of being hardcoded for my monitor sizes  8)),
and remembers dimming and show settings between launches.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Monitor Dimmer
« Reply #4 on: January 24, 2008, 01:41 AM »
cool  :up:

nosh

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,441
    • View Profile
    • Donate to Member
Re: Monitor Dimmer
« Reply #5 on: January 24, 2008, 06:22 PM »
This'll really help, I usually disable mon2 while watching movies and all my apps there jump to mon1.  :D
Thanks!

bliss

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 19
  • la la la-la
    • View Profile
    • bLisTeRinG soft
    • Read more about this member.
    • Donate to Member
Re: Monitor Dimmer
« Reply #6 on: May 26, 2008, 02:24 AM »
So good I've put it into my startup. I might make double-click choose 'toggle' and find a nice icon though if thats ok. Thanks!
Am we there yet?

BigJim

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 178
  • I have seen the light!
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Monitor Dimmer
« Reply #7 on: May 26, 2008, 09:57 AM »
I think that this little program is pretty neat! Thanks  :Thmbsup:

My use of it is just slightly different in that I don't often watch movies on my dual monitor setup. But I am frequently working in one application on one monitor while having to keep an eye on something on the other. So it's nice to have the one of lesser interest dimmed slightly. But when my focus shifts I'd like to be able to quickly swap the dimming effect to the other monitor. Any chance of incorporating that as a hot key rather than having to go through several mouse clicks to achieve it?

A nice icon will be fun, too.

Thanks for sharing, as they say.    :)
TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."

mmdoogie

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 14
    • View Profile
    • My Projects
    • Donate to Member
Re: Monitor Dimmer
« Reply #8 on: May 27, 2008, 02:21 AM »
A different icon would be nice -- I have trouble coming up with that kind of thing  :)

A suggestion on moving between the two monitors, and the one I use (because I already use the program for other things)
https://www.donation...82.msg53390#msg53390

I'm glad other people are finding use for this -- I knew I couldn't be the only one that could need it!

--matthew

BigJim

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 178
  • I have seen the light!
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Monitor Dimmer
« Reply #9 on: May 27, 2008, 07:07 AM »
MoveToMon is an interesting solution but, unfortunately, not one that works for me in this situation. The way I have my screen real estate carved up moving applications from one monitor to the other would only serve to make a jumble of things,
TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."

mmdoogie

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 14
    • View Profile
    • My Projects
    • Donate to Member
Re: Monitor Dimmer
« Reply #10 on: May 27, 2008, 08:46 AM »
Oh I'm sorry... I didn't mean to suggest that you move your applications from monitor-to-monitor.
If you deactivate then reactivate the monitor dimmer, its the active window and you can use the MoveToMon hotkeys to move the dimmer between monitors.

--matthew

BigJim

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 178
  • I have seen the light!
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Monitor Dimmer
« Reply #11 on: May 27, 2008, 01:53 PM »
Ah!  :-[ I get it. Thanks. :up:

That certainly does work although it's a little finicky - easy to not have the focus where you intend and/or several key/mouse strokes to run it the way you suggest. Also you must load two scripts instead of one. It would be fun to have that functionality built into Monitor Dimmer so that was the only thing that it moved and did it with a single keystroke (e.g. Win Numpad/ ?) ... IMHO.

Cheers!
Jim
TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."