diff --git a/Include/dxwnd.h b/Include/dxwnd.h index 95d7871..d97d604 100644 --- a/Include/dxwnd.h +++ b/Include/dxwnd.h @@ -191,6 +191,7 @@ #define DISABLEMAXWINMODE 0x00000080 // invoke ddraw SetAppCompatData(12,0) to set DisableMaxWindowedMode #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 // logging Tflags DWORD: #define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general diff --git a/build/dxwnd.dll b/build/dxwnd.dll index 3256573..9fa17b7 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bd9f3a8d1c620b34bb5d445bab38ed6510a486f2f3bdbde661a4a8d3d3c2052f +oid sha256:427b51e427648a3f526882f2ed47eb400830ad367e5484f9fce47a94aab837b9 size 578048 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index 9003103..30a5850 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5be9b2e6e65b9ed2d920418acc46bbfb48166515b1ad5d47f5c17854d73c5041 -size 540672 +oid sha256:e15db53d932535d67b361f33febb9c9a52b3c5d3c0552f1b4f857fa0f4ac868c +size 541184 diff --git a/build/exports/Corsairs.dxw b/build/exports/Corsairs.dxw new file mode 100644 index 0000000..6dcee05 --- /dev/null +++ b/build/exports/Corsairs.dxw @@ -0,0 +1,31 @@ +[target] +title0=Corsairs +path0=D:\Games\CORSAIRS\corsairs.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=136314914 +flagg0=1207959552 +flagh0=20 +flagi0=134217732 +flagj0=4224 +flagk0=0 +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/build/exports/Drome Racers.dxw b/build/exports/Drome Racers.dxw new file mode 100644 index 0000000..9ef91b1 --- /dev/null +++ b/build/exports/Drome Racers.dxw @@ -0,0 +1,31 @@ +[target] +title0=Drome Racers +path0=D:\Games\LEGO Interactive\Drome Racers\Drome Racers.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=144711714 +flagg0=1207959552 +flagh0=20 +flagi0=138412036 +flagj0=4224 +flagk0=0 +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/build/exports/Echelon.dxw b/build/exports/Echelon.dxw index 956cf80..f978d4a 100644 --- a/build/exports/Echelon.dxw +++ b/build/exports/Echelon.dxw @@ -3,12 +3,12 @@ title0=Echelon path0=D:\Games\echelon\Game.exe module0= opengllib0= -ver0=0 +ver0=7 coord0=0 -flag0=151011328 -flagg0=134217728 +flag0=134234114 +flagg0=1207959552 flagh0=20 -flagi0=4 +flagi0=4194308 tflag0=0 initx0=0 inity0=0 @@ -24,3 +24,8 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +launchpath0= +notes0= +flagj0=128 +flagk0=0 +swapeffect0=0 diff --git a/build/exports/NetStorm - Islands at War.dxw b/build/exports/NetStorm - Islands at War.dxw index ab4258d..5b71ca4 100644 --- a/build/exports/NetStorm - Islands at War.dxw +++ b/build/exports/NetStorm - Islands at War.dxw @@ -6,7 +6,7 @@ opengllib0= ver0=0 coord0=0 flag0=679608354 -flagg0=1745879296 +flagg0=1209008384 flagh0=20 flagi0=4194308 tflag0=0 diff --git a/build/exports/O.D.T. Escape Or Die Trying.dxw b/build/exports/O.D.T. Escape Or Die Trying.dxw index 508f20b..1902c1c 100644 --- a/build/exports/O.D.T. Escape Or Die Trying.dxw +++ b/build/exports/O.D.T. Escape Or Die Trying.dxw @@ -6,7 +6,7 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=1207959648 +flag0=1207959650 flagg0=1207959552 flagh0=20 flagi0=205520900 @@ -25,3 +25,7 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +notes0= +flagj0=128 +flagk0=0 +swapeffect0=0 diff --git a/build/exports/O.R.B. Offword Rescue Base.dxw b/build/exports/O.R.B. Offword Rescue Base.dxw index 62d09dd..d5da232 100644 --- a/build/exports/O.R.B. Offword Rescue Base.dxw +++ b/build/exports/O.R.B. Offword Rescue Base.dxw @@ -5,7 +5,7 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=134234144 +flag0=134234146 flagg0=1207959552 flagh0=20 flagi0=4194308 @@ -25,3 +25,7 @@ initts0=0 winver0=0 maxres0=-1 launchpath0= +notes0= +flagj0=128 +flagk0=0 +swapeffect0=0 diff --git a/build/exports/Panzer Dragoon.dxw b/build/exports/Panzer Dragoon.dxw index f8d0ef4..d204333 100644 --- a/build/exports/Panzer Dragoon.dxw +++ b/build/exports/Panzer Dragoon.dxw @@ -5,11 +5,11 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=134217762 -flagg0=1207959552 +flag0=681574435 +flagg0=1744830464 flagh0=20 -flagi0=4 -tflag0=67 +flagi0=138412036 +tflag0=0 initx0=0 inity0=0 minx0=0 @@ -22,3 +22,10 @@ sizx0=800 sizy0=600 maxfps0=0 initts0=0 +launchpath0= +notes0= +flagj0=4224 +flagk0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 diff --git a/build/exports/Panzer General 3D Assault.dxw b/build/exports/Panzer General 3D Assault.dxw index 072af26..b86849d 100644 --- a/build/exports/Panzer General 3D Assault.dxw +++ b/build/exports/Panzer General 3D Assault.dxw @@ -5,11 +5,11 @@ module0=PG3Draw opengllib0= ver0=0 coord0=0 -flag0=696254496 +flag0=679477282 flagg0=1207959568 flagh0=65556 -flagi0=4 -tflag0=6210 +flagi0=4194308 +tflag0=-2147477245 initx0=0 inity0=0 minx0=0 @@ -24,3 +24,8 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +launchpath0=D:\Games\Panzer General 3D\PG3.EXE +notes0= +flagj0=128 +flagk0=0 +swapeffect0=0 diff --git a/build/exports/Populous 3 (GOG - D3D).dxw b/build/exports/Populous 3 (GOG - D3D).dxw index 3bfd24c..004cccc 100644 --- a/build/exports/Populous 3 (GOG - D3D).dxw +++ b/build/exports/Populous 3 (GOG - D3D).dxw @@ -5,10 +5,10 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=671105572 -flagg0=134217744 +flag0=671105062 +flagg0=1207959568 flagh0=65556 -flagi0=4 +flagi0=4194308 tflag0=6146 initx0=0 inity0=0 @@ -24,3 +24,8 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +launchpath0= +notes0= +flagj0=128 +flagk0=0 +swapeffect0=0 diff --git a/build/exports/Praetorians.dxw b/build/exports/Praetorians.dxw index a07422a..95ce8ec 100644 --- a/build/exports/Praetorians.dxw +++ b/build/exports/Praetorians.dxw @@ -5,10 +5,10 @@ module0= opengllib0= ver0=0 coord0=0 -flag0=134217760 +flag0=134217762 flagg0=1207959552 flagh0=20 -flagi0=0 +flagi0=4194304 tflag0=259 initx0=0 inity0=0 @@ -22,3 +22,10 @@ sizx0=800 sizy0=600 maxfps0=0 initts0=0 +launchpath0= +notes0= +flagj0=128 +flagk0=0 +winver0=0 +maxres0=0 +swapeffect0=0 diff --git a/build/exports/Prince of Persia 3D Demo.dxw b/build/exports/Prince of Persia 3D Demo.dxw new file mode 100644 index 0000000..6bfc624 --- /dev/null +++ b/build/exports/Prince of Persia 3D Demo.dxw @@ -0,0 +1,31 @@ +[target] +title0=Prince of Persia 3D Demo +path0=D:\Games\Prince of Persia 3D Demo\PoP3DDemo.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=136331298 +flagg0=1207959552 +flagh0=20 +flagi0=136314885 +flagj0=4224 +flagk0=0 +tflag0=-2147477245 +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/build/exports/Project Eden.dxw b/build/exports/Project Eden.dxw index dd04a6e..f529a55 100644 --- a/build/exports/Project Eden.dxw +++ b/build/exports/Project Eden.dxw @@ -8,7 +8,7 @@ coord0=0 flag0=134217763 flagg0=1207959552 flagh0=20 -flagi0=4 +flagi0=4194308 tflag0=64 initx0=0 inity0=0 @@ -24,3 +24,8 @@ maxfps0=0 initts0=0 winver0=0 maxres0=-1 +launchpath0= +notes0= +flagj0=128 +flagk0=0 +swapeffect0=0 diff --git a/build/exports/Psychoballs.dxw b/build/exports/Psychoballs.dxw new file mode 100644 index 0000000..b121f0d --- /dev/null +++ b/build/exports/Psychoballs.dxw @@ -0,0 +1,31 @@ +[target] +title0=Psychoballs +path0=D:\Games\Psychoballs\PsychoBalls.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=136314914 +flagg0=1207959552 +flagh0=20 +flagi0=134217732 +flagj0=4224 +flagk0=0 +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/build/exports/Rift Space.dxw b/build/exports/Rift Space.dxw new file mode 100644 index 0000000..36e6a02 --- /dev/null +++ b/build/exports/Rift Space.dxw @@ -0,0 +1,31 @@ +[target] +title0=Rift Space +path0=D:\Games\RiftSpace\RiftSpace.EXE +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=671105062 +flagg0=1207959552 +flagh0=20 +flagi0=138412036 +flagj0=4224 +flagk0=0 +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/build/exports/Robocop.dxw b/build/exports/Robocop.dxw new file mode 100644 index 0000000..24f76bc --- /dev/null +++ b/build/exports/Robocop.dxw @@ -0,0 +1,31 @@ +[target] +title0=Robocop +path0=D:\Games\Robocop\Robocop.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=136314914 +flagg0=1207959552 +flagh0=20 +flagi0=138412036 +flagj0=4224 +flagk0=0 +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/build/exports/Strength & Honour.dxw b/build/exports/Strength & Honour.dxw new file mode 100644 index 0000000..af97b2a --- /dev/null +++ b/build/exports/Strength & Honour.dxw @@ -0,0 +1,31 @@ +[target] +title0=Strength & Honour +path0=D:\Program Files (x86)\Magitech\SNH\Strength & Honour.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=0 +coord0=0 +flag0=681574434 +flagg0=1744961536 +flagh0=65554 +flagi0=138412036 +flagj0=528576 +flagk0=0 +tflag0=0 +initx0=0 +inity0=0 +minx0=0 +miny0=0 +maxx0=0 +maxy0=0 +posx0=50 +posy0=50 +sizx0=0 +sizy0=0 +maxfps0=0 +initts0=0 +winver0=0 +maxres0=-1 +swapeffect0=0 diff --git a/build/exports/The Hobbit(TM) Demo.dxw b/build/exports/The Hobbit(TM) Demo.dxw new file mode 100644 index 0000000..f547b03 --- /dev/null +++ b/build/exports/The Hobbit(TM) Demo.dxw @@ -0,0 +1,31 @@ +[target] +title0=The Hobbit(TM) Demo +path0=D:\Games\The Hobbit(TM) Demo\MeridianDemo.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=8 +coord0=0 +flag0=134217762 +flagg0=1207959552 +flagh0=20 +flagi0=138412036 +flagj0=4224 +flagk0=0 +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/build/exports/The Hulk Demo.dxw b/build/exports/The Hulk Demo.dxw new file mode 100644 index 0000000..fa8c3df --- /dev/null +++ b/build/exports/The Hulk Demo.dxw @@ -0,0 +1,31 @@ +[target] +title0=The Hulk Demo +path0=D:\Games\The Hulk Demo\hulk_demo.exe +launchpath0= +module0= +opengllib0= +notes0= +ver0=8 +coord0=0 +flag0=679493670 +flagg0=1209008128 +flagh0=20 +flagi0=138412036 +flagj0=4224 +flagk0=0 +tflag0=-2147477241 +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/build/exports/dxwnd.ini b/build/exports/dxwnd.ini new file mode 100644 index 0000000..e334ef2 --- /dev/null +++ b/build/exports/dxwnd.ini @@ -0,0 +1,5 @@ +[window] +posx=1541 +posy=587 +sizx=320 +sizy=200 diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index 4819f8b..d81f782 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -846,4 +846,8 @@ fix: cleaned up some opengl hooking code. Mind possible regressions .... v2.03.28: add: added "Lock / Unlock pitch fix" flag to compensate for pitch change in emulation mode. Fixes "Snowboard racer" slanted graphic add: added "Width not power of 2 fix" flag to compensate for pitch change in emulation mode. Fixes "Microsoft Midtown Madness" slanted graphic -add: debug flag "Highlight Locked surfaces" to highlight service surfaces that are Lock-ed and Unlock-ed. \ No newline at end of file +add: debug flag "Highlight Locked surfaces" to highlight service surfaces that are Lock-ed and Unlock-ed. + +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 diff --git a/dll/dwhide.cpp b/dll/dwhide.cpp index 93438e4..7ab3af9 100644 --- a/dll/dwhide.cpp +++ b/dll/dwhide.cpp @@ -3,6 +3,53 @@ #include #include "dxwnd.h" #include "dxwcore.hpp" +#include "syslibs.h" +#include "dxhelper.h" + +/**************************************************************************** + * Function Name : gShowHideTaskBar() * + * Parameters : BOOL bHide (flag to toggle Show/Hide of Taskbar) * + * Return type : void * + * Purpose : Function is used to Show/Hide the TaskBar * + * Author : Ashutosh R. Bhatikar (ARB) * + * Date written : 20th December 2000 * + * Modification History : * + * Date of modification Reason * + * 25th December 2000 Added methods to Show/Hide menu * + ****************************************************************************/ + +void gShowHideTaskBar(BOOL bHide /*=FALSE*/) +{ + RECT rectWorkArea; + RECT rectTaskBar; + static HWND pWnd = NULL; + static HWND pStart = NULL; + + if(!pWnd) { + pWnd = FindWindow("Shell_TrayWnd", ""); + // WinXP find + pStart = FindWindowEx(pWnd, NULL, "Button", NULL); + // if unsuccessful, do a Win7/8 find + if(!pStart) pStart = FindWindowEx((*pGetDesktopWindow)(), NULL, "Button", "Start"); + } + + (*pSystemParametersInfoA)(SPI_GETWORKAREA,0, (LPVOID)&rectWorkArea, 0); + (*pGetWindowRect)(pWnd, &rectTaskBar); + if( bHide ){ + // Code to Hide the System Task Bar + rectWorkArea.bottom += (rectTaskBar.bottom - rectTaskBar.top); + (*pSystemParametersInfoA)(SPI_SETWORKAREA, 0, (LPVOID)&rectWorkArea, 0); + ShowWindow(pWnd, SW_HIDE); + ShowWindow(pStart, SW_HIDE); + } + else{ + // Code to Show the System Task Bar + rectWorkArea.bottom -= (rectTaskBar.bottom - rectTaskBar.top); + (*pSystemParametersInfoA)(SPI_SETWORKAREA, 0, (LPVOID)&rectWorkArea, 0); + ShowWindow(pWnd, SW_SHOW); + ShowWindow(pStart, SW_SHOW); + } +} static bool quit = false; @@ -83,6 +130,14 @@ void dxwCore::HideDesktop(HWND hwnd) return; } + if(dxw.dwFlags6 & HIDETASKBAR){ + wDesktop.left = 0; + wDesktop.top = 0; + wDesktop.right = (*pGetSystemMetrics)(SM_CXSCREEN); + wDesktop.bottom = (*pGetSystemMetrics)(SM_CYSCREEN); + gShowHideTaskBar(TRUE); + } + // this is tricky: if you create a window with zero style, the manager seems to apply a default // overlapped window style. The only way I got to be sure that the style is exactly nothing // at all is to repeat the command by a SetWindowLong(hwnd, GWL_STYLE, 0) that sets again zero diff --git a/dll/dxhook.cpp b/dll/dxhook.cpp index e1c2413..382ca2b 100644 --- a/dll/dxhook.cpp +++ b/dll/dxhook.cpp @@ -1055,6 +1055,14 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp if (dxw.dwFlags1 & CLIPCURSOR) dxw.EraseClipCursor(); if (dxw.dwFlags1 & ENABLECLIPPING) (*pClipCursor)(NULL); break; + case WM_QUIT: + case WM_DESTROY: + case WM_CLOSE: + if(dxw.dwFlags6 & HIDETASKBAR){ + extern void gShowHideTaskBar(BOOL); + gShowHideTaskBar(FALSE); + } + break; // commented out: WM_CLOSE just issue a request to close the window, not the process! It should be WM_QUIT.... //case WM_CLOSE: // OutTraceDW("WindowProc: WM_CLOSE - terminating process\n"); diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index eb3ca8f..23b0f63 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.28" +#define VERSION "2.03.29" #define DDTHREADLOCK 1 //#define LOCKTHREADS diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index 60e1a66..d1b1b76 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/hd3d7.cpp b/dll/hd3d7.cpp index 49582d5..2d42224 100644 --- a/dll/hd3d7.cpp +++ b/dll/hd3d7.cpp @@ -59,6 +59,7 @@ HRESULT WINAPI extEnumZBufferFormats(void *, REFCLSID, LPD3DENUMPIXELFORMATSCALL // Direct3DDevice-n interfaces +typedef HRESULT (WINAPI *QueryInterfaceD3D_Type)(void *, REFIID, LPVOID *); typedef HRESULT (WINAPI *D3DInitialize_Type)(void *, LPDIRECT3D , LPGUID, LPD3DDEVICEDESC); typedef HRESULT (WINAPI *D3DGetCaps_Type)(void *, LPD3DDEVICEDESC ,LPD3DDEVICEDESC); typedef HRESULT (WINAPI *D3DGetCaps3_Type)(void *, LPD3DDEVICEDESC, LPD3DDEVICEDESC); @@ -79,6 +80,7 @@ typedef HRESULT (WINAPI *SetTexture7_Type)(void *, DWORD, LPDIRECTDRAWSURFACE7); typedef HRESULT (WINAPI *SwapTextureHandles_Type)(void *, LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE); typedef HRESULT (WINAPI *SwapTextureHandles2_Type)(void *, LPDIRECT3DTEXTURE2, LPDIRECT3DTEXTURE2); +QueryInterfaceD3_Type pQueryInterfaceD3D = NULL; D3DInitialize_Type pD3DInitialize = NULL; D3DGetCaps_Type pD3DGetCaps = NULL; D3DGetCaps3_Type pGetCaps3 = NULL; @@ -168,6 +170,7 @@ HRESULT WINAPI extGetViewport(void *, LPD3DVIEWPORT); HRESULT WINAPI extSetMaterial(void *, LPD3DMATERIAL); HRESULT WINAPI extGetMaterial(void *, LPD3DMATERIAL); HRESULT WINAPI extQueryInterfaceD3(void *, REFIID, LPVOID *); +HRESULT WINAPI extQueryInterfaceD3D(void *, REFIID, LPVOID *); HRESULT WINAPI extD3DInitialize(void *, LPDIRECT3D , LPGUID, LPD3DDEVICEDESC); HRESULT WINAPI extD3DGetCaps(void *, LPD3DDEVICEDESC ,LPD3DDEVICEDESC); @@ -410,7 +413,6 @@ void HookDirect3DSession(LPDIRECTDRAW *lplpdd, int d3dversion) } } - void HookDirect3DDevice(void **lpd3ddev, int d3dversion) { OutTraceD3D("HookDirect3DDevice: d3ddev=%x d3dversion=%d\n", lpd3ddev, d3dversion); @@ -418,7 +420,7 @@ void HookDirect3DDevice(void **lpd3ddev, int d3dversion) switch(d3dversion){ case 1: - SetHook((void *)(**(DWORD **)lpd3ddev + 0), extQueryInterfaceD3, (void **)&pQueryInterfaceD3, "QueryInterface(D3D)"); + //SetHook((void *)(**(DWORD **)lpd3ddev + 0), extQueryInterfaceD3D, (void **)&pQueryInterfaceD3D, "QueryInterface(D3D)"); //SetHook((void *)(**(DWORD **)lpd3ddev + 16), extGetCaps1, (void **)&pGetCaps1, "GetCaps(1)"); SetHook((void *)(**(DWORD **)lpd3ddev + 20), extSwapTextureHandles, (void **)&pSwapTextureHandles, "SwapTextureHandles(1)"); SetHook((void *)(**(DWORD **)lpd3ddev + 36), extAddViewport1, (void **)&pAddViewport1, "AddViewport(1)"); @@ -428,7 +430,7 @@ void HookDirect3DDevice(void **lpd3ddev, int d3dversion) SetHook((void *)(**(DWORD **)lpd3ddev + 80), extEndScene1, (void **)&pEndScene1, "EndScene(1)"); break; case 2: - SetHook((void *)(**(DWORD **)lpd3ddev + 0), extQueryInterfaceD3, (void **)&pQueryInterfaceD3, "QueryInterface(D3D)"); + //SetHook((void *)(**(DWORD **)lpd3ddev + 0), extQueryInterfaceD3D, (void **)&pQueryInterfaceD3D, "QueryInterface(D3D)"); //SetHook((void *)(**(DWORD **)lpd3ddev + 12), extGetCaps2, (void **)&pGetCaps2, "GetCaps(2)"); SetHook((void *)(**(DWORD **)lpd3ddev + 16), extSwapTextureHandles, (void **)&pSwapTextureHandles, "SwapTextureHandles(1)"); SetHook((void *)(**(DWORD **)lpd3ddev + 24), extAddViewport2, (void **)&pAddViewport2, "AddViewport(2)"); @@ -446,7 +448,7 @@ void HookDirect3DDevice(void **lpd3ddev, int d3dversion) } break; case 3: - SetHook((void *)(**(DWORD **)lpd3ddev + 0), extQueryInterfaceD3, (void **)&pQueryInterfaceD3, "QueryInterface(D3D)"); + //SetHook((void *)(**(DWORD **)lpd3ddev + 0), extQueryInterfaceD3D, (void **)&pQueryInterfaceD3D, "QueryInterface(D3D)"); SetHook((void *)(**(DWORD **)lpd3ddev + 12), extGetCaps3, (void **)&pGetCaps3, "GetCaps(3)"); SetHook((void *)(**(DWORD **)lpd3ddev + 20), extAddViewport3, (void **)&pAddViewport3, "AddViewport(3)"); SetHook((void *)(**(DWORD **)lpd3ddev + 36), extBeginScene3, (void **)&pBeginScene3, "BeginScene(3)"); @@ -463,7 +465,7 @@ void HookDirect3DDevice(void **lpd3ddev, int d3dversion) } break; case 7: - SetHook((void *)(**(DWORD **)lpd3ddev + 0), extQueryInterfaceD3, (void **)&pQueryInterfaceD3, "QueryInterface(D3D)"); + //SetHook((void *)(**(DWORD **)lpd3ddev + 0), extQueryInterfaceD3D, (void **)&pQueryInterfaceD3D, "QueryInterface(D3D)"); //SetHook((void *)(**(DWORD **)lpd3ddev + 20), extBeginScene7, (void **)&pBeginScene7, "BeginScene(7)"); //SetHook((void *)(**(DWORD **)lpd3ddev + 24), extEndScene7, (void **)&pEndScene7, "EndScene(7)"); //SetHook((void *)(**(DWORD **)lpd3ddev + 52), extSetViewport7, (void **)&pSetViewport7, "SetViewport(7)"); @@ -642,6 +644,14 @@ HRESULT WINAPI extQueryInterfaceD3(void *lpd3d, REFIID riid, LPVOID *ppvObj) return res; } +HRESULT WINAPI extQueryInterfaceD3D(void *lpd3ddev, REFIID riid, LPVOID *ppvObj) +{ + HRESULT res; + OutTraceD3D("QueryInterface(D3D): d3ddev=%x REFIID=%x obj=%x\n", lpd3ddev, riid.Data1, ppvObj); + res=(*pQueryInterfaceD3)(lpd3ddev, riid, ppvObj); + return res; +} + HRESULT WINAPI extInitialize(void *lpd3d) { HRESULT res; diff --git a/host/CoolUtils.cpp b/host/CoolUtils.cpp new file mode 100644 index 0000000..d0a330a --- /dev/null +++ b/host/CoolUtils.cpp @@ -0,0 +1,132 @@ +#include "stdafx.h" +#include "CoolUtils.h" + +/**************************************************************************** + * Function Name : gShowHideTaskBar() * + * Parameters : BOOL bHide (flag to toggle Show/Hide of Taskbar) * + * Return type : void * + * Purpose : Function is used to Show/Hide the TaskBar * + * Author : Ashutosh R. Bhatikar (ARB) * + * Date written : 20th December 2000 * + * Modification History : * + * Date of modification Reason * + * 25th December 2000 Added methods to Show/Hide menu * + ****************************************************************************/ + +void gShowHideTaskBar(BOOL bHide /*=FALSE*/) +{ + CRect rectWorkArea = CRect(0,0,0,0); + CRect rectTaskBar = CRect(0,0,0,0); + static HMENU hMenu = NULL; + + CWnd *pWnd = CWnd::FindWindow("Shell_TrayWnd", ""); + //CWnd *pDesktopWnd = CWnd::GetDesktopWindow(); + CWnd *pStart; + + if( bHide ) + { + // Code to Hide the System Task Bar + SystemParametersInfo(SPI_GETWORKAREA, + 0, + (LPVOID)&rectWorkArea, + 0); + + if( pWnd ) + { + pWnd->GetWindowRect(rectTaskBar); + rectWorkArea.bottom += rectTaskBar.Height(); + SystemParametersInfo(SPI_SETWORKAREA, + 0, + (LPVOID)&rectWorkArea, + 0); + + pWnd->ShowWindow(SW_HIDE); + + //This will retrieve the Handle of Start Button using the above + // handle and class name of start Button. + pStart = pWnd->FindWindow("Button", NULL); + pStart->ShowWindow(SW_HIDE); + } + } + else + { + // Code to Show the System Task Bar + SystemParametersInfo(SPI_GETWORKAREA, + 0, + (LPVOID)&rectWorkArea, + 0); + if( pWnd ) + { + pWnd->GetWindowRect(rectTaskBar); + rectWorkArea.bottom -= rectTaskBar.Height(); + SystemParametersInfo(SPI_SETWORKAREA, + 0, + (LPVOID)&rectWorkArea, + 0); + + pWnd->ShowWindow(SW_SHOW); + + //This will retrieve the Handle of Start Button using the above + // handle and class name of start Button. + pStart = pWnd->FindWindow("Button", NULL); + pStart->ShowWindow(SW_SHOW); + } + } +} + +/**************************************************************************** + * Function Name : gHideMenu() * + * Parameters : CWnd* pWnd (Window associated with the menu) * + * Return type : HMENU * + * Purpose : Function hides the menu associated with pWnd * + * Author : Ashutosh R. Bhatikar (ARB) * + * Date written : 25nd December 2000 * + * Modification History : * + * Date of modification Reason * + ****************************************************************************/ + +HMENU gHideMenu(/*in*/CWnd* pWnd) +{ + HMENU hMenu = ::GetMenu(pWnd->GetSafeHwnd()); + if (hMenu != NULL) + { + // Invalidate before SetMenu since we are going to replace + // the frame's client area anyway + pWnd->Invalidate(); + pWnd->SetMenu(NULL); + if( pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)) ) + { + CFrameWnd* pFrameWnd = (CFrameWnd*)pWnd; + // avoid any idle menu processing + pFrameWnd->m_nIdleFlags &= ~CFrameWnd::idleMenu; + } + return hMenu; + } + return NULL; +} + +/**************************************************************************** + * Function Name : gShowMenuBack() * + * Parameters : HMENU hMenu (Handle of the menu which was hidden) * + * CWnd* pWnd (Window associated with the menu) * + * Return type : BOOL * + * Purpose : Function shows back the menu associated with pWnd * + * Author : Ashutosh R. Bhatikar (ARB) * + * Date written : 25nd December 2000 * + * Modification History : * + * Date of modification Reason * + ****************************************************************************/ + +BOOL gShowMenuBack(/*in*/HMENU hMenu, /*in*/CWnd* pWnd) +{ + // put the menu back in place if it was removed before + if (hMenu != NULL) + { + // Invalidate before SetMenu since we are going to replace + // the frame's client area anyway + pWnd->Invalidate(); + ::SetMenu(pWnd->GetSafeHwnd(), hMenu); + return TRUE; + } + return FALSE; +} diff --git a/host/CoolUtils.h b/host/CoolUtils.h new file mode 100644 index 0000000..9a4644f --- /dev/null +++ b/host/CoolUtils.h @@ -0,0 +1,11 @@ +#ifndef __COOLUTILS_H +#define __COOLUTILS_H +#include "stdafx.h" + +void gShowHideTaskBar(/*in*/BOOL bHide = FALSE); + +HMENU gHideMenu(/*in*/CWnd* pWnd); + +BOOL gShowMenuBack(/*in*/HMENU hMenu, /*in*/CWnd* pWnd); + +#endif \ No newline at end of file diff --git a/host/TabWindow.cpp b/host/TabWindow.cpp index 233f0ea..94ef8fa 100644 --- a/host/TabWindow.cpp +++ b/host/TabWindow.cpp @@ -44,6 +44,7 @@ void CTabWindow::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_FIXD3DFRAME, cTarget->m_FixD3DFrame); DDX_Check(pDX, IDC_NOWINDOWMOVE, cTarget->m_NoWindowMove); DDX_Check(pDX, IDC_HIDEDESKTOP, cTarget->m_HideDesktop); + DDX_Check(pDX, IDC_HIDETASKBAR, cTarget->m_HideTaskbar); DDX_Check(pDX, IDC_UNLOCKZORDER, cTarget->m_UnlockZOrder); DDX_Check(pDX, IDC_NODESTROYWINDOW, cTarget->m_NoDestroyWindow); diff --git a/host/TargetDlg.cpp b/host/TargetDlg.cpp index a92a1ba..631ddf4 100644 --- a/host/TargetDlg.cpp +++ b/host/TargetDlg.cpp @@ -59,6 +59,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_ReturnNullRef = FALSE; m_NoD3DReset = FALSE; m_HideDesktop = FALSE; + m_HideTaskbar = FALSE; m_UnlockZOrder = FALSE; m_NoDestroyWindow = FALSE; m_LockSysColors = FALSE; diff --git a/host/TargetDlg.h b/host/TargetDlg.h index 5b6d793..f8d8aaa 100644 --- a/host/TargetDlg.h +++ b/host/TargetDlg.h @@ -186,6 +186,7 @@ public: BOOL m_ReturnNullRef; BOOL m_NoD3DReset; BOOL m_HideDesktop; + BOOL m_HideTaskbar; BOOL m_UnlockZOrder; BOOL m_NoDestroyWindow; BOOL m_LockSysColors; diff --git a/host/dxwndhost.rc b/host/dxwndhost.rc index 9cef16a..80e4ae9 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 8b0b821..f7667b2 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ diff --git a/host/dxwndhost.vs2008.vcproj b/host/dxwndhost.vs2008.vcproj index 5be5528..f0fd80a 100644 --- a/host/dxwndhost.vs2008.vcproj +++ b/host/dxwndhost.vs2008.vcproj @@ -219,6 +219,10 @@ Name="Source Files" Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > + + @@ -474,6 +478,10 @@ RelativePath=".\cdib.h" > + + diff --git a/host/dxwndhostView.cpp b/host/dxwndhostView.cpp index 5d019af..c3dab67 100644 --- a/host/dxwndhostView.cpp +++ b/host/dxwndhostView.cpp @@ -4,6 +4,7 @@ #include "stdafx.h" #include "shlwapi.h" #include "TlHelp32.h" +#include "CoolUtils.h" #include "dxwndhost.h" @@ -103,7 +104,9 @@ BEGIN_MESSAGE_MAP(CDxwndhostView, CListView) ON_COMMAND(ID_WINDOW_MINIMIZE, OnWindowMinimize) ON_COMMAND(ID_WINDOW_RESTORE, OnWindowRestore) ON_COMMAND(ID_WINDOW_CLOSE, OnWindowClose) - ON_COMMAND(ID_ADD, OnAdd) + ON_COMMAND(ID_WINDOW_MINIMIZE, OnWindowMinimize) + ON_COMMAND(ID_TASKBAR_HIDE, OnTaskbarHide) + ON_COMMAND(ID_TASKBAR_SHOW, OnTaskbarShow) ON_COMMAND(ID_MODIFY, OnModify) ON_COMMAND(ID_PEXPORT, OnExport) ON_COMMAND(ID_PKILL, OnProcessKill) @@ -288,6 +291,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg) if(dlg->m_ReturnNullRef) t->flags4 |= RETURNNULLREF; if(dlg->m_NoD3DReset) t->flags4 |= NOD3DRESET; if(dlg->m_HideDesktop) t->flags4 |= HIDEDESKTOP; + if(dlg->m_HideTaskbar) t->flags6 |= HIDETASKBAR; if(dlg->m_UnlockZOrder) t->flags5 |= UNLOCKZORDER; if(dlg->m_NoDestroyWindow) t->flags6 |= NODESTROYWINDOW; if(dlg->m_LockSysColors) t->flags3 |= LOCKSYSCOLORS; @@ -495,6 +499,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg) dlg->m_ReturnNullRef = t->flags4 & RETURNNULLREF ? 1 : 0; 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_UnlockZOrder = t->flags5 & UNLOCKZORDER ? 1 : 0; dlg->m_NoDestroyWindow = t->flags6 & NODESTROYWINDOW ? 1 : 0; dlg->m_LockSysColors = t->flags3 & LOCKSYSCOLORS ? 1 : 0; @@ -1401,6 +1406,16 @@ void CDxwndhostView::OnWindowClose() ::PostMessage(find_main_window(DxWndStatus.dwPid), WM_SYSCOMMAND, SC_CLOSE, 0); } +void CDxwndhostView::OnTaskbarHide() +{ + gShowHideTaskBar(TRUE); +} + +void CDxwndhostView::OnTaskbarShow() +{ + gShowHideTaskBar(FALSE); +} + void CDxwndhostView::OnKill() { CTargetDlg dlg; diff --git a/host/dxwndhostView.h b/host/dxwndhostView.h index a6b306d..83247f7 100644 --- a/host/dxwndhostView.h +++ b/host/dxwndhostView.h @@ -73,6 +73,8 @@ protected: afx_msg void OnWindowRestore(); afx_msg void OnWindowMinimize(); afx_msg void OnWindowClose(); + afx_msg void OnTaskbarHide(); + afx_msg void OnTaskbarShow(); afx_msg void OnSort(); afx_msg void OnViewLog(); afx_msg void OnDeleteLog(); diff --git a/host/resource b/host/resource index 6e962ac..abcc3ae 100644 Binary files a/host/resource and b/host/resource differ