Mutliple monitor problem with FindImagePos

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
cvlr
Newbie
Posts: 17
Joined: Thu Jun 07, 2018 4:40 pm

Mutliple monitor problem with FindImagePos

Post by cvlr » Thu Sep 27, 2018 4:04 pm

We have discovered an issue where if the window we want to scan for a needle bitmap is not on the primary display but rather on say the right hand display then the image is not found. As long as the window is on the screen set to 'Make this my primary display' then it works fine. Here is some of the code with other material which is not relevant. The complete loop and code is not shown of course.

Label>StartLoop

Wait>1
FindImagePos>c:\reports\green man.bmp,WINDOW:Order Entry Full : A.T.S. PRODUCTION,0.9,1,X,Y,NumFound,CCOEFF
If>NumFound=1

GetWindowHandle>Order Entry Full : A.T.S. PRODUCTION,hWnd
FindObject>hWnd,TEdit,,1,hWnd,X1,Y1,X2,Y2,result
GetTextInRect>x1,y1,x2,y2,result
Trim>result
Let>sOrder=result

Let>kpSQL=Select SEQ_NBR,APT_L_DATE,Name,Abrv,Address1,City,State,Zip FROM PRD1.DELV Where Order_NBR = '%sOrder%'
DBQuery>dbh,kpSQL,OldDeliveries,Records,Fields,1

Let>NumFound=0
While>NumFound=0
FindImagePos>c:\reports\gray man.bmp,WINDOW:Order Entry Full : A.T.S. PRODUCTION,0.9,1,X,Y,NumFound,CCOEFF
Wait>1
EndWhile

Post Reply