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

Saturday 21 April 2018

Autokey -- NORTON CONTROL BOOTER -- Run Norton Quick Check at Boot Up

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 -- 18-NORTON CONTROL BOOTER.ahk
https://github.com/Matthew-Lancaster/Matthew-Lancaster/blob/master/SCRIPTER%20CODE%20--%20AUTOHOTKEY/Autokey%20--%2018-NORTON%20CONTROL%20BOOTER.ahk

----

Editor
[ Tuesday 10:30:00 Am_07 May 2019 ]

;====================================================================
;# __ C:\SCRIPTER\SCRIPTER CODE -- AUTOKEY\Autokey -- 18-NORTON CONTROL BOOTER.ahk
;# __ 
;# __ Autokey -- 18-NORTON CONTROL BOOTER.ahk
;# __ 
;# BY Matthew __ Matt.Lan@Btinternet.com
;# __ 
;# 1ST START TIME [ Wed 02:32:20 Am_15 Nov 2017 ]
;# 2ND END   TIME [ Wed 04:14:50 Am_15 Nov 2017 ]
;# 3RD FINAL TIME [ Wed 07:00:40 Am_15 Nov 2017 ]
;# 4TH FROM  TIME [ Sat 16:00:22 Pm_21 Apr 2018 ]
;# 4TH TO    TIME [ Sat 19:10:00 Pm_21 Apr 2018 ] 3 HOUR _ Skillful Improver
;# 5TH FROM  TIME [ Sun 23:00:00 Pm_22 Apr 2018 ] 
;# 5TH TO    TIME [ Sun 23:59:00 Pm_22 Apr 2018 ] 32 Bit 64 Bit Sort Out
;# 6TH FROM  TIME [ Mon 15:40:00 Pm_23 Apr 2018 ] 
;# 6TH TO    TIME [ Mon 15:59:00 Pm_23 Apr 2018 ] Shortcut Desktop Norton 
;# 7TH FROM  TIME [ Mon 18:00:00 Pm_23 Apr 2018 ] 
;# 7TH TO    TIME [ Mon 18:40:00 Pm_23 Apr 2018 ] Minimize Amount Code Searcher Neater
;# __ 
;====================================================================

;# ------------------------------------------------------------------
; An AutoHotKeys Project to Start Norton for a Quick Scan 
; Every Time Boot Up
; It Got Folder Scanning to Find the Up to Date Norton to Use
;# ------------------------------------------------------------------
; Location OnLine
; ---------------
; Link to Folder of My AutoHotKeys Project Set
; https://drive.google.com/open?id=0BwoB_cPOibCPVmVYT1pKWUk4LVE

; Link to Folder of My AutoHotKeys Project Set Dropbox
; https://www.dropbox.com/sh/h2ebk12dksaq7j3/AAD9Ow_SbBP33JKmuALRkO1_a?dl=0

; Link to This File On DropBox With Most Up to Date
; https://www.dropbox.com/s/bsvrrmyknxr7pvd/Autokey%20--%2018-NORTON%20CONTROL%20BOOTER.ahk?dl=0
;# ------------------------------------------------------------------

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

DetectHiddenWindows, on

PASS_LEVEL_VAR_1=FALSE
PASS_LEVEL_VAR_2=FALSE
Counter_Minimze_1=0
Counter_Minimze_2=0
HWND_1=0
HWND_2=0

SoundBeep , 2000 , 100
SoundBeep , 2500 , 100

setTimer TIMER_SUB_1,1000
setTimer TIMER_PREVIOUS_INSTANCE,1
SetTimer TIMER_TEST,off

GOSUB RUN_NORTON

RETURN

TIMER_TEST:    
    WinGet, HWND, ID, A  ; Get Active Window
    WinGet, OutputVar, ControlList, ahk_id %HWND%
    Tooltip, % OutputVar ; List All Controls of Active Window
return

RUN_NORTON:
SET_GO=TRUE
FILENAME="" 

IfWinExist ahk_class SymHTMLDialog 
    SET_GO=FALSE
IfWinExist ahk_class Sym_Common_Scan_Window
    SET_GO=FALSE

