hcenc: fix window handle find timeout