diff --git a/Include/dxwnd.h b/Include/dxwnd.h index 29dd190..ff4b41e 100644 --- a/Include/dxwnd.h +++ b/Include/dxwnd.h @@ -223,7 +223,7 @@ #define BLOCKPRIORITYCLASS 0x00000020 // blocks attempts to change the process priority class #define CPUSLOWDOWN 0x00000040 // reduces CPU time dedicated to non time critical threads #define CPUMAXUSAGE 0x00000080 // reduces CPU time to non time critical threads that consume more than the given ratio - +#define NOWINERRORS 0x00000100 // suppress some possible window errors returning OK also in case of failure // eighth flags DWORD dxw.dwFlags8: // logging Tflags DWORD: diff --git a/build/dxwnd.dll b/build/dxwnd.dll index fa81315..c451cc5 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c7dbfc11581e871c2b2611baad8c24e7e904c1264771fbddf1ae438805b6817 -size 651776 +oid sha256:c7943551fe966c9338314466a778a5b8116dbf776047162959a1403ad895a167 +size 652800 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index 553085f..8194b1e 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a0ffb89088ea50da7077abb29aa298d730841a13f2a8b0e9882b088e0a8290c6 +oid sha256:1dfdcf69403a93563f73c0f77084c8c054b570c2c2681aa1323aa5d7d0c70ae0 size 568320 diff --git a/exports.new/Microsoft Golf '98 trial.dxw b/build/exports/Microsoft Golf 1998 Edition.dxw similarity index 85% rename from exports.new/Microsoft Golf '98 trial.dxw rename to build/exports/Microsoft Golf 1998 Edition.dxw index 01114d2..450dddd 100644 --- a/exports.new/Microsoft Golf '98 trial.dxw +++ b/build/exports/Microsoft Golf 1998 Edition.dxw @@ -1,6 +1,6 @@ [target] -title0=Microsoft Golf '98 trial (win) -path0=D:\Games\MSGolf98\MSGOLF98\GAME.EXE +title0=Microsoft Golf 1998 Edition +path0=D:\Games\Microsoft Golf 1998 Edition\game.exe launchpath0= module0= opengllib0= @@ -13,10 +13,11 @@ flagg0=-671088640 flagh0=1302 flagi0=1212547076 flagj0=4224 -flagk0=67436544 -flagl0=4 +flagk0=327680 +flagl0=260 flagm0=0 tflag0=0 +dflag0=0 posx0=50 posy0=50 sizx0=0 @@ -27,3 +28,4 @@ winver0=0 maxres0=-1 swapeffect0=0 maxddinterface0=7 +slowratio0=1 diff --git a/build/exports/Microsoft Golf 1999 Edition.dxw b/build/exports/Microsoft Golf 1999 Edition.dxw new file mode 100644 index 0000000..5f1bda9 --- /dev/null +++ b/build/exports/Microsoft Golf 1999 Edition.dxw @@ -0,0 +1,31 @@ +[target] +title0=Microsoft Golf 1999 Edition +path0=D:\Games\Microsoft Golf 1999 Edition\game.exe +launchpath0= +module0= +opengllib0= +notes0= +registry0=[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Golf '98]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Golf '98\Version 1.0 Demo]\n"AppPath"="D:\\Games\\MSGolf98\\MSGOLF98"\n"InstallType"="1"\n"InstallPath"="D:\\Games\\MSGolf98\\MSGOLF98\\"\n"CDPath"="D:\\Games\\MSGolf98\\MSGOLF98"\n"Launched"="1"\n"PID"=""\n"Path"="D:\\Games\\MSGolf98\\MSGOLF98"\n"VersionType"="TrialVersion"\n"InstalledGroup"="1"\n"LangID"=dword:00000009\n +ver0=0 +coord0=0 +flag0=136314914 +flagg0=-671088640 +flagh0=1302 +flagi0=1212547076 +flagj0=4224 +flagk0=327680 +flagl0=260 +flagm0=0 +tflag0=0 +dflag0=0 +posx0=50 +posy0=50 +sizx0=0 +sizy0=0 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 +maxddinterface0=7 +slowratio0=1 diff --git a/build/exports/Miscrosoft Golf '98 Trial.dxw b/build/exports/Miscrosoft Golf '98 Trial.dxw deleted file mode 100644 index 8f2599a..0000000 --- a/build/exports/Miscrosoft Golf '98 Trial.dxw +++ /dev/null @@ -1,29 +0,0 @@ -[target] -title0=Miscrosoft Golf '98 Trial -path0=D:\Games\msgolf\Golf '98 Trial\game.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0=[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Golf '98]\n[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Golf '98\Version 1.0 Demo]\n"AppPath"="D:\\Games\\msgolf\\Golf '98 Trial"\n"InstallType"="1"\n"InstalledPath"="D:\\Games\\msgolf\\Golf '98 Trial"\n"CDPath"="D:\\Games\\msgolf\\Golf '98 Trial\\"\n"ITF File Path"="D:\\Games\\msgolf\\Golf '98 Trial\\golf.itf"\n"Launched"="1"\n"PID"=""\n"Path"="D:\\Games\\msgolf\\Golf '98 Trial"\n"VersionType"="TrialVersion"\n"InstalledGroup"="1"\n"LangID"=dword:00000009\n\n\n[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games]\n[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Golf '98]\n[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Golf '98\Version 1.0 Demo]\n"AppPath"="D:\\Games\\msgolf\\Golf '98 Trial"\n"InstallType"="1"\n"InstalledPath"="D:\\Games\\msgolf\\Golf '98 Trial"\n"CDPath"="D:\\Games\\msgolf\\Golf '98 Trial\\"\n"ITF File Path"="D:\\Games\\msgolf\\Golf '98 Trial\\golf.itf"\n"Launched"="1"\n"PID"=""\n"Path"="D:\\Games\\msgolf\\Golf '98 Trial"\n"VersionType"="TrialVersion"\n"InstalledGroup"="1"\n"LangID"=dword:00000009 -ver0=0 -coord0=0 -flag0=2101474 -flagg0=1476395016 -flagh0=1044 -flagi0=1210187780 -flagj0=128 -flagk0=327680 -flagl0=4 -flagm0=0 -tflag0=0 -posx0=50 -posy0=50 -sizx0=880 -sizy0=660 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=0 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index 415bbe9..3387529 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -1110,4 +1110,10 @@ fix: GUI placement coordinates are not saved when terminating in minimized or ma v2.03.68 add: options to limit the cpu usage of program threads, either inconditionally ("CPU slow down") or only for CPU consuming threads ("CPU max usage"). -fix: some logging details \ No newline at end of file +fix: some logging details + +v2.03.69 +fix: fixed "CPU max usage" option +fix: WindowFromPoint & WindowFromPointEx hooks +fix: recovered partilly working implementation of "shared dc" mode +add: "Suppress Win errors" option, needed to skip a blocking error and make "Migrosoft Golf '98" starting diff --git a/dll/cpulimit.cpp b/dll/cpulimit.cpp index 38d2474..28cf249 100644 --- a/dll/cpulimit.cpp +++ b/dll/cpulimit.cpp @@ -31,7 +31,6 @@ DWORD WINAPI CpuLimit(LPVOID lpThreadParameter) OutTrace("starting CPULimit dwOwnerPID=%x Ratio=1:%d\n", dwOwnerPID, iSlowDownRatio); if(!dwOwnerPID) return FALSE; if(iSlowDownRatio < 1) return FALSE; - //while(TRUE) return LimitCpuUsage(dwOwnerPID, dwOwnerThread, iSlowDownRatio); } @@ -63,12 +62,13 @@ BOOL SlowCpuSpeed(DWORD dwOwnerPID, DWORD dwOwnerThread, int iSlowDownRatio) // and stop each low-priority thread iThreadIndex = 0; do { - if((te32.th32OwnerProcessID == dwOwnerPID) && (te32.th32ThreadID != dwOwnerThread)){ - if (te32.tpBasePri < THREAD_PRIORITY_TIME_CRITICAL) { - HANDLE hThread = OpenThread(THREAD_SUSPEND_RESUME, FALSE, te32.th32ThreadID); - SuspendThread(hThread); - SuspThreads[iThreadIndex++] = hThread; - } + if( (te32.th32OwnerProcessID == dwOwnerPID) && + (te32.th32ThreadID != dwOwnerThread) && + (te32.tpBasePri < THREAD_PRIORITY_TIME_CRITICAL)) { + + HANDLE hThread = OpenThread(THREAD_SUSPEND_RESUME, FALSE, te32.th32ThreadID); + SuspendThread(hThread); + SuspThreads[iThreadIndex++] = hThread; } } while(Thread32Next(hThreadSnap, &te32) && (iThreadIndex *iNumThreads) *iNumThreads = iThreadIndex; + } + } + } while(Thread32Next(hThreadSnap, &te32) && (*iNumThreads 100) cycle=0; // every 100 cyces forces a thread list refresh - Sleep(DELTA_TIME); + for(iThreadIndex=0; iThreadIndexDeltaUsed > (signed long)iTimeLimit) { +#ifdef DEBUGTRACE + OutTrace("Tid[%d]:%x delta=%d stopped at %d\n", iThreadIndex, t->tid, t->DeltaUsed, __LINE__); +#endif + if ((iResumeCount=SuspendThread(t->hThread))== -1) { + t->tid = NULL; + CloseHandle(t->hThread); + continue; + } + t->Suspended = TRUE; + t->DeltaUsed -= iTimeSlot; + } + } + + Sleep(iSlowDownRatio); for(iThreadIndex=0; iThreadIndexhThread == NULL) continue; // skip terminated ones - if(!GetThreadTimes(t->hThread, &CreationTime, &ExitTime, &KernelTime, &UserTime)) { - //OutTrace("Tid[%d]=%x died at %d\n", iThreadIndex, t->hThread, __LINE__); - //CloseHandle(t->hThread); - t->hThread = NULL; - continue; - } + if (t->tid == NULL) continue; // skip terminated ones + if (t->Suspended) { - t->DeltaUsed -= iTimeSlot; - //OutTrace("Tid[%d]=%x suspended delta=%ld\n", iThreadIndex, t->hThread, t->DeltaUsed); - if(t->DeltaUsed < 0) { - if (ResumeThread(t->hThread)== -1){ - //OutTrace("Tid[%d]=%x died at %d\n", iThreadIndex, t->hThread, __LINE__); - //CloseHandle(t->hThread); - t->hThread = NULL; - continue; - } - t->Suspended = FALSE; +#ifdef DEBUGTRACE + OutTrace("Tid[%d]=%x delta=%d started at %d\n", iThreadIndex, t->tid, t->DeltaUsed, __LINE__); +#endif + if ((iResumeCount=ResumeThread(t->hThread))== -1) { + t->tid = NULL; + CloseHandle(t->hThread); + continue; } + t->Suspended = FALSE; + t->DeltaUsed -= iTimeSlot; } else { - iUserTime = UserTime.dwLowDateTime; - iKernelTime = KernelTime.dwLowDateTime; - t->DeltaUsed = t->DeltaUsed + (iUserTime + iKernelTime) - t->LastUsed; - t->LastUsed = iUserTime + iKernelTime; - //OutTrace("Tid[%d]=%x active delta=%ld\n", iThreadIndex, t->hThread, t->DeltaUsed); - if (t->DeltaUsed > (signed long)iTimeLimit) { - //OutTrace("Tid[%d]=%x stopped last=%ld\n", iThreadIndex, t->hThread, t->DeltaUsed); - if (SuspendThread(t->hThread)== -1) { - //OutTrace("Tid[%d]=%x died at %d\n", iThreadIndex, t->hThread, __LINE__); - //CloseHandle(t->hThread); - t->hThread = NULL; - continue; - } - t->Suspended = TRUE; - t->DeltaUsed -= iTimeSlot; - } + if(!GetThreadTimes(t->hThread, &CreationTime, &ExitTime, &KernelTime, &UserTime)) { + t->tid = NULL; + CloseHandle(t->hThread); + continue; + } + FILETIME tmp = t->LastUsed; + t->LastUsed = FTFTSUM(UserTime, KernelTime); + t->DeltaUsed = t->DeltaUsed + DWDIFF(t->LastUsed, tmp); +#ifdef DEBUGTRACE + OutTrace("Tid[%d]:%x delta=%d measured at %d\n", iThreadIndex, t->tid, t->DeltaUsed, __LINE__); +#endif } - } - } - // should never go here .... - OutTrace("end of cycle\n"); - for(int i=0; itid && t->Suspended) { + ResumeThread(t->hThread); + } + } return TRUE; } + diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index a80ee03..a7ee597 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.68" +#define VERSION "2.03.69" #define DDTHREADLOCK 1 //#define LOCKTHREADS diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index 128c266..273bf64 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/shareddc.cpp b/dll/shareddc.cpp index fe33831..a479ec2 100644 --- a/dll/shareddc.cpp +++ b/dll/shareddc.cpp @@ -21,7 +21,6 @@ extern HandleDDThreadLock_Type pReleaseDDThreadLock; extern GetDC_Type pGetDCMethod(); extern ReleaseDC_Type pReleaseDCMethod(); -//void setClippingRegion(HDC, HDC, HWND, bool, const POINT&); /*---------------------------------------------------------------------------------+ | | @@ -192,8 +191,8 @@ HDC dxwSDC::GetPrimaryDC(HDC hdc) origin.y -= mainwin.y; OutTraceB("dxwSDC::GetPrimaryDC: origin=(%d,%d)\n", origin.x, origin.y); - copyDcAttributes(VirtualHDC, hdc, origin); - setClippingRegion(VirtualHDC, hdc, dxw.GethWnd(), FALSE, origin); // no good + copyDcAttributes(VirtualHDC, hdc, origin); + setClippingRegion(VirtualHDC, hdc, origin); return VirtualHDC; } @@ -369,60 +368,77 @@ void dxwSDC::copyDcAttributes(HDC destDC, HDC origDc, POINT origin) typedef struct { HDC compatDc; + POINT origin; HWND rootWnd; } ExcludeClipRectsData_Type; -static BOOL CALLBACK excludeClipRectForOverlappingWindow(HWND hwnd, LPARAM lParam) +static BOOL CALLBACK excludeClipRectsForOverlappingWindows(HWND hwnd, LPARAM lParam) { ExcludeClipRectsData_Type *excludeClipRectsData = (ExcludeClipRectsData_Type *)lParam; - if (hwnd == excludeClipRectsData->rootWnd) return FALSE; - if (!IsWindowVisible(hwnd)) return TRUE; - - RECT windowRect = {}; - GetWindowRect(hwnd, &windowRect); - - HRGN windowRgn = (*pCreateRectRgnIndirect)(&windowRect); - ExtSelectClipRgn(excludeClipRectsData->compatDc, windowRgn, RGN_DIFF); - DeleteObject(windowRgn); - OutTraceB("dxwSDC::excludeClipRect: hwnd=%x rect=(%d,%d)-(%d,%d)\n", hwnd, windowRect.left, windowRect.top, windowRect.right, windowRect.bottom); + if (!IsWindowVisible(hwnd)) return TRUE; // go ahead + if (hwnd == excludeClipRectsData->rootWnd) return FALSE; // stop + if(dxw.IsDesktop(hwnd)) return FALSE; + RECT rect = {}; + (*pGetClientRect)(hwnd, &rect); + OffsetRect(&rect, -excludeClipRectsData->origin.x, -excludeClipRectsData->origin.y); + ExcludeClipRect(excludeClipRectsData->compatDc, rect.left, rect.top, rect.right, rect.bottom); + OutTraceB("dxwSDC::excludeClipRects: hwnd=%x rect=(%d,%d)-(%d,%d)\n", hwnd, rect.left, rect.top, rect.right, rect.bottom); return TRUE; } -static void excludeClipRectsForOverlappingWindows(HWND hwnd, BOOL isMenuWindow, HDC compatDc) +void dxwSDC::setClippingRegion(HDC compatDc, HDC origDc, POINT origin) { - ExcludeClipRectsData_Type excludeClipRectsData = { compatDc, GetAncestor(hwnd, GA_ROOT) }; - if (!isMenuWindow){ - EnumWindows(&excludeClipRectForOverlappingWindow, (LPARAM)(&excludeClipRectsData)); + OutTraceB("dxwSDC::setClippingRegion: compdc=%x origdc=%x origin=(%d,%d)\n", compatDc, origDc, origin.x, origin.y); + HRGN clipRgn = CreateRectRgn(0, 0, 0, 0); + const bool isEmptyClipRgn = (1 != GetRandomRgn(origDc, clipRgn, SYSRGN)); + OutTraceB("dxwSDC::setClippingRegion: isEmptyClipRgn=%x\n", isEmptyClipRgn); + // scale clip region + POINT upleft={0, 0}; + //(*pClientToScreen)(dxw.GethWnd(), &upleft); + (*pClientToScreen)(CurrenthWnd, &upleft); + if(IsDebug){ + OutTraceB("dxwSDC::setClippingRegion: upleft=(%d,%d)\n", upleft.x, upleft.y); } - - HWND menuWindow = FindWindow((LPCSTR)(0x8000), NULL); - while (menuWindow && menuWindow != hwnd){ - excludeClipRectForOverlappingWindow(menuWindow, (LPARAM)(&excludeClipRectsData)); - menuWindow = FindWindowEx(NULL, menuWindow, (LPCSTR)(0x8000), NULL); + OffsetRgn(clipRgn, -upleft.x, -upleft.y); + if(IsDebug){ + RECT RgnBox; + GetRgnBox(clipRgn, &RgnBox); + OutTraceB("dxwSDC::setClippingRegion: RgnBox=(%d,%d)-(%d,%d) size=(%dx%d)\n", + RgnBox.left, RgnBox.top, RgnBox.right, RgnBox.bottom, RgnBox.right-RgnBox.left, RgnBox.bottom-RgnBox.top); } -} - -void dxwSDC::setClippingRegion(HDC compatDc, HDC origDc, HWND hwnd, bool isMenuWindow, const POINT& origin) -{ - HRGN clipRgn = (*pCreateRectRgn)(0, 0, 0, 0); - if (1 == GetClipRgn(origDc, clipRgn)){ - OffsetRgn(clipRgn, origin.x, origin.y); - SelectClipRgn(compatDc, clipRgn); - } - - if ((hwnd) && (dxw.dwFlags7 & FIXCLIPPERAREA)){ - if (isMenuWindow || 1 != GetRandomRgn(origDc, clipRgn, SYSRGN)){ - RECT rect = {}; - (*pGetWindowRect)(hwnd, &rect); - (*pSetRectRgn)(clipRgn, rect.left, rect.top, rect.right, rect.bottom); - } - - excludeClipRectsForOverlappingWindows(hwnd, isMenuWindow, compatDc); - ExtSelectClipRgn(compatDc, clipRgn, RGN_AND); - } - + // end of scaling + SelectClipRgn(compatDc, isEmptyClipRgn ? NULL : clipRgn); DeleteObject(clipRgn); - SetMetaRgn(compatDc); + + HRGN origClipRgn = (*pCreateRectRgn)(0, 0, 0, 0); + if (1 == GetClipRgn(origDc, origClipRgn)) + { + OutTraceB("dxwSDC::setClippingRegion: GetClipRgn==1\n"); + OffsetRgn(origClipRgn, origin.x, origin.y); + ExtSelectClipRgn(compatDc, origClipRgn, RGN_AND); + if(IsDebug){ + RECT RgnBox; + GetRgnBox(origClipRgn, &RgnBox); // for logging only + OutTraceB("dxwSDC::setClippingRegion: OrigRgnBox=(%d,%d)-(%d,%d)\n", RgnBox.left, RgnBox.top, RgnBox.right, RgnBox.bottom); + } + } + DeleteObject(origClipRgn); + + if(dxw.dwFlags7 & FIXCLIPPERAREA){ + // to finish ..... + // on Win10 this part seems unnecessary and giving troubles ..... + if (!isEmptyClipRgn){ + OutTraceB("dxwSDC::setClippingRegion: isEmptyClipRgn FALSE\n"); + HWND hwnd = WindowFromDC(origDc); + if (hwnd && (!dxw.IsDesktop(hwnd))){ + ExcludeClipRectsData_Type excludeClipRectsData = { compatDc, origin, dxw.GethWnd() }; + //ExcludeClipRectsData_Type excludeClipRectsData = { compatDc, origin, GetAncestor(hwnd, GA_ROOT) }; + OutTraceB("dxwSDC::setClippingRegion: compatdc=%x origin=(%d,%d) ancestor=%x\n", + compatDc, origin.x, origin.y, dxw.GethWnd()); + EnumWindows(&excludeClipRectsForOverlappingWindows,(LPARAM)(&excludeClipRectsData)); + } + } + } } diff --git a/dll/shareddc.hpp b/dll/shareddc.hpp index e2ca42e..0ac049a 100644 --- a/dll/shareddc.hpp +++ b/dll/shareddc.hpp @@ -26,7 +26,7 @@ public: // methods private: void copyDcAttributes(HDC, HDC, POINT); - void setClippingRegion(HDC, HDC, HWND, bool, const POINT &); + void setClippingRegion(HDC, HDC, POINT); HDC PrimaryDC; HDC VirtualHDC; diff --git a/dll/user32.cpp b/dll/user32.cpp index 7c77061..a530d97 100644 --- a/dll/user32.cpp +++ b/dll/user32.cpp @@ -2636,6 +2636,7 @@ BOOL WINAPI extDestroyWindow(HWND hWnd) // v2.02.43: "Empire Earth" builds test surfaces that must be destroyed! // v2.03.20: "Prince of Persia 3D" destroys the main window that must be preserved! BOOL res; + OutTraceB("DestroyWindow: hwnd=%x\n", hWnd); if (hWnd == dxw.GethWnd()) { if(dxw.dwFlags6 & NODESTROYWINDOW) { @@ -2651,6 +2652,8 @@ BOOL WINAPI extDestroyWindow(HWND hWnd) } res=(*pDestroyWindow)(hWnd); if(!res)OutTraceE("DestroyWindow: ERROR err=%d\n", GetLastError()); + + if(dxw.dwFlags7 & NOWINERRORS) return TRUE; // v2.03.69: suppress unessential errors return res; } @@ -3132,14 +3135,12 @@ BOOL WINAPI extGetCursorInfo(PCURSORINFO pci) return ret; } -// --- to be hooked .... - HWND WINAPI extWindowFromPoint(POINT Point) { HWND ret; OutTraceDW("WindowFromPoint: point=(%d,%d)\n", Point.x, Point.y); if(dxw.IsFullScreen()){ - dxw.UnmapWindow(&Point); + dxw.MapWindow(&Point); // v2.03.69 fix OutTraceDW("WindowFromPoint: FIXED point=(%d,%d)\n", Point.x, Point.y); } ret = (*pWindowFromPoint)(Point); @@ -3152,7 +3153,7 @@ HWND WINAPI extChildWindowFromPoint(HWND hWndParent, POINT Point) HWND ret; OutTraceDW("ChildWindowFromPoint: hWndParent=%x point=(%d,%d)\n", hWndParent, Point.x, Point.y); if(dxw.IsDesktop(hWndParent) && dxw.IsFullScreen() && dxw.Windowize){ - dxw.UnmapClient(&Point); + dxw.MapClient(&Point); OutTraceDW("ChildWindowFromPoint: FIXED point=(%d,%d)\n", Point.x, Point.y); } ret = (*pChildWindowFromPoint)(hWndParent, Point); diff --git a/exports.new/Betrayal in Antara.dxw b/exports.new/Betrayal in Antara.dxw deleted file mode 100644 index 3e69289..0000000 --- a/exports.new/Betrayal in Antara.dxw +++ /dev/null @@ -1,29 +0,0 @@ -[target] -title0=Betrayal in Antara -path0=D:\Games\Betrayal in Antara\ANTARAR.EXE -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=0 -flag0=681574434 -flagg0=1207959552 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=65536 -flagl0=0 -flagm0=0 -tflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/exports.new/Blood 2 the Chosen.dxw b/exports.new/Blood 2 the Chosen.dxw deleted file mode 100644 index a50f7bb..0000000 --- a/exports.new/Blood 2 the Chosen.dxw +++ /dev/null @@ -1,29 +0,0 @@ -[target] -title0=Blood 2 the Chosen -path0=D:\Games\Blood2\CLIENT.EXE -launchpath0=D:\Games\Blood2\BLOOD2.EXE -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=0 -flag0=136315042 -flagg0=1207959552 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=65536 -flagl0=0 -flagm0=0 -tflag0=0 -posx0=50 -posy0=50 -sizx0=1200 -sizy0=900 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/exports.new/Bugs Bunny Lost In Time.dxw b/exports.new/Bugs Bunny Lost In Time.dxw deleted file mode 100644 index ed93a8e..0000000 --- a/exports.new/Bugs Bunny Lost In Time.dxw +++ /dev/null @@ -1,29 +0,0 @@ -[target] -title0=Bugs Bunny Lost In Time -path0=D:\Games\Bugs.Bunny.Lost.In.Time\bin\bugs.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=7 -coord0=0 -flag0=681574434 -flagg0=1209139200 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=98304 -flagl0=0 -flagm0=0 -tflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/exports.new/Gooka The Mystery of Janatris.dxw b/exports.new/Gooka The Mystery of Janatris.dxw deleted file mode 100644 index 793502e..0000000 --- a/exports.new/Gooka The Mystery of Janatris.dxw +++ /dev/null @@ -1,29 +0,0 @@ -[target] -title0=Gooka The Mystery of Janatris -path0=D:\Games\Gooka The Mystery of Janatris\Gooka\gooka2.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=0 -flag0=136315394 -flagg0=1207959552 -flagh0=20 -flagi0=138412038 -flagj0=4224 -flagk0=268500992 -flagl0=8 -flagm0=0 -tflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/exports.new/NHL 2002.dxw b/exports.new/NHL 2002.dxw deleted file mode 100644 index c23311b..0000000 --- a/exports.new/NHL 2002.dxw +++ /dev/null @@ -1,30 +0,0 @@ -[target] -title0=NHL 2002 -path0=D:\Games\NHL 2002\nhl2002.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=7 -coord0=0 -flag0=681574499 -flagg0=1476395008 -flagh0=528 -flagi0=136314884 -flagj0=1073746048 -flagk0=327680 -flagl0=0 -flagm0=0 -tflag0=0 -dflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/exports.new/No Respect (1.1).dxw b/exports.new/No Respect (1.1).dxw deleted file mode 100644 index 0872656..0000000 --- a/exports.new/No Respect (1.1).dxw +++ /dev/null @@ -1,35 +0,0 @@ -[target] -title0=No Respect (1.1) -path0=D:\Games\No Respect\nr11.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=0 -flag0=681574434 -flagg0=1207959552 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=327680 -tflag0=0 -initx0=0 -inity0=0 -minx0=0 -miny0=0 -maxx0=0 -maxy0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -flagl0=0 -flagm0=0 -maxddinterface0=7 diff --git a/exports.new/No Respect.dxw b/exports.new/No Respect.dxw deleted file mode 100644 index 8e276d2..0000000 --- a/exports.new/No Respect.dxw +++ /dev/null @@ -1,32 +0,0 @@ -[target] -title0=No Respect -path0=D:\Games\No Respect\NR.EXE -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=0 -flag0=136314914 -flagg0=1207959552 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=327680 -tflag0=0 -initx0=0 -inity0=0 -minx0=0 -miny0=0 -maxx0=0 -maxy0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 diff --git a/exports.new/Phantasmagoria 2.dxw b/exports.new/Phantasmagoria 2.dxw deleted file mode 100644 index d0a3ab1..0000000 --- a/exports.new/Phantasmagoria 2.dxw +++ /dev/null @@ -1,29 +0,0 @@ -[target] -title0=Phantasmagoria 2 -path0=D:\Games\Phantasmagoria 2\SIERRAW.EXE -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=0 -flag0=681574434 -flagg0=1207959552 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=65536 -flagl0=0 -flagm0=0 -tflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/exports.new/Silver.dxw b/exports.new/Silver.dxw deleted file mode 100644 index 62d92d5..0000000 --- a/exports.new/Silver.dxw +++ /dev/null @@ -1,29 +0,0 @@ -[target] -title0=Silver -path0=D:\Games\Silver\silver.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=0 -flag0=136314998 -flagg0=1207959552 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=268500992 -flagl0=0 -flagm0=0 -tflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/exports.new/The Hobbit(TM) Demo.dxw b/exports.new/The Hobbit(TM) Demo.dxw deleted file mode 100644 index a624750..0000000 --- a/exports.new/The Hobbit(TM) Demo.dxw +++ /dev/null @@ -1,30 +0,0 @@ -[target] -title0=The Hobbit(TM) Demo -path0=D:\Games\The Hobbit(TM) Demo\MeridianDemo.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=8 -coord0=0 -flag0=136315426 -flagg0=1207959552 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=65536 -flagl0=0 -flagm0=0 -tflag0=0 -dflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/exports.new/Urban Chaos.dxw b/exports.new/Urban Chaos.dxw deleted file mode 100644 index e66ff26..0000000 --- a/exports.new/Urban Chaos.dxw +++ /dev/null @@ -1,30 +0,0 @@ -[target] -title0=Urban Chaos -path0=D:\Games\Urban Chaos\fallen.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=0 -flag0=136314914 -flagg0=1207959552 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=65536 -flagl0=0 -flagm0=0 -tflag0=0 -dflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/exports.new/Weird War.dxw b/exports.new/Weird War.dxw deleted file mode 100644 index 42b70b6..0000000 --- a/exports.new/Weird War.dxw +++ /dev/null @@ -1,30 +0,0 @@ -[target] -title0=Weird War -path0=D:\Games\Weird War\WeirdWar.exe -launchpath0= -module0= -opengllib0= -notes0= -registry0= -ver0=0 -coord0=0 -flag0=681574434 -flagg0=1207959552 -flagh0=20 -flagi0=138412036 -flagj0=4224 -flagk0=65536 -flagl0=0 -flagm0=0 -tflag0=0 -dflag0=0 -posx0=50 -posy0=50 -sizx0=800 -sizy0=600 -maxfps0=0 -initts0=0 -winver0=0 -maxres0=-1 -swapeffect0=0 -maxddinterface0=7 diff --git a/host/TabSysLibs.cpp b/host/TabSysLibs.cpp index 5825109..f46defc 100644 --- a/host/TabSysLibs.cpp +++ b/host/TabSysLibs.cpp @@ -36,6 +36,7 @@ void CTabSysLibs::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_FIXCLIPPERAREA, cTarget->m_FixClipperArea); DDX_Check(pDX, IDC_CREATEDESKTOP, cTarget->m_CreateDesktop); DDX_Check(pDX, IDC_SYNCPALETTE, cTarget->m_SyncPalette); + DDX_Check(pDX, IDC_NOWINERRORS, cTarget->m_NoWinErrors); // OpenGL DDX_Check(pDX, IDC_HOOKOPENGL, cTarget->m_HookOpenGL); // duplicated diff --git a/host/TargetDlg.cpp b/host/TargetDlg.cpp index 341ca1e..34148fc 100644 --- a/host/TargetDlg.cpp +++ b/host/TargetDlg.cpp @@ -224,6 +224,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_FixClipperArea = FALSE; // ?? m_CreateDesktop = FALSE; m_SyncPalette = FALSE; + m_NoWinErrors = FALSE; m_AnalyticMode = FALSE; m_NoPaletteUpdate = FALSE; m_WireFrame = FALSE; diff --git a/host/TargetDlg.h b/host/TargetDlg.h index a1d532d..0151717 100644 --- a/host/TargetDlg.h +++ b/host/TargetDlg.h @@ -179,6 +179,7 @@ public: BOOL m_FixClipperArea; BOOL m_CreateDesktop; BOOL m_SyncPalette; + BOOL m_NoWinErrors; BOOL m_AnalyticMode; BOOL m_NoPaletteUpdate; BOOL m_LimitResources; diff --git a/host/dxwndhost.aps b/host/dxwndhost.aps index acbfb05..2400950 100644 Binary files a/host/dxwndhost.aps and b/host/dxwndhost.aps differ diff --git a/host/dxwndhost.rc b/host/dxwndhost.rc index e3ef612..439449e 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 4c80950..d5b97b0 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 d740058..ac99db5 100644 --- a/host/dxwndhostView.cpp +++ b/host/dxwndhostView.cpp @@ -446,6 +446,7 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg) if(dlg->m_FixClipperArea) t->flags7 |= FIXCLIPPERAREA; if(dlg->m_CreateDesktop) t->flags6 |= CREATEDESKTOP; if(dlg->m_SyncPalette) t->flags6 |= SYNCPALETTE; + if(dlg->m_NoWinErrors) t->flags7 |= NOWINERRORS; if(dlg->m_AnalyticMode) t->flags3 |= ANALYTICMODE; if(dlg->m_ReplacePrivOps) t->flags5 |= REPLACEPRIVOPS; t->posx = dlg->m_PosX; @@ -706,6 +707,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg) dlg->m_FixClipperArea = t->flags7 & FIXCLIPPERAREA ? 1 : 0; dlg->m_CreateDesktop = t->flags6 & CREATEDESKTOP ? 1 : 0; dlg->m_SyncPalette = t->flags6 & SYNCPALETTE ? 1 : 0; + dlg->m_NoWinErrors = t->flags7 & NOWINERRORS ? 1 : 0; dlg->m_AnalyticMode = t->flags3 & ANALYTICMODE ? 1 : 0; dlg->m_ReplacePrivOps = t->flags5 & REPLACEPRIVOPS ? 1 : 0; dlg->m_PosX = t->posx; diff --git a/host/resource b/host/resource index 2fc5707..f9845e0 100644 Binary files a/host/resource and b/host/resource differ