IF SET_GO=TRUE
{
    ProgramFilesX86 := A_ProgramFiles . (A_PtrSize=8 ? " (x86)" : "")

    ; 32 bit Norton Installed
    IF FILENAME="" 
    {    
        Loop Files, %ProgramFilesX86%\Norton Security with Backup\Navw32.exe, R  ; Recurse into subfolders.
        {
            FILENAME = %A_LoopFileFullPath%
            SHORTCUT_FILENAME = %A_LoopFileDir%\uistub.exe
        }
    }
    ; 64 bit Norton Installed
    IF FILENAME="" 
    {
        Loop Files, %A_ProgramFiles%\Norton Security with Backup\Navw32.exe, R  ; Recurse into subfolders.
        {
            FILENAME = %A_LoopFileFullPath%
            SHORTCUT_FILENAME = %A_LoopFileDir%\uistub.exe
        }
    }
    
    ; -------------------------------------------------------------
    ; DOUBLE BACKUP IF NORTON IS NOT FOUND
    ; THEY MAY OF CHANGED THE FOLDER NAME KEPT AT
    ; MAKE SOME MORE SOUND TO INDICATE SOMETHING IS UP 
    ; FIND THE CORRECT NEAREST LOCATION OF NORTON AND EDIT IN ABOVE
    ; -------------------------------------------------------------
    
    ; 32 bit Norton Bigger Search
    IF FILENAME="" 
    {
        SoundBeep , 2000 , 100
        SoundBeep , 2500 , 100
        SoundBeep , 3500 , 100

        Loop Files, %ProgramFilesX86%\Navw32.exe, R  ; Recurse into subfolders.
        {
            FILENAME = %A_LoopFileFullPath%
            SHORTCUT_FILENAME = %A_LoopFileDir%\uistub.exe
        }
    }

    ; 64 bit Norton Bigger Search
    IF FILENAME="" 
    {
        SoundBeep , 2000 , 100
        SoundBeep , 2500 , 100
        SoundBeep , 3500 , 100

        Loop Files, %A_ProgramFiles%\Navw32.exe, R  ; Recurse into subfolders.
        {
            FILENAME = %A_LoopFileFullPath%
            SHORTCUT_FILENAME = %A_LoopFileDir%\uistub.exe
        }
    }

    IF FILENAME="" 
    {
        SoundBeep , 3500 , 100
        SoundBeep , 2500 , 100
        MSGBOX, "AutoHotkeys __ Norton Security Was Not Found - ENDER"
        SoundBeep , 3500 , 100
        SoundBeep , 2500 , 100
        Exitapp
    }
    
    IF FILENAME<>"" 
    {
        SoundBeep , 2000 , 100
        Run, "%FILENAME%" /UPDATE /QUICK, , MIN
        FileCreateShortcut, %SHORTCUT_FILENAME%, %A_Desktop%\Norton Security.lnk, , "%A_ScriptFullPath%"
    }
}
RETURN

TIMER_SUB_1:
    WinGet, HWND_1, ID, ahk_class SymHTMLDialog
    IF (HWND_1>0 and PASS_LEVEL_VAR_2="FALSE")
    {
        WinActivate ahk_id %HWND_1%
        HWND_3 := WinExist("A")
        IF HWND_1=%HWND_3%            
        {
            sendinput, !{F4}
            SoundBeep , 2500 , 100
            Sleep 1000
        }
        ELSE
            SoundBeep , 1500 , 200    
    }
    
    WinGet, HWND_1, ID, ahk_class SymHTMLDialog
    IF HWND_1>0 
        PASS_LEVEL_VAR_1=TRUE
    WinGet, HWND_2, ID, Quick Scan ahk_class Sym_Common_Scan_Window
    IF HWND_2>0 
        {
        PASS_LEVEL_VAR_1=TRUE
        PASS_LEVEL_VAR_2=TRUE
        }
        
    WinGet, HWND_2, ID, Quick Scan ahk_class Sym_Common_Scan_Window
    WinGetClass, This_Class, ahk_id %HWND_2%
    WinGet, Current_MinMax, MinMax, ahk_id %HWND_2%

    if Counter_Minimze_1=0
    Counter_Minimze_2=0
    
    If (Current_MinMax=-1 
        and Counter_Minimze_1>0)
        Counter_Minimze_2=14
    
    If (Current_MinMax=0 and Counter_Minimze_1<2 and Counter_Minimze_2<1)
    {
        WinMinimize  ahk_id %HWND_2%
        SoundBeep , 2500 , 100
        SoundBeep , 3500 , 100
        Counter_Minimze_1+=1
    }
    Counter_Minimze_2-=1
    if Counter_Minimze_2<-10
        Counter_Minimze_2=-10
        
    If (PASS_LEVEL_VAR_1="TRUE" and PASS_LEVEL_VAR_2="TRUE" and (!HWND_1) and (!HWND_2))
        {
        SoundBeep , 3500 , 100
        SoundBeep , 2500 , 100
        Exitapp
        }
