Main Windows UI message loop
| 486 | |
| 487 | // Main Windows UI message loop |
| 488 | void PipeServer::runGuiThread() { |
| 489 | // this method is called from an worker thread other than the main thread |
| 490 | // For libuv, it's only safe to use uv_aysnc_*() from within this thread. |
| 491 | |
| 492 | WNDCLASSEX wndClass; |
| 493 | auto wndClassAtom = registerWndClass(wndClass); |
| 494 | hwnd_ = ::CreateWindowEx(0, LPCTSTR(wndClassAtom), NULL, 0, 0, 0, 0, 0, HWND_DESKTOP, NULL, wndClass.hInstance, this); |
| 495 | |
| 496 | createShellNotifyIcon(); |
| 497 | |
| 498 | MSG msg; |
| 499 | while (::GetMessage(&msg, NULL, 0, 0)) { |
| 500 | ::TranslateMessage(&msg); |
| 501 | ::DispatchMessage(&msg); |
| 502 | } |
| 503 | |
| 504 | destroyShellNotifyIcon(); |
| 505 | |
| 506 | ::ExitProcess(0); |
| 507 | } |
| 508 | |
| 509 | |
| 510 | } // namespace PIME |