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

v2_02_55_src

Former-commit-id: 5a25f9b3a017431a7451b1414f853424f2967cdf
This commit is contained in:
gho tik 2014-01-24 11:38:44 -05:00 committed by Refael ACkermann
parent 69f263988a
commit 7adb204c0f
23 changed files with 190 additions and 9 deletions

View File

@ -128,6 +128,7 @@
#define LIMITSCREENRES 0x00001000 // Limit available screen resolution up to defined maximum
#define NOFILLRECT 0x00002000 // Suppress FillRect calls
#define HOOKGLIDE 0x00004000 // Hook glide calls
#define HIDEDESKTOP 0x00004000 // Hide desktop background
// 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:f5ca6f4d3ce49c5e35b6ced416a8e48d7948813d8994ff1fefcb656817359bb8
size 448512
oid sha256:204b88153c343d4bd1b32eadbb4f2c0267ad6f3147cf813cf591084e27893061
size 450048

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6b5fbb1db51dc2da5ddf88d048bb24471391cc9f1ff80e96a27c916198cc6f4b
oid sha256:a63a5100db9d65c9b66846c79b6cb41578fccabd9de5bb4ba788b371bb72b25f
size 535040

View File

@ -0,0 +1,26 @@
[target]
title0=Blade Runner
path0=D:\Games\blade runner\BLADE.EXE
module0=
opengllib0=
ver0=0
coord0=0
flag0=134234210
flagg0=1480589320
flagh0=2580
flagi0=16388
tflag0=6211
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

View File

@ -376,4 +376,5 @@ eliminated "Disable HAL support", no longer necessary
some incomplete work on gdi game handling
added preliminary, incomplete (not working) glide handling
v2.02.54
added "Hide desktop background" video option

View File

