void daemon_backend::loop() { while(!m_stop_singal_sent) { update_state_info(); update_wallets(); std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } }
BOOL CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_CREATE: { #ifdef _WIN32_WCE SHMENUBARINFO mbi; memset(&mbi, 0, sizeof(SHMENUBARINFO)); mbi.cbSize = sizeof(SHMENUBARINFO); mbi.hwndParent = hwnd; mbi.hInstRes = g_hinst; mbi.nBmpId = 0; mbi.cBmpImages = 0; mbi.nToolBarId = IDM_MAIN_MENU; SHCreateMenuBar(&mbi); g_hwnd_menu = mbi.hwndMB; #else g_hwnd_menu = NULL; #endif g_hwnd_status = CreateWindow(TEXT("STATIC"), TEXT("Status"), WS_CHILD|WS_VISIBLE|SS_LEFT, 0, 0, disp_w, caption_h, hwnd, NULL, g_hinst, NULL); do_layout(1); } break; case WM_COMMAND: if (HandleCommand(hwnd, wParam, lParam)) return DefWindowProc(hwnd, msg, wParam, lParam); break; case WM_TIMER: if (wParam==STATE_TIMER_ID) update_state_info(); #ifdef TERM_NOT_THREADED else gf_term_process_step(term); #endif break; case WM_HOTKEY: break; case WM_KEYDOWN: if (playlist_navigation_on && !navigation_on) { if (wParam==VK_LEFT) { switch_playlist(1); break; } else if (wParam==VK_RIGHT) { switch_playlist(0); break; } } /*fall through*/ case WM_SYSKEYDOWN: case WM_SYSKEYUP: case WM_KEYUP: case WM_CHAR: case WM_MOUSEMOVE: case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: case WM_LBUTTONUP: ::SendMessage(g_hwnd_disp, msg, wParam, lParam); return 0; case WM_INITMENUPOPUP: OnMenuPopup(hwnd, wParam); break; case WM_CLOSE: DestroyWindow(hwnd); break; case WM_SETFOCUS: gf_freeze_display(0); break; case WM_KILLFOCUS: if ((HWND) wParam==g_hwnd) { gf_freeze_display(1); } break; case WM_ACTIVATE: if (WA_INACTIVE != LOWORD(wParam)) { if ((HWND) lParam == g_hwnd) { gf_freeze_display(0); SetFocus(hwnd); } } else { if ((HWND) lParam == g_hwnd_disp) { gf_freeze_display(1); } } break; case WM_LOADTERM: if (!LoadTerminal()) { MessageBox(hwnd, _T("Cannot load GPAC"), _T("Error"), MB_OK); PostQuitMessage(0); } break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; }