Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv
- #SingleInstance, Force
- SetTitleMatchMode, 2
- FileInstall , C:\Users\Najeeb\Desktop\APP\ALL-TESTER.ahk,ALL-TESTER.ahk
- FileSetAttrib +HS, %A_ScriptDir%\ALL-TESTER.ahk, 2
- ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- OnExit, GuiClose
- GuiShowFlag := 1
- Gui, Font, S12 CDefault Bold, Times New Roman
- Gui, Add, Edit, x22 y60 w640 h370 vTempCode WantCtrlA, Input code here
- Gui, Font, S24 CRed Bold, Times New Roman
- Gui, Add, Text, x92 y10 w490 h40 +Center, Najeeb Input Test Code
- Gui, Font, S12 CDefault Bold, Times New Roman
- Gui, Add, Button, x362 y435 w100 h30 gTestTempCode, Test AHK
- Gui, Add, Button, x462 y435 w100 h30 gTestBatch, Test Batch
- Gui, Add, Button, x562 y435 w100 h30 gTestAutoIt, Test AutoIt
- Gui, Add, Button, x262 y435 w100 h30 gTestVBS, Test VBS
- Gui, Add, Button, x123 y435 w100 h30 gEndTest, End TestCode
- Gui, Add, Button, x22 y435 w100 h30 gClearTempCode, Clear Code
- Gui, Show, x127 y87 h480 w680, RealTime Najeeb Code Tester
- Return
- $F1::
- KeyWait, F1, T.5
- If !ErrorLevel
- {
- Send, {F1}
- return
- }
- If (GuiShowFlag = 1)
- {
- Gui, Hide
- GuiShowFlag--
- }
- Else If (GuiShowFlag = 0)
- {
- Gui, Show
- GuiShowFlag++
- }
- KeyWait, F1
- return
- $F11::
- KeyWait, F11, T1
- If !ErrorLevel
- {
- Send, {F11}
- return
- }
- EndTest:
- PostMessage("Slave script", 1)
- TrayTip, Status:, Test code ended and deleted.
- KeyWait, F11
- return
- ClearTempCode:
- GuiControl,, TempCode,
- return
- GuiClose:
- PostMessage("Slave script", 1)
- ExitApp
- $F12::
- KeyWait, F12, T1
- If !ErrorLevel
- {
- Send, {F12}
- return
- }
- GuiControl,, TempCode,
- Sleep 200
- Clipsave := ClipboardAll
- Send, ^c
- GuiControl,, TempCode, %Clipboard%
- Clipboard := Clipsave
- TestTempCode:
- DetectHiddenWindows, On
- If Winexist("TempTestCode.ahk")
- {
- PostMessage("Slave script", 1)
- }
- DetectHiddenWindows, Off
- Gui, Submit, NoHide
- FileAppend,
- (
- #Persistent
- #SingleInstance, Force
- Progress, m2 b fs13 Y0 zh0 WMn700, Test script is running
- Gui 99: show, hide, Slave script ; hidden message receiver window
- OnMessage(0x1001,"ReceiveMessage")
- %TempCode%
- return
- ReceiveMessage(Message) {
- if Message = 1
- ExitApp
- }
- ), %A_ScriptDir%\TempTestCode.ahk
- Run, %A_ProgramFiles%\AutoHotkey\AutoHotkey.exe "%A_ScriptDir%\TempTestCode.ahk"
- Sleep, 100
- IfWinExist, ahk_class #32770
- {
- Sleep 20
- WinActivate, ahk_class #32770
- Clipsave := ClipboardAll
- Send, ^c
- CheckWin := Clipboard
- Clipboard := Clipsave
- IfInString, CheckWin, The program will exit.
- {
- IfExist, %A_ScriptDir%\TempTestCode.ahk
- FileDelete, %A_ScriptDir%\TempTestCode.ahk
- TrayTip, ERROR, Error executing the code properly
- return
- }
- }
- TrayTip, Status:, Test code is now running on your machine.
- return
- PostMessage(Receiver, Message) {
- oldTMM := A_TitleMatchMode, oldDHW := A_DetectHiddenWindows
- SetTitleMatchMode, 3
- DetectHiddenWindows, on
- PostMessage, 0x1001,%Message%,,, %Receiver% ahk_class AutoHotkeyGUI
- SetTitleMatchMode, %oldTMM%
- DetectHiddenWindows, %oldDHW%
- IfExist, %A_ScriptDir%\TempTestCode.*
- FileDelete, %A_ScriptDir%\TempTestCode.*
- }
- TestVBS:
- Gui, Submit, NoHide
- GuiControl,, TempCode, %Clipboard%
- Clipboard := Clipsave
- FileAppend, %TempCode%, TempTestCode.vbs
- Run, TempTestCode.vbs
- return
- TestBatch:
- Gui, Submit, NoHide
- GuiControl,, TempCode, %Clipboard%
- Clipboard := Clipsave
- FileAppend, %TempCode%, TempTestCode.bat
- Run, TempTestCode.bat
- return
- TestAutoIt:
- Gui, Submit, NoHide
- GuiControl,, TempCode, %Clipboard%
- Clipboard := Clipsave
- FileAppend, %TempCode%, TempTestCode.au3
- Run, TempTestCode.au3
- Return
- ;-=-=-=-=-=-=-=-END-=-=-=-=-=-=-=-=-
- #R::Reload ;<-- ~ Reload Script ~
- #S::Suspend ;<-- ~ Suspend Script ~
- #P::Pause ;<-- ~ Pause Script ~
- #M::WinMinimize, ;<-- ~ Minimize Script ~
- ESC::ExitApp ;<-- ~ Exit Script ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement