maqleod Posted August 29, 2011 Posted August 29, 2011 (edited) What I want to do is detect a stream of letters and replace with a different string of letters. Something like this, but this detects the f and starts going, also pulling the f from the sent key and continually repeating forever: #include <Process.au3> HotKeySet("forumsX", "LinkForums") ;listens for forumsX to be typed While 1 ;loop indefinitely Sleep(100) ;keeps from maxing out processor WEnd Func LinkForums() Dim $pid If WinExists("Gmail", "") Then ;check if a window relating to Gmail is open $pid = WinGetProcess("Gmail", "") ;check that window is actually open in a browser (therefore negating notepad, wordpad, etc) If _ProcessGetName($pid) = "firefox.exe" Then ;verify browser is firefox Send("<a href='www.myforums.com'>My Forums</a>") ;replacement text goes here EndIf EndIf EndFunc Is the only way to do this to have a sequence of _IsPressed() functions in a large set of nested If statements? or is there a cleaner way using Hotkey set or IsPressed, or even something else? Edited August 29, 2011 by maqleod [u]You can download my projects at:[/u] Pulsar Software
smashly Posted August 29, 2011 Posted August 29, 2011 Hi,Have a look at the example in AutoIt help file -> User Defined Functions Reference -> WinAPI Management ->_WinAPI_SetWindowsHookEx.That should give you all the help you'll need to accomplish what your after. Cheers
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now