Skip to content

Commit

Permalink
fixed game not fully exiting on vista or windows 7 (and minor related…
Browse files Browse the repository at this point in the history
… fixes)
  • Loading branch information
[email protected] committed Nov 13, 2011
1 parent 10a0085 commit 31af4e4
Show file tree
Hide file tree
Showing 5 changed files with 264 additions and 168 deletions.
2 changes: 1 addition & 1 deletion src/wintasee/hooks/gdihooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ HOOKFUNC int WINAPI MyGetDeviceCaps(HDC hdc, int index)

static int CALLBACK DoesFontExistWCallback(CONST LOGFONTW * lplf, CONST TEXTMETRICW * tm, DWORD type, LPARAM param)
{
debugprintf(__FUNCTION__": %S,%d,%d\n", lplf->lfFaceName, lplf->lfCharSet, type);
//debugprintf(__FUNCTION__": %S,%d,%d\n", lplf->lfFaceName, lplf->lfCharSet, type);
*((DWORD*)param) = 1;
return 0;
}
Expand Down
15 changes: 14 additions & 1 deletion src/wintasee/hooks/messagehooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,9 @@ static MessageActionFlags GetMessageActionFlags(UINT message, WPARAM wParam, LPA
case WM_SETCURSOR:
case WM_NOTIFY:
case WM_SHOWWINDOW:
case WM_SYSCOMMAND:
break;//return MAF_INTERCEPT | MAF_RETURN_0; // maybe ok to ditch?
case WM_SYSCOMMAND:
return MAF_BYPASSGAME | MAF_RETURN_CUSTOM;
case WM_COMMAND:
if(VerifyIsTrustedCaller(!tls.callerisuntrusted))
return MAF_PASSTHROUGH | MAF_RETURN_OS; // hack to fix F2 command in Eternal Daughter
Expand Down Expand Up @@ -577,6 +578,18 @@ LRESULT CustomHandleWndProcMessage(HWND hWnd, UINT message, WPARAM wParam, LPARA
return 1;
}
break;

case WM_SYSCOMMAND:
if((wParam & SC_CLOSE) == SC_CLOSE)
{
if(hWnd == gamehwnd)
{
// user clicked on the game winddow's close (X) button.
// they probably expect that to stop the game, so let's ask the debugger to kill us.
cmdprintf("KILLME: 0");
}
}
break;
}

// TODO: re-implement some of these?
Expand Down
8 changes: 5 additions & 3 deletions src/wintaser/inputsetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ extern int aviMode;
extern int emuMode;
extern int fastForwardFlags;
extern int timescale, timescaleDivisor;
extern int allowLoadInstalledDlls, allowLoadUxtheme;
extern int allowLoadInstalledDlls, allowLoadUxtheme, runDllLast;
extern int advancePastNonVideoFrames;
extern bool advancePastNonVideoFramesConfigured;
extern int threadMode;
Expand Down Expand Up @@ -2435,8 +2435,10 @@ void Build_Main_Menu(HMENU& MainMenu, HWND hWnd)

// Dll Loading Submenu
i = 0;
MENU_L(ExecDlls, i++, Flags | ((allowLoadInstalledDlls)?MF_CHECKED:MF_UNCHECKED), ID_EXEC_DLLS_INSTALLED, "", "Allow loading any custom/installed DLLs", 0);
MENU_L(ExecDlls, i++, Flags | ((allowLoadUxtheme)?MF_CHECKED:MF_UNCHECKED), ID_EXEC_DLLS_UXTHEME, "", "Allow loading uxtheme.dll (for non-classic window styles)", 0);
MENU_L(ExecDlls, i++, Flags | ((allowLoadInstalledDlls)?MF_CHECKED:MF_UNCHECKED), ID_EXEC_DLLS_INSTALLED, "", "Allow loading any custom/installed DLLs (e.g. Fraps) (can affect sync)", 0);
MENU_L(ExecDlls, i++, Flags | ((allowLoadUxtheme)?MF_CHECKED:MF_UNCHECKED), ID_EXEC_DLLS_UXTHEME, "", "Allow loading uxtheme.dll (for non-classic window styles on XP)", 0);
InsertMenu(ExecDlls, i++, MF_SEPARATOR, NULL, NULL);
MENU_L(ExecDlls, i++, Flags | ((runDllLast)?MF_CHECKED:MF_UNCHECKED), ID_EXEC_DLLS_RUNLAST, "", "Allow other DLLs to run first (this is a hack currently required for RotateGear)", 0);

// Locale Submenu
i = 0;
Expand Down
1 change: 1 addition & 0 deletions src/wintaser/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@
#define ID_EXEC_WAITSYNC_ASYNC 40397
#define ID_EXEC_DLLS_INSTALLED 40400
#define ID_EXEC_DLLS_UXTHEME 40401
#define ID_EXEC_DLLS_RUNLAST 40402
#define ID_EXEC_LOCALE_SYSTEM 40410
#define ID_EXEC_LOCALE_ENGLISH 40411
#define ID_EXEC_LOCALE_JAPANESE 40412
Expand Down
Loading

0 comments on commit 31af4e4

Please sign in to comment.