Hi Folks,
While a GDI GetPixel(x,y) is fast enough to test pixels of GDI applications, it certainly bogs down to a crawl any time your target is DirectX. I've been reading through the DirectX SDK docs looking for any clue as to whether one application can sample the screen output of another application. So far, I'm not seeing anything that looks promising.
I'd appreciate any clues to point me in the right direction, or a simple declaration of, "Sorry, but DirectX is ecapsulated to only be aware of, and able to interact with, its own application/surface context."
However, I'm guessing I just don't know where to look.
Specifics, in case you want to know: What I'm shooting for is an application that samples pixels from a different application (old MMO game client) and make simple decisions as a result of that data. Really, I'm just trying to see if I can make a little program that automatically heals people if their life gets too low. It's that simple. The game app can be either windowed or full screen.
I've already experimented with AutoIt (a multi-use scripting environment that will make compiled exes) but ran up against the fact that its GetPixelColor function (which does a GetDC followed by a GetPixel under the hood) has a 50 to 100 millisecond latency for that one call. I used an algorithm that converges in six calls to read a life bar, but that's still 300ms to read one life bar, where a group can consist of up to eight life bars! Obviously the time to resolve the values is going to be a problem.
My next experiment will be to write my own mini-app to test using GDI GetPixel where every call doesn't have to include a GetDC call. If that offers reasonable call latencies I'll probably work with it, but I'd love to use this as a springboard to start using DirectX if there's a solution that works.
While a GDI GetPixel(x,y) is fast enough to test pixels of GDI applications, it certainly bogs down to a crawl any time your target is DirectX. I've been reading through the DirectX SDK docs looking for any clue as to whether one application can sample the screen output of another application. So far, I'm not seeing anything that looks promising.
I'd appreciate any clues to point me in the right direction, or a simple declaration of, "Sorry, but DirectX is ecapsulated to only be aware of, and able to interact with, its own application/surface context."
However, I'm guessing I just don't know where to look.
Specifics, in case you want to know: What I'm shooting for is an application that samples pixels from a different application (old MMO game client) and make simple decisions as a result of that data. Really, I'm just trying to see if I can make a little program that automatically heals people if their life gets too low. It's that simple. The game app can be either windowed or full screen.
I've already experimented with AutoIt (a multi-use scripting environment that will make compiled exes) but ran up against the fact that its GetPixelColor function (which does a GetDC followed by a GetPixel under the hood) has a 50 to 100 millisecond latency for that one call. I used an algorithm that converges in six calls to read a life bar, but that's still 300ms to read one life bar, where a group can consist of up to eight life bars! Obviously the time to resolve the values is going to be a problem.
My next experiment will be to write my own mini-app to test using GDI GetPixel where every call doesn't have to include a GetDC call. If that offers reasonable call latencies I'll probably work with it, but I'd love to use this as a springboard to start using DirectX if there's a solution that works.