@ -93,6 +93,7 @@ HRESULT WINAPI extUnlockDir4(LPDIRECTDRAWSURFACE, LPRECT);
HRESULT WINAPI extUnlockDir1(LPDIRECTDRAWSURFACE, LPVOID);
HRESULT WINAPI extCreateSurface(int, CreateSurface_Type, LPDIRECTDRAW, DDSURFACEDESC2 *, LPDIRECTDRAWSURFACE *, void *);
HRESULT WINAPI extSetSurfaceDesc(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, DWORD);
// DirectDrawClipper
HRESULT WINAPI extReleaseC(LPDIRECTDRAWCLIPPER);
@ -202,6 +203,7 @@ Unlock4_Type pUnlock4;
UpdateOverlay_Type pUpdateOverlay;
UpdateOverlayDisplay_Type pUpdateOverlayDisplay;
UpdateOverlayZOrder_Type pUpdateOverlayZOrder;
SetSurfaceDesc_Type pSetSurfaceDesc;
/* DirectDrawClipper hook pointers */
QueryInterface_Type pQueryInterfaceC;
@ -1219,6 +1221,9 @@ static void HookDDSurfaceGeneric(LPDIRECTDRAWSURFACE *lplpdds, int dxversion)
SetHook((void *)(**(DWORD **)lplpdds + 128), extUnlockDir4, (void **)&pUnlock4, "Unlock(S4)");
}
if (dxversion == 7)
SetHook((void *)(**(DWORD **)lplpdds + 156), extSetSurfaceDesc, (void **)&pSetSurfaceDesc, "SetSurfaceDesc(S3)");
if (!(dxw.dwTFlags & OUTPROXYTRACE)) return;
// just proxed ....
@ -4487,7 +4492,7 @@ HRESULT WINAPI extDDGetGammaRamp(LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags, LPDDG
OutTraceDDRAW("GetAvailableVidMem(D): lpdd=%x\n", lpdd);
res=(*pGetAvailableVidMem)(lpdd, lpDDSCaps, lpdwTotal, lpdwFree);
if(res){
OutTraceDW("GetAvailableVidMem(D): ERROR res=%x(%s)\n", res, ExplainDDError(res));
OutTraceE("GetAvailableVidMem(D): ERROR res=%x(%s)\n", res, ExplainDDError(res));
}
else {
OutTraceDW("GetAvailableVidMem(D): DDSCaps=%x(%s) Total=%x Free=%x\n",
@ -4526,3 +4531,12 @@ HRESULT WINAPI extGetAvailableVidMem4(LPDIRECTDRAW lpdd, LPDDSCAPS lpDDSCaps, LP
{
return extGetAvailableVidMem(lpdd, lpDDSCaps, lpdwTotal, lpdwFree, pGetAvailableVidMem4);
}
HRESULT WINAPI extSetSurfaceDesc(LPDIRECTDRAWSURFACE lpdds, LPDDSURFACEDESC lpDDsd2, DWORD dwFlags)
{
HRESULT res;
OutTrace("SetSurfaceDesc: REACHED\n");
res = (*pSetSurfaceDesc)(lpdds, lpDDsd2, dwFlags);
OutTraceE("SetSurfaceDesc: ERROR res=%x(%s)\n", res, ExplainDDError(res));
return res;
}

123
dll/dwhide.cpp Normal file
View File

@ -0,0 +1,123 @@
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include "dxwnd.h"
#include "dxwcore.hpp"
static bool quit = false;
static LRESULT CALLBACK Hider_Message_Handler(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM lparam)
{
switch(umsg)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_CLOSE:
quit = true;
break;
}
return DefWindowProc(hwnd, umsg, wparam, lparam);
}
void dxwCore::HideDesktop(HWND hwnd)
{
static BOOL DoOnce=TRUE;
static ATOM aClass;
static HWND wleft=0, wright=0, wtop=0, wbottom=0;
RECT wRect, wDesktop;
static HINSTANCE hinst=NULL;
if(DoOnce){
WNDCLASSEX WndClsEx;
DoOnce=FALSE;
#ifdef DISABLEAERODESKTOP
typedef HRESULT (WINAPI *DwmEnableComposition_Type)(UINT);
DwmEnableComposition_Type pDwmEnableComposition;
HMODULE hlib;
// try to disable AERO desktop interface, if possible ...
pDwmEnableComposition = NULL;
hlib=(*pLoadLibraryA)("dwmapi.dll");
if(hlib){
pDwmEnableComposition = (DwmEnableComposition_Type)(*pGetProcAddress)(hlib, "DwmEnableComposition");
}
if(pDwmEnableComposition) {
(*pDwmEnableComposition)(FALSE);
}
#endif
hinst=GetModuleHandle(NULL);
if(!hinst)
OutTrace("GetModuleHandle ERROR err=%d\n", GetLastError());
else
OutTrace("GetModuleHandle hinst=%x\n", hinst);
WndClsEx.cbSize = sizeof(WNDCLASSEX);
WndClsEx.style = 0;
WndClsEx.lpfnWndProc = Hider_Message_Handler; //DefWindowProc;
WndClsEx.cbClsExtra = 0;
WndClsEx.cbWndExtra = 0;
WndClsEx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
//WndClsEx.hCursor = LoadCursor(NULL, IDC_CROSS);
WndClsEx.hCursor = NULL;
WndClsEx.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
//WndClsEx.hbrBackground = CreateSolidBrush(RGB(200,0,0));
WndClsEx.lpszMenuName = NULL;
WndClsEx.lpszClassName = "dxwnd:hider";
WndClsEx.hInstance = hinst;
WndClsEx.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
// Register the application
aClass=RegisterClassEx(&WndClsEx);
if(!aClass) OutTraceE("RegisterClassEx: ERROR err=%d\n", GetLastError());
}
if(!(*pGetWindowRect)(hwnd, &wRect)) {
OutTrace("GetWindowRect ERROR hwnd=%x err=%d\n", hWnd, GetLastError());
return;
}
if(!(*pGetWindowRect)((*pGetDesktopWindow)(), &wDesktop)) {
OutTrace("GetWindowRect ERROR hwnd=%x err=%d\n", NULL, GetLastError());
return;
}
// 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
// as the correct window style.
HWND hParent = (*pGetDesktopWindow)();
if(!wleft) {
wleft=(*pCreateWindowExA)(0, "dxwnd:hider", "hider", 0, 0, 0, 0, 0, hParent, NULL, hinst, NULL);
(*pSetWindowLong)(wleft, GWL_STYLE, 0);
}
if(!wright) {
wright=(*pCreateWindowExA)(0, "dxwnd:hider", "hider", 0, 0, 0, 0, 0, hParent, NULL, hinst, NULL);
(*pSetWindowLong)(wright, GWL_STYLE, 0);
}
if(!wtop) {
wtop=(*pCreateWindowExA)(0, "dxwnd:hider", "hider", 0, 0, 0, 0, 0, hParent, NULL, hinst, NULL);
(*pSetWindowLong)(wtop, GWL_STYLE, 0);
}
if(!wbottom) {
wbottom=(*pCreateWindowExA)(0, "dxwnd:hider", "hider", 0, 0, 0, 0, 0, hParent, NULL, hinst, NULL);
(*pSetWindowLong)(wbottom, GWL_STYLE, 0);
}
(*pMoveWindow)(wleft, wDesktop.left, wDesktop.top, wRect.left, wDesktop.bottom, TRUE);
(*pMoveWindow)(wright, wRect.right, wDesktop.top, wDesktop.right-wRect.right, wDesktop.bottom, TRUE);
(*pMoveWindow)(wtop, wDesktop.left, wDesktop.top, wDesktop.right, wRect.top-wDesktop.top, TRUE);
(*pMoveWindow)(wbottom, wDesktop.left, wRect.bottom, wDesktop.right, wDesktop.bottom-wRect.bottom, TRUE);
(*pSetWindowLong)(wleft, GWL_EXSTYLE, WS_EX_TOPMOST);
(*pSetWindowLong)(wright, GWL_EXSTYLE, WS_EX_TOPMOST);
(*pSetWindowLong)(wtop, GWL_EXSTYLE, WS_EX_TOPMOST);
(*pSetWindowLong)(wbottom, GWL_EXSTYLE, WS_EX_TOPMOST);
(*pShowWindow)(wleft, SW_SHOW);
(*pShowWindow)(wright, SW_SHOW);
(*pShowWindow)(wtop, SW_SHOW);
(*pShowWindow)(wbottom, SW_SHOW);
}

View File

@ -545,6 +545,7 @@ void AdjustWindowPos(HWND hwnd, DWORD width, DWORD height)
if(dxw.dwFlags2 & SUPPRESSIME) SuppressIMEWindow();
dxw.ShowBanner(hwnd);
if(dxw.dwFlags4 & HIDEDESKTOP) dxw.HideDesktop(dxw.GethWnd());
return;
}
@ -917,10 +918,11 @@ LRESULT CALLBACK extWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
dxw.dwFlags1 |= LOCKWINPOS;
dx_UpdatePositionLock(hwnd);
}
if (dxw.dwFlags1 & HIDEHWCURSOR) while((*pShowCursor)(0) >= 0);
if (dxw.dwFlags2 & SHOWHWCURSOR) while((*pShowCursor)(1) < 0);
if(dxw.dwFlags1 & HIDEHWCURSOR) while((*pShowCursor)(0) >= 0);
if(dxw.dwFlags2 & SHOWHWCURSOR) while((*pShowCursor)(1) < 0);
if(dxw.dwFlags1 & ENABLECLIPPING) extClipCursor(lpClipRegion);
if(dxw.dwFlags2 & REFRESHONRESIZE) dxw.ScreenRefresh();
if(dxw.dwFlags4 & HIDEDESKTOP) dxw.HideDesktop(dxw.GethWnd());
break;
case WM_ACTIVATE:
dxw.bActive = (LOWORD(wparam) == WA_ACTIVE || LOWORD(wparam) == WA_CLICKACTIVE) ? 1 : 0;

View File

@ -94,6 +94,7 @@ public: // methods
char *GetTSCaption(int);
void DoSlow(int);
void ShowBanner(HWND);
void HideDesktop(HWND);
POINT ScreenToClient(POINT);
int GetDLLIndex(char *);
void FixStyle(char *, HWND, WPARAM, LPARAM);

View File

@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "dxwnd.h"
#include "dxwcore.hpp"
#define VERSION "2.02.54"
#define VERSION "2.02.55"
#define DDTHREADLOCK 1

BIN
dll/dxwnd.suo Normal file

Binary file not shown.

Binary file not shown.

View File

@ -264,6 +264,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\dwhide.cpp"
>
</File>
<File
RelativePath=".\dxdiaghook.cpp"
>

View File

@ -95,6 +95,8 @@ typedef HRESULT (WINAPI *Unlock4_Type)(LPDIRECTDRAWSURFACE, LPRECT);
typedef HRESULT (WINAPI *UpdateOverlay_Type)(LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, LPDDOVERLAYFX);
typedef HRESULT (WINAPI *UpdateOverlayDisplay_Type) (LPDIRECTDRAWSURFACE, DWORD);
typedef HRESULT (WINAPI *UpdateOverlayZOrder_Type)(LPDIRECTDRAWSURFACE, DWORD, LPDIRECTDRAWSURFACE);
typedef HRESULT (WINAPI *SetSurfaceDesc_Type)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, DWORD);
// DirectDrawClipper
typedef HRESULT (WINAPI *AddRefC_Type)(LPDIRECTDRAWCLIPPER);
typedef HRESULT (WINAPI *ReleaseC_Type)(LPDIRECTDRAWCLIPPER);