Return


;# ------------------------------------------------------------------
TIMER_PREVIOUS_INSTANCE:
SETTIMER TIMER_PREVIOUS_INSTANCE,10000

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()
        */
    }
}
;# -----------------------------------------------------------------0
; exit the app


; GOOD SCRIPT EXAMPLE PAGE HELPER
; ----
; 1 Hour Software by Skrommel - DonationCoder.com
; http://www.donationcoder.com/Software/Skrommel/index.html#GoneIn60s
; ----

; Junk Code Been Try
;Is64Bit() 
;{
   ;return (RegexMatch(EnvGet("Processor_Identifier"), "^[^ ]+64") > 0)
;}

AutoKey -- 02-(SAVE AS) KEY ENTER.ahk

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 -- 02-SAVE AS KEY ENTER.ahk
https://github.com/Matthew-Lancaster/Matthew-Lancaster/blob/master/SCRIPTER%20CODE%20--%20AUTOHOTKEY/Autokey%20--%2002-SAVE%20AS%20KEY%20ENTER.ahk
----
Editor

[ Tuesday 10:30:00 Am_07 May 2019 ]


AutoHotKeys Project Code to Use Press Enter Key on (Save As) Window Dialogue in Chrome.exe & Pause On a Timer 120 Sec When Chrome.exe Gone

Over
~
Matthew
[ Saturday 08:41:40 Am_21 April 2018 ]

----------
CODE BEGIN
----------
;# __ C:\SCRIPTER\SCRIPTER CODE -- AUTOKEY\Autokey -- 02-SAVE AS KEY ENTER.ahk
;# __ 
;# __ Autokey -- 02-SAVE AS KEY ENTER.ahk
;# __ 
;# BY Matthew __ Matt.Lan@Btinternet.com
;# __ 
;# Thu 25 Aug 2016 01:47:51 Work Time Beginner
;# Thu 25 Aug 2016 03:00:00 3 Hour
;# Thu 25-Aug-2016 06:16:41 2nd Wave of Work Better Coder Emerged
;# Thu 25-Aug-2016 16:31:00 40 Minute
;# Thu 25-Aug-2016 11:20:00 3RD WAVE 
;# Thu 25-Aug-2016 16:31:00 5 & Half Hour
;# Sat 21-Apr-2018 07:24:30 4TH WAVE Massively Better
;# Sat 21-Apr-2018 08:28:00 1 Hour
;# __ 

;--------------------------------------------------------------------
; AutoHotKeys Project Code to User Press Enter Key on (Save As) Window  Dialogue in Chrome.exe & Exit On a Timer 120 Sec When Chrome.exe Gone

;
;--------------------------------------------------------------------
; First Wave Bash
; ---------------
; Thu 25 Aug 2016 01:47:51 -- Length Time 1hr 45M - Finish Code
; Thu 25 Aug 2016 02:35:00 -- Length Time+2hr 30M - Fine Tune & Doc
; Thu 25 Aug 2016 03:00:00 -- Length Time+3hr 00M - Publish On-line

; A Second Session Bash __ Dawn
; ------------------------------------------------
; Thu 25-Aug-2016 06:16:41 --
; Thu 25 Aug 2016 07:00:00 -- Length Time 0 hr 40 Min -- Tune Doc & Publish

; A Third Session Bash __ Morning
; Thu 25-Aug-2016 11:20:00 
; Thu 25-Aug-2016 14:59:29
; Thu 25-Aug-2016 16:31:00 -- 11 TO 4pm 5 Half Hour Hurt Ouch

