Jump to content
Sign in to follow this  

PixelSearch & C++ woes

Recommended Posts


Well, it's about time to cry for help I fear. I have been busy the last days trying out to the "DLLCall" function in AutoIt, using an old C++ Pixelsearch function I wrote some years ago.

Currently I'm into benchmarking and testing, but I get some annoying bugs here:

At the start of my C++ pixelsearch function I check the window state and if need be I wake it up from minimized state and/or invisibility by

if (!(::IsWindow(hWnd))) return "";
if ( ::IsIconic(hWnd) ) ShowWindow(hWnd,SW_SHOWNORMAL);
if (!(::SetWindowPos(hWnd,HWND_TOP,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW))) return "";

before I start copying the bits into memory and doing the search.

Here's the DLLCall:

for $i=1 to 100
    dim $result = DllCall("winUtils.dll","str","SearchPixel","hwnd",$hwnd,"int",0,"int",0,"int",$size[0],"int",$size[1],"int",0xc57907,"int",0)
    logEvent("@error=" & @error & " result=" & $result[0])
    if @error>0 or $result[0]="" Then ContinueLoop
    dim $resA = stringsplit($result[0],"|") 

All is well as long as the window is not minimized(=IsIconic).

If it is all searches will return "not found", my guess is the window is not repainted during the 100 iterations.

Anybody got an idea ? Thanks ....

Edited by Kangaroo

Share this post

Link to post
Share on other sites

I don't see what AutoIt has to do with it? If you make the same DLL call from VB or something else with the window minimized the DLL returns results?


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.