Pole Magnet Checkmate Shoot Blog Post-Pillar Erection Mast Staff Woody Boner Message Delivery Slice of Toast Cut Section Blade Scythe Slit Slip Tool Member Syringe Micro Lance Piston Hypodermic Sharp Knife Sword Blade Skewer Scalpel Tip Junk Yard Tooltip Pin Cripple Ripple Point Prick Spike Cactus Point Teeth Locksmith Pickar Chisel Hack Saw Chain Saw Microscopic Spot Bit Byte Biter Mosquito Throw Missile Conscious Nail Digit Finger Solder Iron Silver Needle Bayonet Spear Axe Segment Selection Matrix Port Selector Mixer Unit Switch Opposite Obstacle Counter Anti Pro Con Fuck Stick Bullet Proof Flame Proof Water Proof Shock Proof Future Proof Pilot Pen Squawk Code 7500 Seven Five Man With A Knife Profane Pen Shakespeare Macbeth Romeo Juliet Arrow Heart Pump Red-Stop Traffic Passion-Go Vocabulary-Constabulary Mind Police Thought Police Audio Book Mind Reader Telepathy Silver Door

Friday 15 September 2017

AutoHotKey -- 14-Brightness.ahk -- Dimmer

All The Coder Project Set Are Now With GitHub
Where Maintain UpToDate All the Time
----
Matthew-Lancaster/Matthew-Lancaster: A Collection of Scripts For AutohotKeys, Dos Batch Command, VBScript, VB6, VB2008, Grub4Dos, Reg Keys, Win Powershell, SMTP
https://github.com/Matthew-Lancaster/matthew-lancaster
----

The Project Here At GitGub
----
Matthew-Lancaster/Autokey -- 14-Brightness With Dimmer.ahk
https://github.com/Matthew-Lancaster/Matthew-Lancaster/blob/master/SCRIPTER%20CODE%20--%20AUTOHOTKEY/Autokey%20--%2014-Brightness%20With%20Dimmer.ahk
----
Editor

[ Tuesday 10:30:00 Am_07 May 2019 ]


Hi, There, Room
Worked On This One Thursday and Friday
Brushing Up on My Technique From Newbie Entry Level at AutoHotKey
The Other Day Had a New System, and Was Code Something Halt at Not Have Proper Registered Driver
and Near Impossible to Check if a Driver is Registered even if Unregister Again it is Still present in Registry to Show
At the End For My JoyPad Controller and Reciever 
Rumble Pad and F710 Logitech
I Had the Code Register the Driver Before the Next Line of Code Ready to Run _, And All Happen Seamlessly
Now It Register the Driver Once a Day 
Check Work_a_Round
I Could Do to Another computer as Only Once
But Sometimes My Reinstall is to the Same Computer Name and User
That Was Another Subject Get to the Point
Here is My Code
I Found Recently Google Does Not Do a Nice Display HTML Page On Google Drive 
But DropBox Does It Nicely
Here The Project Code is For Dimm the Brightness of the Monitor 
Something Better than Screen Saver Blank Switch Off
Unfortunately
Windows 7 Was Okay Dimmer after IDLE Time
but Windows Above Require SECPOL.MSI Running to Set that Thing
Which only Pro Version Pay Extra For Having to Allow Dimmer After IDLE
BackWards About Environmentally Friendly 
Microsoft __ How Dimmer _ Din
Over and Out
~
Fri 15 September 2017 13:11:54----------
----
Roids Polaroids Mach 2 HardCore: AutoHotKey -- 14-Brightness.ahk -- Dimmer
http://roidsrim-minimal.blogspot.co.uk/2017/09/AutoHotkey--14-Brightness.ahk--Dimmer.html
----
----
Hi, Room Worked On This One Thursday and Friday... - Matthew Lancaster
https://www.facebook.com/matthew.lancaster.4/posts/10208906605496145?comment_id=10208906608336216&comment_tracking=%7B%22tn%22%3A%22R%22%7D
----
----
Hi, Room Worked On This One Thursday and Friday Brushing Up on My Technique Fr...
https://plus.google.com/u/0/+RoidsRim-0/posts/LxaXsLkHD12
----

;# __ C:\SCRIPTER\SCRIPTER CODE -- AUTOKEY\AutoKey -- 14-Class_Monitor-master\src\AutoKey -- 14-Brightness.ahk
;# __ AutoKey -- 14-Brightness.ahk
;# BY Matthew __ Matt.Lan@Btinternet.com __ Fri 15 September 2017 & Saturday
;# 
; GLOBAL SETTINGS ===================================================

