1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00

v2_03_29_src

Former-commit-id: 049d5d6551dc7611af43f2612f6eb46a55631a48
This commit is contained in:
gho tik 2015-07-14 12:41:06 -04:00 committed by Refael ACkermann
parent 5fb3701aa4
commit 8a06623101
39 changed files with 606 additions and 31 deletions

View File

@ -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

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bd9f3a8d1c620b34bb5d445bab38ed6510a486f2f3bdbde661a4a8d3d3c2052f
oid sha256:427b51e427648a3f526882f2ed47eb400830ad367e5484f9fce47a94aab837b9
size 578048

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5be9b2e6e65b9ed2d920418acc46bbfb48166515b1ad5d47f5c17854d73c5041
size 540672
oid sha256:e15db53d932535d67b361f33febb9c9a52b3c5d3c0552f1b4f857fa0f4ac868c
size 541184

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -6,7 +6,7 @@ opengllib0=
ver0=0
coord0=0
flag0=679608354
flagg0=1745879296
flagg0=1209008384
flagh0=20
flagi0=4194308
tflag0=0

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

31
build/exports/Robocop.dxw Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

5
build/exports/dxwnd.ini Normal file
View File

@ -0,0 +1,5 @@
[window]
posx=1541
posy=587
sizx=320
sizy=200

View File

@ -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.
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.

View File

@ -3,6 +3,53 @@
#include <stdio.h>
#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

View File

@ -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");

View File

@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "TlHelp32.h"
#define VERSION "2.03.28"
#define VERSION "2.03.29"
#define DDTHREADLOCK 1
//#define LOCKTHREADS

Binary file not shown.

View File

@ -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;

132
host/CoolUtils.cpp Normal file
View File

@ -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;
}

11
host/CoolUtils.h Normal file
View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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;

Binary file not shown.

Binary file not shown.

View File

@ -219,6 +219,10 @@
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath=".\CoolUtils.cpp"
>
</File>
<File
RelativePath=".\CppUACSelfElevation.cpp"
>
@ -474,6 +478,10 @@
RelativePath=".\cdib.h"
>
</File>
<File
RelativePath=".\CoolUtils.h"
>
</File>
<File
RelativePath=".\DesktopDialog.h"
>

View File

@ -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;

View File

@ -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();

Binary file not shown.