; A Fourth Session Improved Code Dramatically
; ------------------------------------------
; Sat 21-Apr-2018 07:24:30 -- BEGINNER
; Sat 21-Apr-2018 08:28:00 -- 1 HOUR WITH PUBLISH ON-LINE
;--------------------------------------------------------------------

;--------------------------------------------------------------------
; 2nd Project in a Line of AutoKey -- First On Blogger Here
; This is All Copy Paste in and Go Project for AutoHotKeys Working
; Building Block Head Start
;--------------------------------------------------------------------


; BEGIN CODE
;--------------------
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#SingleInstance force
;--------------------
; SingleInstance Force Reduce Question at Reload
;--------------------

;--------------------------------------------------------------------
#Persistent
; A code block to use around --- Persistent

;--------------------------------------------------------------------

SoundBeep , 2000 , 200
SoundBeep , 2500 , 100

pause
soundbeep , 1100,100

SetTimer TIMER_Main_Code,1000
SetTimer TIMER_PREVIOUS_INSTANCE,1

Return

;----------------------------------------------------------------------
TIMER_Main_Code:

    If WinExist("ahk_class Chrome_WidgetWin_1")
    {
        WinGet, HWND, ID, Save As
        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%

        ; Multiple If-And Statement With Separated Lines
        ; ----------------------------------------------
        IF (This_Class="#32770" 
        and PATH="Chrome.exe")
        {
            SoundBeep , 1200, 100
            SoundBeep , 2500 , 100
            ControlClick, &Save, Save As
        }
    }
    
    WinGet, HWND, ID, A
    WinGetClass, This_Class, ahk_id %HWND%
    IF This_Class=Chrome_WidgetWin_1 
        Var_Count = 0

    IF This_Class <> Chrome_WidgetWin_1 
        Var_Count += 1
        
    if Var_Count > 120
        {
            SoundBeep , 1100,100
            Pause
            SoundBeep , 1100,100
            Var_Count = 0
        }
Return

TIMER_PREVIOUS_INSTANCE:
SetTimer TIMER_PREVIOUS_INSTANCE,10000
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


;--------------------------------------------------------------------
; Work Note Rather Novice at First Began
;--------------------------------------------------------------------
; Yes Fixed the Error Variable Increment -- Seem Like a C++ Method Style -- TEST_VAR += 1

; This Program Has Problem in Win 10 The Dialog to Save Do Stay So Move On After Save to Next Icon to Do Save JPG Screenshot
; ----
; Save as Shortcut - Chrome Web Store
; https://chrome.google.com/webstore/detail/save-as-shortcut/flehofiklehmnnolpjcamplcnmhgcbkk?utm_source=chrome-app-launcher-info-dialog
; ----

; A Tip to Learn With This Program is 
; When Ask to Save Select JPG From PNG and It will Remember
; ----
; Capture Webpage Screenshot Entirely. FireShot - Chrome Web Store
; https://chrome.google.com/webstore/detail/capture-webpage-screensho/mcbpblocgmgfnpjjppndjkmgjaogfceg?utm_source=chrome-app-launcher-info-dialog
; ----
;--------------------------------------------------------------------
; Work Logg -- Start time not that clear
; Yes Found Time Begin Phew Charging Someone for This Automation -- RSI Injury


;--------------------------------------------------------------------
;--------------------------------------------------------------------
; Info Note
;--------------------------------------------------------------------

; Use of these 4 Link in Turn to Save Page of the Chrome Extension
;--------------------------------------------------------------------
; 1.. Copy All Urls - Chrome Web Store
; 2.. Save as Shortcut - Chrome Web Store
; 3.. Capture Webpage Screenshot Entirely. FireShot - Chrome Web Store
; 4.. SingleFile - Chrome Web Store -- to Save an HTML Version
;--------------------------------------------------------------------

;--------------------------------------------------------------------
;--------------------------------------------------------------------
;Ref: - Credit to Source Helper Ref:
;--------------------------------------------------------------------
;--------------------------------------------------------------------
;AutoKey Source to Learn
;--------------------------------------------------------------------
;Begin Here Google Search
;--------------------------------------------------------------------
;1..
;How to save files using Enter key? - Ask for Help - AutoHotkey Community
;https://autohotkey.com/board/topic/124006-how-to-save-files-using-enter-key/

