MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnMainWindowCreated

Function OnMainWindowCreated

Source/Engine/Platform/GDK/GDKPlatform.cpp:138–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void OnMainWindowCreated(HWND hWnd)
139{
140 // Register for app suspending/resuming events
141 PlmSuspendComplete = CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE);
142 PlmSignalResume = CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE);
143 if (!PlmSuspendComplete || !PlmSignalResume)
144 return;
145 if (RegisterAppStateChangeNotification([](BOOLEAN quiesced, PVOID context)
146 {
147 if (quiesced)
148 {
149 ResetEvent(PlmSuspendComplete);
150 ResetEvent(PlmSignalResume);
151
152 // To ensure we use the main UI thread to process the notification, we self-post a message
153 PostMessage(reinterpret_cast<HWND>(context), WM_USER, 0, 0);
154
155 // To defer suspend, you must wait to exit this callback
156 WaitForSingleObject(PlmSuspendComplete, INFINITE);
157 }
158 else
159 {
160 SetEvent(PlmSignalResume);
161 }
162 }, hWnd, &Plm))
163 return;
164}
165
166void CALLBACK AddUserComplete(_In_ XAsyncBlock* ab)
167{

Callers 1

GDKWindowMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected