public static void Run() { MSG msg; while (true) { if (PeekMessage(out msg, IntPtr.Zero, 0, 0, PM_REMOVE)) { if (msg.Message == WM_QUIT) break; TranslateMessage(ref msg); DispatchMessage(ref msg); } } } [StructLayout(LayoutKind.Sequential)]
public void EventLoopRuns() { var i = 0; EventLoop.Run(() => { i++; }); Assert.Equal(1, i); }