This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <cstdint> | |
template <typename WindowT, typename CtorArgs> | |
inline LRESULT CALLBACK window_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { | |
if (message == WM_CREATE) { | |
::OutputDebugStringW(L"WM_CREATE\n"); | |
auto cp = reinterpret_cast<LPCREATESTRUCTW>(lParam); | |
void * create_params = cp->lpCreateParams; | |
auto * args_tuple = reinterpret_cast<CtorArgs *>(cp->lpCreateParams); /// last parameter passed to ::CreateWindow() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <cstdint> | |
inline LRESULT CALLBACK main_window_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { | |
if (message == WM_CREATE) { | |
::OutputDebugStringW(L"WM_CREATE\n"); | |
} | |
if (message == WM_PAINT) { | |
::OutputDebugStringW(L"WM_PAINT\n"); |