I remember doing the "use PostMessage to send a WM_CHAR" trick as part of program I made to auto-draw in a FaceBook drawing app.
It would read a pixel value from a file, then "click" in the FaceBook app's color textfield, send 7 delete messages to remove the #000000 color, type in the new color value, then "click" at an X/Y position. It did it 10 times a second.
It worked great until I accidentally focused another app while it was running: and the 70 delete-messages-per-second got sent to Microsoft Outlook.
It took me a while to figure out what was going on as screenfuls of emails evaporated before my eyes.
in all my AutoHotKey scripts, so hitting F9 will cause the script to reload and thereby stop anything running. Also handy when doing edits and you want to reload to test.
It would read a pixel value from a file, then "click" in the FaceBook app's color textfield, send 7 delete messages to remove the #000000 color, type in the new color value, then "click" at an X/Y position. It did it 10 times a second.
It worked great until I accidentally focused another app while it was running: and the 70 delete-messages-per-second got sent to Microsoft Outlook.
It took me a while to figure out what was going on as screenfuls of emails evaporated before my eyes.