Emulating mouse clicks etc

A few years ago I wrote a program in RealBasic and found a few things I couldn’t do, or couldn’t work out how to do within the program. One was to take a picture of a pixel or a rectangle of pixels in a non-program window (eg a browser window or the window of another program). Another was to set the precise width and height of the “foreign” window and its position on the screen and the third was to emulate a mouse click at a specific point x,y on this window. The idea was to respond automatically to expected messages in these windows by comparing the pixel or pixels with items on file and then clicking on the right button.

I managed a workaround eventually, using a plugin to resize and position the window and a couple of routines from the Monkeybread software RealBasic plugin.

Can I now do any or all of these things in Xojo now?

I’m reluctant to upgrade MBS as well as RealBasic, not because there’s anything wrong with it, but because it’s just become so huge that I can barely find my way around its thousands of pages of documentation. Sledgehammer and nut really. Ideally I’d do it in Xojo or use a smaller simpler plugin if there is one. Thanks if anyone can help.

If this is for Windows, all of this can be don with simple API declares. I’ll post a link to some examples when I get home.

It is for Windows. The RealBasic prog was written on a Mac and compiled for a PC but this time I’m planning to write the prog on a PC and compile it there. It needn’t work on a Mac. I’m not very familiar with Windows and don’t know about API declares soI’ll be interested to see your link.