Jump to content

Controlling an inactive window?


Recommended Posts

I have a large job coming up that requires several hours of form editing. I've written a program with AutoIT that is capable of completing the task perfectly, although the method is undesired. The problem with the current method is that it just sends keypresses and controls the mouse, which requires that the window be fullscreen and active. Alas, I can't give up my computer for a day, as I still have other work.

Is it possible to send keypresses and mouse clicks to a window that is currently not visible? For example, say I wanted to browse the web while this is going on, is this possible? Additionally, is it possible to get the color of a pixel in a window that isn't visible? For example, is there any way to get say, the color of the pixel 40, 40 (relative to the window), while it isn't visible on screen?

Finally, how can I use relative positions with coordinates, and how can I find out how big the window is?

Link to comment
Share on other sites

ControlSend and ControlClick rely on Controls in order to send data. What do I do then, if the window I'm sending to is Direct3D, and therefore doesn't use any Windows Controls?

Also, that still doesn't answer my question about PixelGetColor or PixelSearch.

And how do I do relative positioning?

Link to comment
Share on other sites

There's an option (MouseCoordMode) to change the way coordinates are passed. I don't think you can get a pixel color if the window isn't visible because it isnt being drawn. Use a blank control to send your data to the minimized window. If you want to browse with no visible window there's an option in _IECreate() to set it to a hidden window. I don't see how form editing would require D3D so if you're making a game bot say so,you'll get more help that way.

Link to comment
Share on other sites

I'm doing both, actually. The first thing I'm working on is a bot, capable of grinding in several online games. Currently, it's capable of playing most MMORPGs on its own, but it still relies on fixed coordinates, and I don't like having it on screen if I'm doing nothing. Hence the reason why I'd like to be able to minimize the window and let it play on its own, and also be able to not have to line up a window each time I run the game.

As for the form editing, I'm being paid to add tons and tons of data to a site. Part of the problem with the bot is that occasionally, the site takes longer to load, or something goes wrong, so I have to watch over it to make sure it does it correctly. Hence the desire to either do invisible pixel searches, or to learn about controls, as the more accurate it is, the longer it takes.

I see that there's a way to use relative pixels, but how can I also get the window's size? Additionally, I looked at MouseCoordMode, but it looks like it's an option to set in the program. Is there any way to switch back and forth between absolute and relative?

Link to comment
Share on other sites

Change the option in a function. If you need a site to load use _IELoadWait() (duh) and if a window is minimized (full screen game) the area isn't drawn/redrawn so there's no real way to tell it to read a pixel that isn't there. WinGetPos() has the way to get the size. Seriously...rtfm! and search.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...