MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / WndProc

Function WndProc

KBotExt/KBotExt.cpp:237–270  ·  view source on GitHub ↗

Win32 message handler

Source from the content-addressed store, hash-verified

235
236// Win32 message handler
237LRESULT WINAPI WndProc(const HWND hWnd, const UINT msg, const WPARAM wParam, const LPARAM lParam)
238{
239 if (ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam))
240 return true;
241
242 switch (msg)
243 {
244 case WM_SIZE:
245 if (g_pd3dDevice != nullptr && wParam != SIZE_MINIMIZED)
246 {
247 Direct3D11Render::CleanupRenderTarget();
248 g_pSwapChain->ResizeBuffers(0, LOWORD(lParam), HIWORD(lParam), DXGI_FORMAT_UNKNOWN, 0);
249 Direct3D11Render::CreateRenderTarget();
250
251 RECT rect;
252 if (GetWindowRect(hWnd, &rect))
253 {
254 S.Window.height = rect.bottom - rect.top;
255 S.Window.width = rect.right - rect.left;
256 Config::Save();
257 }
258 }
259 return 0;
260 case WM_SYSCOMMAND:
261 if ((wParam & 0xfff0) == SC_KEYMENU) // Disable ALT application menu
262 return 0;
263 break;
264 case WM_DESTROY:
265 PostQuitMessage(0);
266 return 0;
267 default:;
268 }
269 return DefWindowProcW(hWnd, msg, wParam, lParam);
270}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected