MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / ParentWndProc

Function ParentWndProc

Source/VideoRenderer.cpp:89–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89static LRESULT CALLBACK ParentWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
90{
91 auto pfnOldProc = (WNDPROC)GetPropW(hWnd, g_pszOldParentWndProc);
92 auto pThis = static_cast<CMpcVideoRenderer*>(GetPropW(hWnd, g_pszThis));
93
94 switch (Msg) {
95 case WM_DESTROY:
96 SetWindowLongPtrW(hWnd, GWLP_WNDPROC, (LONG_PTR)pfnOldProc);
97 RemovePropW(hWnd, g_pszOldParentWndProc);
98 RemovePropW(hWnd, g_pszThis);
99 break;
100 case WM_DISPLAYCHANGE:
101 DLog(L"ParentWndProc() - WM_DISPLAYCHANGE");
102 pThis->OnDisplayModeChange(true);
103 break;
104 case WM_MOVE:
105 if (pThis->m_bExclusiveScreen) {
106 // I don't know why, but without this, the filter freezes when switching from fullscreen to window in DX9 mode.
107 SetWindowLongPtrW(hWnd, GWLP_WNDPROC, (LONG_PTR)pfnOldProc);
108 SetWindowLongPtrW(hWnd, GWLP_WNDPROC, (LONG_PTR)ParentWndProc);
109 } else {
110 pThis->OnWindowMove();
111 }
112 break;
113 case WM_NCACTIVATE:
114 if (!wParam && pThis->m_bExclusiveScreen && !pThis->m_bIsD3DFullscreen) {
115 return 0;
116 }
117 break;
118 case WM_RBUTTONUP:
119 if (pThis->m_bExclusiveScreen) {
120 // block context menu in exclusive fullscreen
121 return 0;
122 }
123 break;
124/*
125 case WM_SYSCOMMAND:
126 if (pThis->m_bExclusiveScreen && wParam == SC_MINIMIZE) {
127 // block minimize in exclusive fullscreen
128 return 0;
129 }
130 break;
131*/
132 }
133
134 return CallWindowProcW(pfnOldProc, hWnd, Msg, wParam, lParam);
135}
136
137//
138// CMpcVideoRenderer

Callers

nothing calls this directly

Calls 3

DLogFunction · 0.85
OnDisplayModeChangeMethod · 0.80
OnWindowMoveMethod · 0.80

Tested by

no test coverage detected