#Warn
#NoEnv
#SingleInstance Force
#Persistent
;IT USER ExitFunc TO EXIT FROM #Persistent
;--------------------

#Include C:\SCRIPTER\SCRIPTER CODE -- AUTOKEY\AutoKey_14_Class_Monitor-master\SRC\Class_Monitor.ahk     ; include the class here

;# ------------------------------------------------------------------
;# ----
;# GitHub - jNizM/Class_Monitor: Monitor Class (WinAPI)
;# https://github.com/jNizM/Class_Monitor
;# ----
;# ----
;# Class Monitor (Brightness, ColorTemperature) - AutoHotkey Community
;# https://autohotkey.com/boards/viewtopic.php?f=6&t=7854
;# ----
;# ------------------------------------------------------------------
;# HITT CLONE OR DOWNLOAD __ DON'T HAVE TO BE A SIGNED UP MEMBER
;# Class_Monitor.ahk __ PUT THIS IN A FOLDER WITH THIS CODE OR VICE VERSA YOUR CODE HERE IN THIS FOLDER
;# UNLIKE THE DIM CONTROL OF COMPUTER STANDBY THAT NOT WORKING WELL ABOVE WINDOWS 7
;# YOU REQUIRE SECPOL.MSI TO RUN WHICH REQUIRE PRO VERSION NOT HOME VERSION
;# ALSO HERE __ THIS SET THE BRIGHTNESS OF ALL MONITOR
;# BUT EXTERNAL MONITOR CAN EASY BE SWITCHED OF AT NIGHT OTHER LEFT ON AND BRIGHT ON YOUR EYE
;# THAT IS GOOD FOR YOU
;# ALSO UNLIKE DIM CONTROL ALL MONITOR IS ANSWER IT SET A DIFFERENT KIND OF BRIGHTNESS 
;# ADJUSTMENT _ I THINKER __ THAT WHY ALL MONITOR GET SET INCLUDE HDMI ON 
;# WHERE DIM CONTROL USUAL NOT AFFECTING
;# BUT HERE CONTROL SCAN ALL MONITOR
;# SEEM BUG IN CODE AS NOT ABLE USE PART WHERE A CERTAIN ONE MONITOR
;# GOOD NIGHT OVER AND OUT 
;# Fri 15 September 2017 01:09:04----------
;# 
;# TO LATER ADD WORK TO DO _ NOT DIM SCREEN SAVER WHEN CERTAIN ACTIVITY PROGRAM RUNNER
;# DONE
;# TO LATER ADD WORK TO DO _ SEND A DIMMER WHEN MOUSE CLICK OVER ONE SIDE OF THE SCREEN 
;# FOR A TIME OR OFF AGAIN
;#
;# SOME OF THE IDLE ROUTINE ABOUT WERE CODED IN 2005 WHEN WINDOWS_98 WAS AROUND
;# THESE DIMMER ROUTINE ARE CURRENTLY
;#
;# ENERGY PROBLEM OVER
;# ------------------------------------------------------------------
;# WHY PAY FOR PRO TO HAVE ENERGY FEATURE
;# --------------------------------------
;# 1ST EVENT OF DIMMER IS IN 4 SECOND IDLE NEXT AFTER ARE IN 2 MINUTE
;# ------------------------------------------------------------------
;# WORK HISTORY
;# ------------------------------------------------------------------
;# Fri 15 September 2017 01:09:04---- ABOVE WORK BEGINNER
;# ------------------------------------------------------------------
;# Wed 21 March     2018 02:10:21---- Work to Detect Explorer Was Active ;# As it Remains Present When Closed and Minimal Sometimes Error There 
;# had to be Resolved _ Explorer and Other Program make Quicker Timeout ;# Brightness Change _ Few Hour-ing
;# ------------------------------------------------------------------

;#InstallKeybdHook
;#InstallMouseHook
;# IF YOU GOT ANYTHING KEYBOARD HOOKING SENDING A KEY OR MOUSE
;# AND USE HERE A_TimeIdlePhysical __ INSTEAD OF A_TimeIdle
;# ONLY Physical INPUT NOT SIMULATED SENDER

