mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 22:14:49 +01:00
update ShowWindow hook
This commit is contained in:
parent
0f37251d64
commit
19d1d4f942
1
inc/dd.h
1
inc/dd.h
@ -168,6 +168,7 @@ typedef struct CNCDDRAW
|
|||||||
int maxgameticks;
|
int maxgameticks;
|
||||||
BOOL alt_key_down;
|
BOOL alt_key_down;
|
||||||
BOOL releasealt;
|
BOOL releasealt;
|
||||||
|
BOOL invisible;
|
||||||
BOOL bnet_active;
|
BOOL bnet_active;
|
||||||
BOOL bnet_was_fullscreen;
|
BOOL bnet_was_fullscreen;
|
||||||
BOOL bnet_was_upscaled;
|
BOOL bnet_was_upscaled;
|
||||||
|
4
src/dd.c
4
src/dd.c
@ -766,6 +766,8 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
|||||||
LONG style = real_GetWindowLongA(g_ddraw->hwnd, GWL_STYLE);
|
LONG style = real_GetWindowLongA(g_ddraw->hwnd, GWL_STYLE);
|
||||||
LONG exstyle = real_GetWindowLongA(g_ddraw->hwnd, GWL_EXSTYLE);
|
LONG exstyle = real_GetWindowLongA(g_ddraw->hwnd, GWL_EXSTYLE);
|
||||||
|
|
||||||
|
g_ddraw->invisible = !(style & WS_VISIBLE);
|
||||||
|
|
||||||
AdjustWindowRectEx(&dst, style, GetMenu(g_ddraw->hwnd) != NULL, exstyle);
|
AdjustWindowRectEx(&dst, style, GetMenu(g_ddraw->hwnd) != NULL, exstyle);
|
||||||
|
|
||||||
real_SetWindowPos(
|
real_SetWindowPos(
|
||||||
@ -802,6 +804,8 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
|
|||||||
|
|
||||||
LONG style = real_GetWindowLongA(g_ddraw->hwnd, GWL_STYLE);
|
LONG style = real_GetWindowLongA(g_ddraw->hwnd, GWL_STYLE);
|
||||||
|
|
||||||
|
g_ddraw->invisible = !(style & WS_VISIBLE);
|
||||||
|
|
||||||
DWORD swp_flags = SWP_SHOWWINDOW;
|
DWORD swp_flags = SWP_SHOWWINDOW;
|
||||||
|
|
||||||
if ((style & WS_CAPTION))
|
if ((style & WS_CAPTION))
|
||||||
|
@ -504,6 +504,26 @@ BOOL WINAPI fake_ShowWindow(HWND hWnd, int nCmdShow)
|
|||||||
{
|
{
|
||||||
if (g_ddraw && g_ddraw->hwnd == hWnd)
|
if (g_ddraw && g_ddraw->hwnd == hWnd)
|
||||||
{
|
{
|
||||||
|
if (g_ddraw->invisible &&
|
||||||
|
(nCmdShow == SW_SHOWDEFAULT || nCmdShow == SW_SHOWNORMAL) &&
|
||||||
|
(g_hook_method != 2 && g_hook_method != 3))
|
||||||
|
{
|
||||||
|
g_ddraw->invisible = FALSE;
|
||||||
|
|
||||||
|
BOOL result = real_ShowWindow(hWnd, nCmdShow);
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
//real_SendMessageA(g_ddraw->hwnd, WM_SHOWWINDOW, 1, 0);
|
||||||
|
real_SendMessageA(g_ddraw->hwnd, WM_SIZE_DDRAW, 0, MAKELPARAM(g_ddraw->width, g_ddraw->height));
|
||||||
|
//real_SendMessageA(g_ddraw->hwnd, WM_MOVE_DDRAW, 0, MAKELPARAM(0, 0));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
if (nCmdShow == SW_SHOWMAXIMIZED)
|
if (nCmdShow == SW_SHOWMAXIMIZED)
|
||||||
nCmdShow = SW_SHOWNORMAL;
|
nCmdShow = SW_SHOWNORMAL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user