View File

@ -504,7 +504,7 @@ BOOL WINAPI extShowWindow(HWND hwnd, int nCmdShow)
nCmdShow=SW_SHOWNORMAL;
}
}
}
}
res=(*pShowWindow)(hwnd, nCmdShow);

View File

@ -202,6 +202,7 @@
#define IDC_ADDPROXYLIBS 1160
#define IDC_INTERCEPTRDTSC 1161
#define IDC_NOFILLRECT 1162
#define IDC_HIDEDESKTOP 1163
#define ID_MODIFY 32771
#define ID_DELETE 32772
#define ID_ADD 32773

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_SUPPRESSCHILD, cTarget->m_SuppressChild);
DDX_Check(pDX, IDC_HIDEDESKTOP, cTarget->m_HideDesktop);
// color management
DDX_Check(pDX, IDC_INIT8BPP, cTarget->m_Init8BPP);

View File

@ -46,6 +46,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_NoAlphaChannel = FALSE;
m_FixRefCounter = TRUE;
m_SuppressChild = FALSE;
m_HideDesktop = FALSE;
m_LockSysColors = FALSE;
m_ForceYUVtoRGB = FALSE;
m_ForceRGBtoYUV = FALSE;

View File

@ -137,6 +137,7 @@ public:
BOOL m_NoAlphaChannel;
BOOL m_FixRefCounter;
BOOL m_SuppressChild;
BOOL m_HideDesktop;
BOOL m_LockSysColors;
BOOL m_SaveCaps;
BOOL m_SingleProcAffinity;

