Hello,

I have been working on this issue for days and for the life of me I cannot
figure it out.

I have this simple code to look for specific window titles:

  Dim WindowList(-1) as Dictionary = CGWindowMBS.GetWindowListInfo(16,0)
  Dim WindowName as string

  for each d as Dictionary in WindowList
    WindowName = d.Lookup(CGWindowMBS.kCGWindowName, "")
    If instr(1,WindowName,"Play") > 0 then MsgBox "I found the window"
  next

The above code works just fine and I find the windows without any problems
and its 100% accurate. The problem arises is when I add the above code to
my main program in a thread as it fails to find the window with a 100%
failure rate.

What my program is doing is clicking a button on a window then it waits
for 5 seconds (In essence waiting for a new window to appear with a thread
sleep timer) then the above code is run looking for the new window.

Why would putting this code in a thread affect the results? Any help would
be appreciated.

Thanks


_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to