On Mon, 5 Feb 2001, Marcus Meissner wrote:
PostMessageA(hwnd1,EM_GETSEL,&startsel,&endsel);
Eek.
My suspicion is that SetFocus() in Windows drains all posted messages by doing something like: while (PeekMessage()) { TranslateMessage(); DispatchMessage(); } but I do not really know.
From something (admittedly tangential/irrelevant to this problem) I
remember Ulrich have been talking about (http://www.winehq.com/News/1999-48.html#2, last paragraph), there's also the possibility that Windows recognizes that it's a message known to contain pointers, and so just drops the message, so that EM_GETSEL is simply never dispatched?
Or maybe the edit control uses IsBadWritePtr or exception handlers (though that would be even worse, race conditions...).
At least message loops in SetFocus really doesn't seem right.