;--------------------------------------------------------------------
;AutoKey Info Help Web
;--------------------------------------------------------------------
;1..
;OnExit
;https://autohotkey.com/docs/commands/OnExit.htm
;--------
;2..
;While-loop
;https://autohotkey.com/docs/commands/While.htm
;--------
;3..
;Else
;https://autohotkey.com/docs/commands/Else.htm
;--------
;4..
;OnExit
;https://autohotkey.com/docs/commands/OnExit.htm
;--------
;5..
;Functions
;https://autohotkey.com/docs/Functions.htm
;--------------------------------------------------------------------

;--------------------------------------------------------------------
;Ref
;Chrome Extension
;--------------------------------------------------------------------

;1..
;--------
;This One not Much To do With Here But Still Used
;--------
;Copy All Urls - Chrome Web Store
;https://chrome.google.com/webstore/detail/copy-all-urls/djdmadneanknadilpjiknlnanaolmbfk?utm_source=chrome-app-launcher-info-dialog
;--------

;2..
;--------
;Yes Save to URL to Download Folder
;--------
;Save as Shortcut - Chrome Web Store
;https://chrome.google.com/webstore/detail/save-as-shortcut/flehofiklehmnnolpjcamplcnmhgcbkk?utm_source=chrome-app-launcher-info-dialog
;--------

;3..
;--------
;This One Save Auto to Download Folder Without Our Coding Requirement
;--------
;Capture Webpage Screenshot Entirely. FireShot - Chrome Web Store
;https://chrome.google.com/webstore/detail/capture-webpage-screensho/mcbpblocgmgfnpjjppndjkmgjaogfceg?utm_source=chrome-app-launcher-info-dialog
;--------

;4..
;--------
;As Well as Save Screen Shot About Do a Web Page HTML Save also
;Be Good If Done Without an Extra Ask to Download Save As
;But Setup to Store a Page on a Web On-line Auto -- PageArchiver
;--------
;SingleFile - Chrome Web Store
;https://chrome.google.com/webstore/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle?utm_source=chrome-app-launcher-info-dialog
;--------------------------------------------------------------------


;--------------------------------------------------------------------
;SEMI USELESS CODE SHOVED TO BOTTOM LOOK AT LATER
;--------------------------------------------------------------------
;WinGet nChromeWindows, Count, ahk_class Chrome_WidgetWin_1

;----
;[Solved] How to get the hwnd of the current script - Ask for Help - AutoHotkey Community
;https://autohotkey.com/board/topic/35140-solved-how-to-get-the-hwnd-of-the-current-script/
;----
;ThisScriptsHWND := WinExist("Ahk_PID " DllCall("GetCurrentProcessId"))
;msgbox %ThisScriptsHWND% is this script's HWND

;--------------------------------------------------------------------
;Don't stay RSI -Save Me- if Form Change
;--------------------------------------------------------------------
;WinGetTitle, active_title, A
;IF active_title <> O_active_title
;{
;    SoundBeep
;    break
;}
;O_active_title = %active_title%

Autokey -- Block Key CTRL-Enter On Web Pages MYSMS & FB GrinBook

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 -- 15-BLOCK KEY CTRL-ENTER ON WEB PAGES MYSMS & FB GB.ahk
https://github.com/Matthew-Lancaster/Matthew-Lancaster/blob/master/SCRIPTER%20CODE%20--%20AUTOHOTKEY/Autokey%20--%2015-BLOCK%20KEY%20CTRL-ENTER%20ON%20WEB%20PAGES%20MYSMS%20%26%20FB%20GB.ahk
----Editor


[ Tuesday 10:30:00 Am_07 May 2019 ]

Here is the Code in AutoHotKeys to Change Shift-Enter Control Enter and Enter for Use when Sending Messenger and Not Wanting to Send on The Enter Key or By Accident Control Enter
For Use with MYSMS and GrinBook FB And Any Other May Find Later
My New Improved Style of Coding Read a Bit More in Rem Line
Took 4 Hours Work Additional on Code Before the Last Attempt Early Hour Until Dawn

Over and Out
~
Matthew

[ Saturday 05:42:10 Am_21 April 2018 ] The UK