Binary file not shown.

View File

@ -437,6 +437,7 @@ BEGIN
GROUPBOX "Screen resolution",IDC_STATIC,149,123,144,64
CONTROL "Limit resolution:",IDC_LIMITSCREENRES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,136,63,10
LISTBOX IDC_LISTRES,226,133,57,26,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
CONTROL "Hide desktop background",IDC_HIDEDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,184,125,10
END
IDD_TAB_EMPTY DIALOGEX 0, 0, 300, 240

Binary file not shown.

View File

@ -177,6 +177,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_NoAlphaChannel) t->flags4 |= NOALPHACHANNEL;
if(dlg->m_FixRefCounter) t->flags4 |= FIXREFCOUNTER;
if(dlg->m_SuppressChild) t->flags4 |= SUPPRESSCHILD;
if(dlg->m_HideDesktop) t->flags4 |= HIDEDESKTOP;
if(dlg->m_LockSysColors) t->flags3 |= LOCKSYSCOLORS;
if(dlg->m_ForceYUVtoRGB) t->flags3 |= YUV2RGB;
if(dlg->m_ForceRGBtoYUV) t->flags3 |= RGB2YUV;
@ -319,6 +320,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_NoAlphaChannel = t->flags4 & NOALPHACHANNEL ? 1 : 0;
dlg->m_FixRefCounter = t->flags4 & FIXREFCOUNTER ? 1 : 0;
dlg->m_SuppressChild = t->flags4 & SUPPRESSCHILD ? 1 : 0;
dlg->m_HideDesktop = t->flags4 & HIDEDESKTOP ? 1 : 0;
dlg->m_LockSysColors = t->flags3 & LOCKSYSCOLORS ? 1 : 0;
dlg->m_ForceRGBtoYUV = t->flags3 & RGB2YUV ? 1 : 0;
dlg->m_ForceYUVtoRGB = t->flags3 & YUV2RGB ? 1 : 0;