It was done in the GetMessage call.
The heart of a windows application is something like:
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
Each iteration gets a message and dispatches it. If there isn't a message available, it blocks until a message is available. Under 16-bit windowsWindows, the cpuCPU was yielded while waiting for a new message.
Some other calls like Yield or SendMessage would work the same way. But GetMessage was the one that most GUI applications would have primarily used.