is SetWindowRgn blocking?

407 views Asked by At

I have an UI that can go to full screen. When going to full screen I'm calling the sequence below:

ShowWindow(hwnd, SW_HIDE);
SetWindowRgn(hwnd, NULL, TRUE);
SetWindowPos(hwnd, 0, left, top, right, bottom, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER)) ;
ShowWindow(hwnd, SW_SHOW);

I'm having a bug that the window first being displayed in the upper left corner with the previous size and only then goes to full screen size. I suspect that this may be becauseSetWindowRgn() call is async. and actually being executed after ShowWindow(). I know from documentation that all other calls are blocking, but, there is no comment about SetWindowRgn() whether it is blocking or not. How can I be sure about it? Thanks.

1

There are 1 answers

0
David Heffernan On

Is SetWindowRgn blocking?

Yes. This function, like all called in the code in the question, is synchronous.