1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

add resizeable bool

This commit is contained in:
FunkyFr3sh 2019-08-13 15:46:05 +02:00
parent f394d7f7ce
commit 43224a0f65
3 changed files with 24 additions and 1 deletions

View File

@ -128,6 +128,7 @@ typedef struct IDirectDrawImpl
BOOL altenter;
BOOL hidecursor;
BOOL accurateTimers;
BOOL resizable;
BOOL bnetActive;
BOOL bnetWasFullscreen;
SpeedLimiter ticksLimiter;

View File

@ -1016,10 +1016,31 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NCLBUTTONUP:
case WM_NCACTIVATE:
case WM_NCPAINT:
case WM_NCHITTEST:
{
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
case WM_NCHITTEST:
{
LRESULT result = DefWindowProc(hWnd, uMsg, wParam, lParam);
if (!ddraw->resizable)
{
switch (result)
{
case HTBOTTOM:
case HTBOTTOMLEFT:
case HTBOTTOMRIGHT:
case HTLEFT:
case HTRIGHT:
case HTTOP:
case HTTOPLEFT:
case HTTOPRIGHT:
return HTBORDER;
}
}
return result;
}
case WM_SETCURSOR:
{
// show resize cursor on window borders

View File

@ -42,6 +42,7 @@ void Settings_Load()
ddraw->noactivateapp = GetBool("noactivateapp", FALSE);
ddraw->vhack = GetBool("vhack", FALSE);
ddraw->accurateTimers = GetBool("accuratetimers", FALSE);
ddraw->resizable = GetBool("resizable", TRUE);
WindowRect.right = GetInt("width", 0);
WindowRect.bottom = GetInt("height", 0);