1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

show resize cursor on window borders

This commit is contained in:
FunkyFr3sh 2018-12-01 01:16:24 +01:00
parent ab7a3d5108
commit cf163c920a

View File

@ -16,6 +16,7 @@
#include <windows.h> #include <windows.h>
#include <windowsx.h> #include <windowsx.h>
#include <winuser.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <d3d9.h> #include <d3d9.h>
@ -887,6 +888,40 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
// return DefWindowProc to prevent glitched window frame (dune 2000) // return DefWindowProc to prevent glitched window frame (dune 2000)
return DefWindowProc(hWnd, uMsg, wParam, lParam); return DefWindowProc(hWnd, uMsg, wParam, lParam);
} }
case WM_SETCURSOR:
{
// show resize cursor on window borders
if ((HWND)wParam == ddraw->hWnd)
{
WORD message = HIWORD(lParam);
if (message == WM_MOUSEMOVE)
{
WORD htcode = LOWORD(lParam);
switch (htcode)
{
case HTCAPTION:
case HTMINBUTTON:
case HTMAXBUTTON:
case HTCLOSE:
case HTBOTTOM:
case HTBOTTOMLEFT:
case HTBOTTOMRIGHT:
case HTLEFT:
case HTRIGHT:
case HTTOP:
case HTTOPLEFT:
case HTTOPRIGHT:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
default:
break;
}
}
}
break;
}
case WM_D3D9DEVICELOST: case WM_D3D9DEVICELOST:
{ {
if (Direct3D9Active && Direct3D9_OnDeviceLost()) if (Direct3D9Active && Direct3D9_OnDeviceLost())