The video device is opened in first frame, and before that hWnd is not valid (I think).