[Solved] Wait for message delivered to MainWindow sent using SendMessage API

Here is the sample code in C++,(Removed error checking) MainWindow.cpp: #include <windows.h> #include <iostream> LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } DWORD WINAPI createyourwindow(LPVOID param) { WNDCLASSEXW wcex = { 0 }; wcex.cbSize = … Read more