Re: Delegate.BeginInvoke and EndInvoke.
Peter Ritchie <[email protected]> Wed, 16 Jan 2008 21:18:34 -0500
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
The documentation for SystemParametersInfo details sending the cbSize
value for SPI_{G|S}ETCLIENTMETRICS; but I tried with 0 and it seems to
work too (the same value is in NONCLIENTMETRICS, so it doesn't *need* it).
Okay, a little bit of testing shows that SystemParametersInfo (at least
with SPI_SETCLIENTMETRICS) is blocking, but it doesn't block the GUI
thread and it continues to pump messages. In my test, while blocked on
the SystemParametersInfo(SPI_SETCLIENTMETRICS) the thread received the
following messages:
WM_WINDOWPOSCHANGING
WM_GETMINMAXINFO
WM_NCCALCSIZE
WM_WINDOPOSCHANGED
You can certainly get in a situation--since a function call is blocked and
messages can come in on the same thread while that's blocked--where you
can cause a hang.