;# TRICK PART OF CODE IS MANY DON'T TELL HAVE TO FIND IDLE AS WELL ALSO THE ACTIVE PART
;# ALL VERY WELL SWITCH THE SCREEN SAVER ON BUT____ AND THEN OFF SCREEN SAVER

OnExit, EOF                                  ; set onexit to the label "EOF"
Display := New Monitor()                     ; initialize / start the class

; SCRIPT ============================================================

DetectHiddenWindows, on

CoordMode, Mouse, Screen
Mouse_Idle = 0 
Mouse_Idle_Flip_Flop_Toggle := "True"
ALLOW_DIMMER := "True"
LastX = 0
LastY = 0
VAR_A__TimeIdle = 0
VAR_Z__TimeIdle_1 = 4000
VAR_Z__TimeIdle_4_DEFAULT = 80000 ; 4 MINUTE
VAR_Z__TimeIdle_3_FORCE = 2000 
VAR_Z__TimeIdle_2 = %VAR_Z__TimeIdle_2_DEFAULT%
VAR_Z__TimeIdle = %VAR_Z__TimeIdle_1%
OLDWinActive = 0
WinActive_2 = 0

SoundBeep , 1000 , 100
SoundBeep , 3000 , 100
GOSUB, MONITOR_BRIGHTNESS_UP


SetTimer,Mouse_Idle_Timer, 1000     ; Check Every Second
setTimer TIMER_PREVIOUS_INSTANCE,4000


;# ------------------------------------
Mouse_Idle_Timer:
DetectHiddenWindows, on
ALLOW_DIMMER := "True"

;if WinActive("ahk_class MediaPlayerClassicW")
;ALLOW_DIMMER := "False"
;# If WinExist("ahk_class MediaPlayerClassicW")
;# ALLOW_DIMMER := "False"

;# if WinActive("ahk_class Notepad++")
;# ALLOW_DIMMER := "False"



isFullScreen := isWindowFullScreen( "A" ) ; ActiveWindow
if isFullScreen 
ALLOW_DIMMER := "False"

SetTitleMatchMode, 2
FORCE_DIMMER_QUICKER := "FALSE"
VAR_Z__TimeIdle_2=%VAR_Z__TimeIdle_4_DEFAULT%
DetectHiddenWindows, off
WinActive_2 = 0
if WinActive("GoodSync")
    {
        VAR_Z__TimeIdle_2=%VAR_Z__TimeIdle_3_FORCE%
        VAR_Z__TimeIdle = %VAR_Z__TimeIdle_2%
        WinActive_2 = 1
    }

if WinActive("Notepad++")
    {
        VAR_Z__TimeIdle_2=%VAR_Z__TimeIdle_3_FORCE%
        VAR_Z__TimeIdle = %VAR_Z__TimeIdle_2%
        WinActive_2 = 1
    }

;# EXPLORER    
;# --------
#IfWinActive ahk_class CabinetWClass
    {
    isWindowFocusExplorer_2 := isWindowFocusExplorer( "A" ) ; ActiveWindow
    if isWindowFocusExplorer_2
        {
        VAR_Z__TimeIdle_2=%VAR_Z__TimeIdle_3_FORCE%
        VAR_Z__TimeIdle = %VAR_Z__TimeIdle_2%
        WinActive_2 = 1
        }
    }
    
IF (OLDWinActive=0 and WinActive_2=1)
    { 
        ;SoundBeep , 2000 , 100
        GOSUB, MONITOR_BRIGHTNESS_DIM
    } 
OLDWinActive=%WinActive_2%


GetKeyState, state, LButton
   if state = D              
; MOUSE BUTTON LEFT HELD DOWN WHEN DRAGGER FOR LONG NOT DETECT BY IDLE ACTIVE UNLESS SWITCH
ALLOW_DIMMER := "False"


;#-------------------------------
If (A_TimeIdle > VAR_Z__TimeIdle and ALLOW_DIMMER = "True")
{
 VAR_Z__TimeIdle = %VAR_Z__TimeIdle_2%
 GOSUB, MONITOR_BRIGHTNESS_DIM
}
GOSUB, Keyboard_Idle_Timer
;#-------------------------------
Return ; End of Mouse_Idle_Timer

;# ------------------------------------------------------------------
Keyboard_Idle_Timer:
;# Tooltip % + A_TimeIdle " -- " VAR_A__TimeIdle 
;TEST DEBUG ___________

