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
----
Editor
[ Tuesday 10:30:00 Am_07 May 2019 ]
Hi Room
Took Me Two Hours as the Source Code is Not Very Apparent for the Thing I Ask For
Questions are Never That Easily Answered
Hoping Someone Might Find Helpful
Lazy Sunday Night Coder in April 2018
Enjoy
Also, I Include the Notepad++ Checker Boxing Checked Bit of Code Similar
----------------------------------------------------
Code Begin
----------------------------------------------------
#Warn
#NoEnv
#SingleInstance Force
;--------------------
#Persistent
;IT USER ExitFunc TO EXIT FROM #Persistent
;--------------------
DetectHiddenWindows, on
SoundBeep , 2000 , 100
SoundBeep , 2500 , 100
setTimer TIMER_SUB_1,100
setTimer TIMER_SUB_NOTEPAD_PLUS_PLUS,1000
setTimer TIMER_PREVIOUS_INSTANCE, 1000
; -------------------------------------------------------------------
; I used PREVIOUS_INSTANCE Detection For My Scripts Now
; Otherwise they Maybe Two or More Loaded When You Run a Whole Bunch Together Quickly at Bootup or Just to run Again after Killed the Lot or Something
; Sometimes On Less Quicker Machine Computer
; There Might Be a Bug with This at Display the Icon in System Tray Not Sure Yet Maybe it was at a Time when My System was Instability
; -------------------------------------------------------------------
TIMER_SUB_1:
DetectHiddenWindows, on
SetTitleMatchMode 2
; -------------------------------------------------------------------
; [ Sunday 22:34:10 Pm_15 April 2018 ]
; Time Spend
; Sun 15-Apr-2018 20:38:30 <>
; Sun 15-Apr-2018 22:38:00 = 2 Hours
; I Frequently Want to Swap between show Hidden Files in the System
; But it comes up with a Nag Screen Warning
; But It Doesn't Anymore
; Question With The Answer _ Answer Sewer
; ---------------------------------------------------
; Hide Protected Operating System Files (Recommended)
; ---------------------------------------------------
; I wasn't Able to Make it Check Against Any Text Other than Warning
; Not any Control Text or Other Windows Text
; But control Copy Gets the Text for The Clipboard
; There Was the Ability to Check if a Yes No Question was on the MsgBox
; But I Had to Do the Best I Able Do to Safeguard Hitting Another Window
; Project with More Subroutine Set
; Located Here Folder and Source File
; https://www.dropbox.com/sh/h2ebk12dksaq7j3/AAD9Ow_SbBP33JKmuALRkO1_a?dl=0
; https://www.dropbox.com/s/yuspt7npqj0jpuo/Autokey%20--%2019-SCRIPT_TIMER_UTIL.ahk?dl=0
; -------------------------------------------------------------------
if (WinExist("Warning") and WinExist("ahk_class #32770"))
{
; Test Line Remmed
; WinGet, OutputVar, ControlList, ahk_id %HWND%
; Tooltip, % OutputVar
WinGet, HWND, ID, Warning
WinGetClass, This_Class, ahk_id %HWND%
WinGet, path, ProcessName, ahk_id %HWND%
WinGetText, OutputVar, ahk_id %HWND%
WinGetPos, WinLeft, WinTop, WinWidth, WinHeight, ahk_id %HWND%
; Include Multiple If-And Statement With Separated Lines
; ---------------------------------
IF (This_Class="#32770"
and PATH="explorer.exe"
and OutputVar="&Yes`r`n&No`r`n"
and WinWidth=713
and WinHeight=256)
{
SoundBeep , 4000 , 100
Control, Check,, Button1
}
}
Return
; --------------------------------------------------------------
; [ Sunday 19:26:10 Pm_15 April 2018 ]
; THIS IS OUR PREFERRED DEFAULT OPTIONS FOR INSTALLING NOTEPAD++
; THE MIDDLE CHECKBOX IS SELECTED
; NONE OF OUR PLUGIN WILL WORK PROPER AS OUR SETUP USES THE
; Allow plugins to be loaded from %APPDATA%\notepad++ -- CHECKBOX CHECKED
; EVERY-TIME AN UPDATE COMES ALONG HAS TO BE REMEMBER
; OUR SETTER USES 32-BIT NOTEPAD FOR SOME REASON NOT UPGRADED YET
; ----
; AUTOHOTKEYS SELECT A CHECKBOX - Google Search
; https://www.google.co.uk/search?q=AUTOHOTKEYS+SELECT+A+CHECKBOX&oq=AUTOHOTKEYS+SELECT+A+CHECKBOX&aqs=chrome..69i57j0.11108j0j7&sourceid=chrome&ie=UTF-8
; --------
; Check a Checkbox - Control check..... - Ask for Help - AutoHotkey Community
; https://autohotkey.com/board/topic/25075-check-a-checkbox-control-check/
; ----
; --------------------------------------------------------------
TIMER_SUB_NOTEPAD_PLUS_PLUS:
;----------------------------------------
DetectHiddenWindows, on
SetTitleMatchMode 2 ; Avoids the need to specify the full path of the file below.
IfWinExist Notepad++
{
ControlGetText, OutputVar, Allow plugins to be loaded from, Notepad++
IF OutputVar
{
ControlGet, Status, Checked,, Button5
If Status = 0
{
Control, Check,, Button5
SoundBeep , 4000 , 100
}
}
}
Return
;----------------------------------------
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
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:
Post a Comment