diff --git a/Include/dxwnd.h b/Include/dxwnd.h index d97d604..96310b8 100644 --- a/Include/dxwnd.h +++ b/Include/dxwnd.h @@ -192,6 +192,7 @@ #define FIXPITCH 0x00000100 // Fixes surface filling made with no concern to actual pitch value #define POWER2WIDTH 0x00000200 // Fixes ..... #define HIDETASKBAR 0x00000400 // Hides taskbar & start menu during game execution +#define ACTIVATEAPP 0x00000800 // sends WM_ACTIVATEAPP message after every WM_WINPOSCHANGED message // logging Tflags DWORD: #define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general diff --git a/build/dxwnd.dll b/build/dxwnd.dll index 9fa17b7..8208155 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:427b51e427648a3f526882f2ed47eb400830ad367e5484f9fce47a94aab837b9 -size 578048 +oid sha256:84e59408df785c15d6c06b28a9c1af651f16cfc666ceedb196b4d960aa0e4e00 +size 578560 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index 30a5850..6ec8511 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e15db53d932535d67b361f33febb9c9a52b3c5d3c0552f1b4f857fa0f4ac868c -size 541184 +oid sha256:5de557160daabc9b2605f05b2c0988c129df7a8a03f8505db3a9c60269e9ee92 +size 541696 diff --git a/build/exports/Affari Tuoi.dxw b/build/exports/Affari Tuoi.dxw index 0546937..c940be3 100644 --- a/build/exports/Affari Tuoi.dxw +++ b/build/exports/Affari Tuoi.dxw @@ -8,7 +8,7 @@ coord0=0 flag0=536870914 flagg0=1207959568 flagh0=16 -flagi0=4 +flagi0=71303172 tflag0=0 initx0=0 inity0=0 @@ -24,3 +24,8 @@ maxfps0=0 initts0=0 winver0=0 maxres0=4 +launchpath0= +notes0= +flagj0=0 +flagk0=0 +swapeffect0=0 diff --git a/build/exports/Championship Manager 03 04.dxw b/build/exports/Championship Manager 03 04.dxw index 42f8729..54ada7f 100644 --- a/build/exports/Championship Manager 03 04.dxw +++ b/build/exports/Championship Manager 03 04.dxw @@ -7,13 +7,13 @@ opengllib0= notes0= ver0=0 coord0=0 -flag0=673194018 +flag0=681582627 flagg0=1744830464 -flagh0=16 +flagh0=2129936 flagi0=138412036 flagj0=4224 -flagk0=0 -tflag0=-2147477233 +flagk0=2048 +tflag0=0 initx0=0 inity0=0 minx0=0 diff --git a/build/exports/Powerslide.dxw b/build/exports/Powerslide.dxw index 9e4c618..f0aa7ff 100644 --- a/build/exports/Powerslide.dxw +++ b/build/exports/Powerslide.dxw @@ -7,12 +7,12 @@ opengllib0= notes0= ver0=0 coord0=0 -flag0=134217762 +flag0=679477282 flagg0=1207959552 flagh0=20 flagi0=138412036 flagj0=4224 -tflag0=512 +tflag0=0 initx0=0 inity0=0 minx0=0 @@ -27,3 +27,5 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +flagk0=0 +swapeffect0=0 diff --git a/build/exports/Thorgal.dxw b/build/exports/Thorgal.dxw index e189893..b6d50cd 100644 --- a/build/exports/Thorgal.dxw +++ b/build/exports/Thorgal.dxw @@ -6,7 +6,7 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=136314914 +flag0=136314915 flagg0=1242038528 flagh0=65552 flagi0=136314885 @@ -26,3 +26,6 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +notes0= +flagk0=2048 +swapeffect0=0 diff --git a/build/exports/dxwnd.ini b/build/exports/dxwnd.ini deleted file mode 100644 index e334ef2..0000000 --- a/build/exports/dxwnd.ini +++ /dev/null @@ -1,5 +0,0 @@ -[window] -posx=1541 -posy=587 -sizx=320 -sizy=200 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index d81f782..39d593b 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -850,4 +850,9 @@ add: debug flag "Highlight Locked surfaces" to highlight service surfaces that a v2.03.29: fix: wrong d3d7 hook, now "Echelon" works again. -add: "hide taskbar" option. A little experimental, so far. If the game crashes, the taskbar may not be reactivated: use menu commands to recover. \ No newline at end of file +add: "hide taskbar" option. A little experimental, so far. If the game crashes, the taskbar may not be reactivated: use menu commands to recover. + +v2.03.30: +fix: reset for flipped DC retrieved from ddraw interface after ddraw creation. Fixes "Powerslide". +add: added "Send WM_ACTIVATEAPP message" flag: fixes "Championship Manager 03 04" mouse and "Thorgal" lock +fix: FillRect hooker. Good for "Premier Manager 98" and "Premier Manager 97". \ No newline at end of file diff --git a/dll/ddraw.cpp b/dll/ddraw.cpp index a9dddd9..e20ff63 100644 --- a/dll/ddraw.cpp +++ b/dll/ddraw.cpp @@ -1604,7 +1604,7 @@ HRESULT WINAPI extDirectDrawCreate(GUID FAR *lpguid, LPDIRECTDRAW FAR *lplpdd, I } if(lpPrimaryDD==NULL) lpPrimaryDD=*lplpdd; // do not override the value set when creating the primary surface! - + bFlippedDC = FALSE; // v02.03.30 return DD_OK; } @@ -1677,6 +1677,7 @@ HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *lpguid, } if(lpPrimaryDD==NULL) lpPrimaryDD=*lplpdd; // do not override the value set when creating the primary surface! + bFlippedDC = FALSE; // v02.03.30: fix for Powerslide return DD_OK; } diff --git a/dll/dxhook.cpp b/dll/dxhook.cpp index 382ca2b..d7b0546 100644 --- a/dll/dxhook.cpp +++ b/dll/dxhook.cpp @@ -107,7 +107,7 @@ static char *Flag5Names[32]={ static char *Flag6Names[32]={ "FORCESWAPEFFECT", "LEGACYALLOC", "NODESTROYWINDOW", "NOMOVIES", "SUPPRESSRELEASE", "FIXMOVIESCOLOR", "WOW64REGISTRY", "DISABLEMAXWINMODE", - "FIXPITCH", "POWER2WIDTH", "", "", + "FIXPITCH", "POWER2WIDTH", "HIDETASKBAR", "ACTIVATEAPP", "", "", "", "", "", "", "", "", "", "", "", "", @@ -943,6 +943,11 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp (*pMoveWindow)(hControlParentWnd, wp->x+fo.x, wp->y+fo.y, wp->cx, wp->cy, TRUE); } } + // v2.03.30: in window mode, it seems that the WM_ACTIVATEAPP message is not sent to the main win. + // this PostMessage call recovers "Thorgal" block at the end of intro movie and "Championship Manager 03 04" cursor + if((message==WM_WINDOWPOSCHANGED) && (dxw.dwFlags6 & ACTIVATEAPP)){ + PostMessage(hwnd, WM_ACTIVATEAPP, 1, 0); + } } break; case WM_ENTERSIZEMOVE: diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index 23b0f63..e49ca7a 100644 --- a/dll/dxwnd.cpp +++ b/dll/dxwnd.cpp @@ -27,7 +27,7 @@ along with this program. If not, see . #include "TlHelp32.h" -#define VERSION "2.03.29" +#define VERSION "2.03.30" #define DDTHREADLOCK 1 //#define LOCKTHREADS diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index d1b1b76..264850a 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/user32.cpp b/dll/user32.cpp index 61f7749..fd7152c 100644 --- a/dll/user32.cpp +++ b/dll/user32.cpp @@ -153,6 +153,8 @@ static HookEntry_Type Hooks[]={ //{HOOK_IAT_CANDIDATE, "IsZoomed", (FARPROC)NULL, (FARPROC *)&pIsZoomed, (FARPROC)extIsZoomed}, //{HOOK_HOT_CANDIDATE, "IsIconic", (FARPROC)IsIconic, (FARPROC *)&pIsIconic, (FARPROC)extIsIconic}, + {HOOK_HOT_CANDIDATE, "FillRect", (FARPROC)NULL, (FARPROC *)&pFillRect, (FARPROC)extFillRect}, + {HOOK_IAT_CANDIDATE, 0, NULL, 0, 0} // terminator }; @@ -174,7 +176,7 @@ static HookEntry_Type ScaledHooks[]={ {HOOK_IAT_CANDIDATE, "TabbedTextOutA", (FARPROC)TabbedTextOutA, (FARPROC *)&pTabbedTextOutA, (FARPROC)extTabbedTextOutA}, {HOOK_IAT_CANDIDATE, "DrawTextA", (FARPROC)DrawTextA, (FARPROC *)&pDrawText, (FARPROC)extDrawTextA}, {HOOK_IAT_CANDIDATE, "DrawTextExA", (FARPROC)DrawTextExA, (FARPROC *)&pDrawTextEx, (FARPROC)extDrawTextExA}, - {HOOK_IAT_CANDIDATE, "FillRect", (FARPROC)NULL, (FARPROC *)&pFillRect, (FARPROC)extFillRect}, + //{HOOK_HOT_CANDIDATE, "FillRect", (FARPROC)NULL, (FARPROC *)&pFillRect, (FARPROC)extFillRect}, //{HOOK_IAT_CANDIDATE, "GetDC", (FARPROC)GetDC, (FARPROC *)&pGDIGetDC, (FARPROC)extGDIGetDC}, //{HOOK_IAT_CANDIDATE, "GetDCEx", (FARPROC)NULL, (FARPROC *)&pGDIGetDCEx, (FARPROC)extGDIGetDCEx}, //{HOOK_IAT_CANDIDATE, "GetWindowDC", (FARPROC)GetWindowDC, (FARPROC *)&pGDIGetWindowDC, (FARPROC)extGDIGetWindowDC}, @@ -1689,11 +1691,16 @@ int WINAPI extFillRect(HDC hdc, const RECT *lprc, HBRUSH hbr) return TRUE; } - memcpy(&rc, lprc, sizeof(rc)); if(dxw.IsRealDesktop(WindowFromDC(hdc))) { - OutTraceDW("FillRect: remapped hdc to virtual desktop\n"); + HWND VirtualDesktop; + VirtualDesktop=dxw.GethWnd(); + if(VirtualDesktop==NULL){ + OutTraceDW("FillRect: no virtual desktop\n"); + return TRUE; + } + OutTraceDW("FillRect: remapped hdc to virtual desktop hwnd=%x\n", dxw.GethWnd()); hdc=(*pGDIGetDC)(dxw.GethWnd()); } @@ -1701,11 +1708,14 @@ int WINAPI extFillRect(HDC hdc, const RECT *lprc, HBRUSH hbr) // when not in fullscreen mode, just proxy the call // but check coordinates: some games may use excessive coordinates: see "Premier Manager 98" RECT client; - (*pGetClientRect)(WindowFromDC(hdc), &client); + HWND hwnd; + hwnd=WindowFromDC(hdc); + (*pGetClientRect)(hwnd, &client); if(rc.left < 0) rc.left=0; if(rc.top < 0) rc.top=0; if(rc.right > client.right) rc.right=client.right; if(rc.bottom > client.bottom) rc.bottom=client.bottom; + OutTraceDW("FillRect: remapped hdc from hwnd=%x to rect=(%d,%d)-(%d,%d)\n", hwnd, rc.left, rc.top, rc.right, rc.bottom); return (*pFillRect)(hdc, &rc, hbr); } diff --git a/host/TabWindow.cpp b/host/TabWindow.cpp index 94ef8fa..75113e1 100644 --- a/host/TabWindow.cpp +++ b/host/TabWindow.cpp @@ -47,6 +47,7 @@ void CTabWindow::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_HIDETASKBAR, cTarget->m_HideTaskbar); DDX_Check(pDX, IDC_UNLOCKZORDER, cTarget->m_UnlockZOrder); DDX_Check(pDX, IDC_NODESTROYWINDOW, cTarget->m_NoDestroyWindow); + DDX_Check(pDX, IDC_ACTIVATEAPP, cTarget->m_ActivateApp); // color management DDX_Check(pDX, IDC_INIT8BPP, cTarget->m_Init8BPP); diff --git a/host/TargetDlg.cpp b/host/TargetDlg.cpp index 631ddf4..22ab330 100644 --- a/host/TargetDlg.cpp +++ b/host/TargetDlg.cpp @@ -60,6 +60,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_NoD3DReset = FALSE; m_HideDesktop = FALSE; m_HideTaskbar = FALSE; + m_ActivateApp = FALSE; m_UnlockZOrder = FALSE; m_NoDestroyWindow = FALSE; m_LockSysColors = FALSE; diff --git a/host/TargetDlg.h b/host/TargetDlg.h index f8d8aaa..e9fe0f8 100644 --- a/host/TargetDlg.h +++ b/host/TargetDlg.h @@ -187,6 +187,7 @@ public: BOOL m_NoD3DReset; BOOL m_HideDesktop; BOOL m_HideTaskbar; + BOOL m_ActivateApp; BOOL m_UnlockZOrder; BOOL m_NoDestroyWindow; BOOL m_LockSysColors; diff --git a/host/dxwndhost.aps b/host/dxwndhost.aps index b695693..1abddd1 100644 Binary files a/host/dxwndhost.aps and b/host/dxwndhost.aps differ diff --git a/host/dxwndhost.rc b/host/dxwndhost.rc index 80e4ae9..ff1b8a7 100644 Binary files a/host/dxwndhost.rc and b/host/dxwndhost.rc differ diff --git a/host/dxwndhost.vs2008.suo b/host/dxwndhost.vs2008.suo index f7667b2..bee13bc 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ diff --git a/host/dxwndhostView.cpp b/host/dxwndhostView.cpp index c3dab67..9991291 100644 --- a/host/dxwndhostView.cpp +++ b/host/dxwndhostView.cpp @@ -292,6 +292,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg) if(dlg->m_NoD3DReset) t->flags4 |= NOD3DRESET; if(dlg->m_HideDesktop) t->flags4 |= HIDEDESKTOP; if(dlg->m_HideTaskbar) t->flags6 |= HIDETASKBAR; + if(dlg->m_ActivateApp) t->flags6 |= ACTIVATEAPP; if(dlg->m_UnlockZOrder) t->flags5 |= UNLOCKZORDER; if(dlg->m_NoDestroyWindow) t->flags6 |= NODESTROYWINDOW; if(dlg->m_LockSysColors) t->flags3 |= LOCKSYSCOLORS; @@ -500,6 +501,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg) dlg->m_NoD3DReset = t->flags4 & NOD3DRESET ? 1 : 0; dlg->m_HideDesktop = t->flags4 & HIDEDESKTOP ? 1 : 0; dlg->m_HideTaskbar = t->flags6 & HIDETASKBAR ? 1 : 0; + dlg->m_ActivateApp = t->flags6 & ACTIVATEAPP ? 1 : 0; dlg->m_UnlockZOrder = t->flags5 & UNLOCKZORDER ? 1 : 0; dlg->m_NoDestroyWindow = t->flags6 & NODESTROYWINDOW ? 1 : 0; dlg->m_LockSysColors = t->flags3 & LOCKSYSCOLORS ? 1 : 0; @@ -1034,9 +1036,16 @@ void CDxwndhostView::OnExport() CFileDialog dlg( FALSE, "*.dxw", path, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "dxwnd task config (*.dxw)|*.dxw|All Files (*.*)|*.*||", this); if( dlg.DoModal() == IDOK) { + DWORD TFlags; + TARGETMAP *TargetMap; strcpy(path, dlg.GetPathName().GetBuffer()); //MessageBox(path, "PathName", MB_OK); + // export with no trace flags active + TargetMap = &TargetMaps[i]; + TFlags = TargetMap->tflags; + TargetMap->tflags = 0; SaveConfigItem(&TargetMaps[i], &TitleMaps[i], 0, path); + TargetMap->tflags = TFlags; if(GetPrivateProfileInt("window", "updatepaths", 1, InitPath)) { GetFolderFromPath(path); WritePrivateProfileString("window", "exportpath", path, InitPath); diff --git a/host/resource b/host/resource index abcc3ae..de92742 100644 Binary files a/host/resource and b/host/resource differ