mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 09:01:46 +00:00
Clarify WNDPROC window pointer handling
This commit is contained in:
parent
12903ee9b5
commit
1bf33a7402
@ -255,16 +255,19 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
WPARAM wParam, LPARAM lParam)
|
WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
_GLFWwindow* window = (_GLFWwindow*) GetWindowLongPtrW(hWnd, 0);
|
_GLFWwindow* window = (_GLFWwindow*) GetWindowLongPtrW(hWnd, 0);
|
||||||
|
if (!window)
|
||||||
switch (uMsg)
|
|
||||||
{
|
{
|
||||||
case WM_NCCREATE:
|
if (uMsg == WM_NCCREATE)
|
||||||
{
|
{
|
||||||
CREATESTRUCTW* cs = (CREATESTRUCTW*) lParam;
|
CREATESTRUCTW* cs = (CREATESTRUCTW*) lParam;
|
||||||
SetWindowLongPtrW(hWnd, 0, (LONG_PTR) cs->lpCreateParams);
|
SetWindowLongPtrW(hWnd, 0, (LONG_PTR) cs->lpCreateParams);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (uMsg)
|
||||||
|
{
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
{
|
{
|
||||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||||
@ -529,9 +532,6 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
int xoff, yoff;
|
int xoff, yoff;
|
||||||
MINMAXINFO* mmi = (MINMAXINFO*) lParam;
|
MINMAXINFO* mmi = (MINMAXINFO*) lParam;
|
||||||
|
|
||||||
if (!window)
|
|
||||||
break;
|
|
||||||
|
|
||||||
getFullWindowSize(getWindowStyle(window), getWindowExStyle(window),
|
getFullWindowSize(getWindowStyle(window), getWindowExStyle(window),
|
||||||
0, 0, &xoff, &yoff);
|
0, 0, &xoff, &yoff);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user