Rich4rd

ActiveApps Variable (Thanks to Daniel Oxner for providing the Global Variable)

Nov 7th, 2021 (edited)
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ActiveApps Variable (Thanks especially to Daniel Oxner for providing his version for one Global Variable for this script)
  2. +RButton:: ;Shift+Right Button
  3.   ; Sleep, 200
  4.   ;SetTimer, AutoCloseGui, 8000
  5.   R_Gui()
  6.   return
  7.  
  8. SetTitleMatchMode, 2
  9.  
  10. ; Variables
  11. Global ActiveApps := Object() ; ActiveApps Variable per Process
  12.   ActiveApps["ahk_class TMainForm"]
  13.   ActiveApps["ahk_class #32770"]
  14.   ActiveApps["ahk_exe notepad.exe"]
  15.   ActiveApps["ahk_exe text.exe"]
  16.   ActiveApps["ahk_exe WINWORD.EXE"]
  17.   ActiveApps["ahk_exe EXCEL.EXE"]
  18.  
  19. ; Routines
  20. R_Gui()
  21. { Gui, +AlwaysOnTop +LastFound -Caption +ToolWindow ; +Resize
  22.   Gui, Color, D3DAED ; light gray
  23.   WinSet,Transcolor, D3DAED ; light gray To Transparent Color
  24.   Gui, Margin,0,0
  25.   Gui, Font, S12 Bold Bold, Tahoma
  26.   Gui, Add, Text, x13 y10 cGreen gcalc, 2x2=4
  27.   Gui, Font, , Arial
  28.   Gui, Add, Text, x13 y30 cRed gcmd, CMD
  29.   Gui, Font, S25, Tahoma
  30.   Gui, Add, Text, x13 y60 cDarkRed gSM, Paste Secret Message
  31.   Gui, Add, Text, x13 y100 cGreen gHello, Paste Hello
  32.   Gui, Show, x900 y200 AutoSize
  33. }
  34. return
  35.  
  36. ; Gui-Buttons / GoSubs
  37. calc:
  38.  run, calc.exe
  39.   return
  40.  
  41. CMD:
  42.  run, cmd.exe, %A_Desktop%
  43.   return
  44.  
  45. SM:
  46.  gui, destroy
  47.     SendInput, {Text}Secret Message`r
  48.       R_Gui()
  49.   return
  50.  
  51. Hello:
  52.  gui, destroy
  53.     SendInput, {Text}Hello. What's going on?
  54.       R_Gui()
  55.   return
  56.  
  57.  
  58. *ESC::ExitApp
  59.  
Add Comment
Please, Sign In to add comment