;# __ C:\SCRIPTER\SCRIPTER CODE -- AUTOKEY\Autokey -- 15-BLOCK KEY CTRL-ENTER ON WEB PAGES MYSMS & FB GB.ahk
;# __ 
;# __ Autokey -- 15-BLOCK KEY CTRL-ENTER ON WEB PAGES MYSMS & FB GB.ahk
;# __ 
;# BY Matthew __ Matt.Lan@Btinternet.com __ 
;# Wed 18 October 2017 02:05:00 Work Time Beginner
;# Sat 21 April   2018 04:00:00 2nd Wave of Work Better Coder Emerged
;# __ 

; -------------------------------------------------------------------
; New Code Improver New Style Of Coder Improved Working
; Multi-Keys Set Multi Operations On One Key
; Little Tricky 
; To Make Code Less Complex Having To Use So Many Variables
; I Could Have Used A Timer If A Key Was Not Used And Want 
; To Place Back As Original When Not User
; But For Better Speed Do While Intercept Key As Quickly As Possible
; The Tricky Bit Was If A Key Was Intercept And Decided Not 
; Any Action Required To Change It
; The Key Has To Be Placed Back In The Buffer As Originally Was
; And That Plays A Knock-On Effect Later On In The Code 
; That Has To Be Taken Care Of
; The Idea Is I Want A Series Of Swapping Control And Shift-Return
; To Enter Key And Vice Versa Depending On If In The Mysms Program That I Use 
; A Lot And Also Facebook 
; Facebook Is Only Detected Because Of My Name As The Title Of The Window 
; And Also The Class Name Not Much More Can Do On That One
; New Update Write Code Time
; Now Facebook Is Going To Have A Problem Because Of The Enter Key
; Messenger Post If Different To A Messenger Comment
; While I Got Messenger Comment Sorted
; I Don't Know The Detection For Messenger Post
; Oh Well
; Will Have To Go Back A Step And Have A Call-Up Routine 
; Which Is Hard To Use It Kick Into Place
; Unless A Hot-Key Is Done
; Quite Possible
; Yes Able To Get Around That With Work Of Shift-Enter Rather Than
;  Control Enter
; You Will Hear A Beep For The Enter Key In All Your Programs As Key Intercepted
; Not Just Isolated To GrinBook FB And Mysms With Little Extra Code 
; You Could Disable Beeper Unless In FB And Mysms
; Might Be Helpful To Remove The Beeper There As It Less Quicker 
; A Lot The Repeat Return Key Compared To Other Keys In Editing 
; Besides Mysms And Grin Book
; Yes That Was The Answer But You Can Also Change The Sound 
; Speeded Up
; Well I Finished That Off With User-Friendly Variable Setting Choice 
; -------------------------------------------------------------------
; This Type Of Code Is Not Clearly Laid Out For Beginner Novice 
; AutoHotKeys __ Professional Expert Programmer
; -------------------------------------------------------------------
; WORK TIME
; Sat 21-Apr-2018 01:33:27 BEGINNER 
; Sat 21-Apr-2018 04:00:00 TOTAL 2 HOUR 27 MINUTE
; Sat 21-Apr-2018 05:38:00 TOTAL 4 HOUR 05 MINUTE + PUBLISH TIME QUICKER
; -------------------------------------------------------------------

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

;# ------------------------------------------------------------------
;# ------------------------------------------------------------------

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

DetectHiddenWindows, on
SetStoreCapslockMode, off
Set_Key_FB_Control=False 
Dont_Send_2_Enter=False
Sound_Speed=20

;User Setting as Required
Mute_Beep_In_Other_Program_Beside_GrinBook_an_Mysms=true
Mute_Beep_In_Other_Program_Beside_GrinBook_an_Mysms=false

SoundBeep , 2000 , 200
SoundBeep , 2500 , 100

SetTimer TIMER_PREVIOUS_INSTANCE,4000
; Timer_Previous_Instance Is A New Code I Set Up To Detect If A 
; The Previous Instance Of The Script Is A Runner
; Some Slow Computer Require That As A Limitation Of AHK
; Especially When Launch All You AHK Script At Once At 
; Speed When Boot Computer And Then Again _ Seems To Do The 
; Job Working Well
SetTimer TIMER_TEST,off

return

TIMER_TEST:    
    WinGet, HWND, ID, A  ; Get Active Window
    WinGet, OutputVar, ControlList, ahk_id %HWND%
    Tooltip, % OutputVar ; List All Controls of Active Window
return

enter::
{
    Set_Key=False
    Set_Key_FB_Control=False
    Dont_Send_2_Enter=False
    SetTitleMatchMode 2  ; Avoid specify full path
    if (WinActive("Matthew Lancaster -") and WinActive("ahk_class Chrome_WidgetWin_1"))
    {
        SendInput {space} 
        ; Add a Space when Enter Pressed in FB page So It It Doesn't 
        ; Ask to Highlight any Fan Pages
        ;------------------------------------------------------------
        Sleep 100 
        ;------------------------------------------------------------
        ; MINIMAL SLEEP I COULD FIND TO NOT CLASH THE KEYS OVERLAPPING
        ; DEPEND ON YOUR PROCESSOR OR SOMETHING 100 MILLISECOND
        ;------------------------------------------------------------
        ; SetCapsLockState , Off
        ; FOUND NEW SYSTEM WITH    SetStoreCapslockMode, off
        ; THIS WILL PREVENT ERROR OF CAPS LOCK STATUS 
        ; SHOWER FROM LOGITECH
        ;------------------------------------------------------------
        ; THE LOGITECH REMOTE KEYBOARD HAS A FLASHER BOX ON ABOUT CAPS LOCK STATE LEAVE IT WITH CAPS LOCK OFF 
        ; AND THESE SendInput KEY DON'T GET IN THE WAY
        ;------------------------------------------------------------
        SendInput {shift down}{enter}{shift up}
        SoundBeep , 2500 , 100
        Set_Key=True
        Set_Key_FB_Control=True
    }
    if Set_Key=False 
    {
        Dont_Send_2_Enter=True
        SendInput {enter}
        Set_Go=True
        if (WinActive("Matthew Lancaster -") and WinActive("ahk_class Chrome_WidgetWin_1"))
            Set_Go=False
        if Mute_Beep_In_Other_Program_Beside_GrinBook_an_Mysms=False
            Set_Go=True
        if Set_Go=True
            SoundBeep , 2500 , Sound_Speed
    }
}

; CTRL enter unable to be swapped back to Enter so use SendInput
;--------------------------------------------------------------
^enter::
{
    Set_Key=False
    SetTitleMatchMode 1  ; Specify the full path
    if Set_Key_FB_Control=False 
    {
        if (WinActive("mysms") and WinActive("ahk_class Chrome_WidgetWin_1"))
        {
            if Dont_Send_2_Enter=False
            {
                SendInput {ENTER}
                SoundBeep , 2500 , 100
                Set_Key=True
            }
        }
        if Set_Key=False 
        {
            if Dont_Send_2_Enter=False
            {
                SendInput {ctrl down}{enter}{ctrl up}
                Set_Go=True
                if (WinActive("mysms") and WinActive("ahk_class Chrome_WidgetWin_1"))
                    Set_Go=False
                if Mute_Beep_In_Other_Program_Beside_GrinBook_an_Mysms=False
                    Set_Go=True
                if Set_Go=True
                SoundBeep , 2500 , Sound_Speed
            }
        }
    }
    Set_Key_FB_Control=False 
    Dont_Send_2_Enter=False
}
Return

+enter::
{
    Set_Key=False
    if Set_Key_FB_Control=False 
    {
        if (WinActive("mysms") and WinActive("ahk_class Chrome_WidgetWin_1"))
        {
            {
                SendInput {ENTER}
                ; SetCapsLockState , Off
                SoundBeep , 2500 , 100
                SET_KEY=True
            }
        }
        if Set_Key=False 
        {
            if Dont_Send_2_Enter=False
                {
                SendInput {shift down}{enter}{shift up}
                Set_Go=True
                if (WinActive("mysms") and WinActive("ahk_class Chrome_WidgetWin_1"))
                    Set_Go=False
                if Mute_Beep_In_Other_Program_Beside_GrinBook_an_Mysms=False
                    Set_Go=True
                if Set_Go=True
                SoundBeep , 2500 , Sound_Speed
            }
        }
        Set_Key_FB_Control=False 
        Dont_Send_2_Enter=False
    }
}
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