Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
WaitSupport.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Execution_Platform_Windows_WaitSupport_h_
5#define _Stroika_Foundation_Execution_Platform_Windows_WaitSupport_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include <vector>
10
11#if qStroika_Foundation_Common_Platform_Windows
12#include <Windows.h>
13#else
14#error "WINDOWS REQUIRED FOR THIS MODULE"
15#endif
16
17#include "Stroika/Foundation/Common/Common.h"
18
20
21 DWORD Duration2Milliseconds (Time::DurationSeconds nSeconds);
22
23 /**
24 * Pump messages and wait the specified amount of time. No exceptions for timeout.
25 */
26 void WaitAndPumpMessages (HWND dialog = nullptr, Time::DurationSeconds forNSecs = 0.1s);
27
28 /**
29 * Pump messages and wait the specified amount of time. No exceptions for timeout. Return if timeout or if handle signaled.
30 */
31 void WaitAndPumpMessages (HWND dialog, const vector<HANDLE>& waitOn, Time::DurationSeconds forNSecs = 0.1s);
32
33 void PumpMessagesWhileInputAvailable (HWND dialog = nullptr, Time::DurationSeconds atMostNSecs = 0.1s);
34
35}
36
37/*
38 ********************************************************************************
39 ***************************** Implementation Details ***************************
40 ********************************************************************************
41 */
42#include "WaitSupport.inl"
43
44#endif /*_Stroika_Foundation_Execution_Platform_Windows_WaitSupport_h_*/
void WaitAndPumpMessages(HWND dialog=nullptr, Time::DurationSeconds forNSecs=0.1s)