Field CIUResult.possiblyWrongWindow
If true, most likely w is incorrect window, because the window that was there before capturing disappeared while capturing, for example it was a popup menu.
If captured from screen (without flags like WindowDC), w may be correct even if this is true (can't detect reliably), else certainly incorrect.
public bool possiblyWrongWindow