IF (A_TimeIdle < VAR_A__TimeIdle)
{
;SoundBeep , 2500 , 100
;TEST DEBUG ___________

GOSUB, MONITOR_BRIGHTNESS_UP
}
VAR_A__TimeIdle = %A_TimeIdle%

;# A_TimeIdle - SHOW TIME SINCE LAST KEYBOARD OR MOUSE IN MILLISECOND
;# THE DETECT IS IF LOWER THAN
;# ---------------------------
return

;# ------------------------------------------------------------------
MONITOR_BRIGHTNESS_DIM:
If (Mouse_Idle_Flip_Flop_Toggle = "False")
{
    ;# BRIGHTNESS LOW 1 IS MINIMAL DIMMER
    IF WinActive_2=0
    { 
        SoundBeep , 1500 , 100
    }
    Monitor.SetBrightness(1, 1, 1)
    SetTimer,Mouse_Idle_Timer, 10 ; RAPID RESPONSE BRING OUT OF DIM
    ;# SET TIMER TO THE SECOND 1000MS FOR EASIER COUNTER TIME_OUT
    Mouse_Idle_Flip_Flop_Toggle := "True"
}
RETURN

;# ------------------------------------------------------------------
MONITOR_BRIGHTNESS_UP:
If (Mouse_Idle_Flip_Flop_Toggle = "True")
{
    ;SoundBeep , 2500 , 100
    ;# BRIGHTNESS UP 50% IS 100% __ Full Bright
    Monitor.SetBrightness(127, 127, 127)
    SetTimer,Mouse_Idle_Timer, 1000
    Mouse_Idle_Flip_Flop_Toggle := "False"
}
RETURN

;# ------------------------------------------------------------------
isWindowFocusExplorer( winTitle ) {
winID := WinExist( winTitle )
If ( !winID )
    Return false
WinGetClass, this_class, ahk_id %winID%
WinActiveExplorer=false

If this_class=CabinetWClass
    WinActiveExplorer=true
If this_class=ExploreWClass
    WinActiveExplorer=true

WinGet style, MinMax, ahk_id %WinID%
;tooltip, %style%

if WinActiveExplorer=false
    Return false

;1 maximized 0 normal -1 minimized
If style=-1
{
    ;SoundBeep , 2500 , 100
    Return false
}

Return true
}


;# ------------------------------------------------------------------
isWindowFullScreen( winTitle ) {
; checks if the specified window is full screen

winID := WinExist( winTitle )

If ( !winID )
    Return false

WinGet style, Style, ahk_id %WinID%
WinGetPos ,,,winW,winH, %winTitle%

; 0x800000 is WS_BORDER.
; 0x20000000 is WS_MINIMIZE.
; no border and not minimized

Return ((style & 0x20800000) 
or winH < A_ScreenHeight 
or winW < A_ScreenWidth) ? false : true

;# ----
;# Detect Fullscreen application? - Ask for Help - AutoHotkey Community
;# https://autohotkey.com/board/topic/38882-detect-fullscreen-application/
;# ----
}



TIMER_PREVIOUS_INSTANCE:

if ScriptInstanceExist()
{
    Exitapp
}
return

ScriptInstanceExist() {
    static title := " - AutoHotkey v" A_AhkVersion
    dhw := A_DetectHiddenWindows
    DetectHiddenWindows, On
    WinGet, match, List, % A_ScriptFullPath . title
    DetectHiddenWindows, % dhw
    return (match > 1)
    }
Return

;# ------------------------------------------------------------------
EOF:                           ; on exit
Display.OnExit()               ; release and free the library
ExitApp     
;# ------------------------------------------------------------------

; Register a function to be called on exit:
OnExit("ExitFunc")

; Register an object to be called on exit:
OnExit(ObjBindMethod(MyObject, "Exiting"))

;# ------------------------------------------------------------------
ExitFunc(ExitReason, ExitCode)
{
    if ExitReason not in Logoff,Shutdown
    {
        ;MsgBox, 4, , Are you sure you want to exit?
        ;IfMsgBox, No
        ;    return 1  ; OnExit functions must return non-zero to prevent exit.
    }
    ; Do not call ExitApp -- that would prevent other OnExit functions from being called.
}

class MyObject
{
    Exiting()
    {
        ;
        ;MsgBox, MyObject is cleaning up prior to exiting...
        /*
        this.SayGoodbye()
        this.CloseNetworkConnections()
        */
    }
}
;# ---------------------------------------------------------------------
; exit the app

No comments: