mirror of
https://github.com/DxWnd/DxWnd.reloaded
synced 2024-12-30 09:25:35 +01:00
v2_03_63_src
Former-commit-id: 3425022d6ca2eb98a114b9d083d71db2119c6d89
This commit is contained in:
parent
7eefee644a
commit
fc82f0a055
@ -150,7 +150,7 @@
|
||||
#define DIABLOTWEAK 0x00000001 // ... ??? ...
|
||||
#define CLEARTARGET 0x00000002 // forces a D3D clean on target surface upon each BeginScene invocation
|
||||
#define NOWINPOSCHANGES 0x00000004 // suppress WM_WINDOWPOSCHANGING/CHANGED messages (RollerCoaster Tycoon...)
|
||||
//#define NOSYSTEMMEMORY 0x00000008 // forces suppression of DDSCAPS_SYSTEMMEMORY capability on surfaces
|
||||
#define ANSIWIDE 0x00000008 // by default uses Widechar version of API intead od ANSI
|
||||
#define NOBLT 0x00000010 // suppress blit to primary surface
|
||||
//#define NOSYSTEMEMULATED 0x00000020 // forces suppression of DDSCAPS_SYSTEMMEMORY capability on emulated front & backbuffer surfaces
|
||||
#define DOFASTBLT 0x00000040 // use FastBlt to primary surface
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c352a420894e9be21d4b1a04c665e7e463d533be4c54b70201c90db2702ef994
|
||||
size 643584
|
||||
oid sha256:537e48142d49baefcb73703effbe1cbdf7577aa64e9326adac8f4fe6dfe99958
|
||||
size 644096
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b9bf619ccedb715b22ab6deee04a4182be6f76f31f702ac1e2ff1bb172447e49
|
||||
size 556032
|
||||
oid sha256:9f4fdbf4310c5fd473a72b37e4fcc5c30f5f12f4537a238748890b2b9ce38b43
|
||||
size 557056
|
||||
|
@ -27,3 +27,9 @@ notes0=
|
||||
flagj0=128
|
||||
winver0=0
|
||||
maxres0=0
|
||||
registry0=
|
||||
flagk0=65536
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
swapeffect0=0
|
||||
maxddinterface0=7
|
||||
|
@ -7,10 +7,10 @@ opengllib0=
|
||||
notes0=
|
||||
ver0=1
|
||||
coord0=0
|
||||
flag0=683687970
|
||||
flag0=683687978
|
||||
flagg0=2013265920
|
||||
flagh0=20
|
||||
flagi0=675282948
|
||||
flagi0=138412036
|
||||
flagj0=4224
|
||||
tflag0=0
|
||||
initx0=0
|
||||
@ -30,3 +30,6 @@ maxres0=-1
|
||||
registry0=
|
||||
flagk0=65536
|
||||
swapeffect0=0
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
maxddinterface0=7
|
||||
|
@ -0,0 +1,29 @@
|
||||
[target]
|
||||
title0=Drakan Order of the Flame (10th anniversary)
|
||||
path0=D:\Games\drakan\drakan.exe
|
||||
launchpath0=
|
||||
module0=
|
||||
opengllib0=
|
||||
notes0=
|
||||
registry0=
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=740311126
|
||||
flagg0=1476395008
|
||||
flagh0=20
|
||||
flagi0=203423748
|
||||
flagj0=4224
|
||||
flagk0=268500994
|
||||
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
|
@ -6,9 +6,9 @@ opengllib0=
|
||||
ver0=1
|
||||
coord0=0
|
||||
flag0=134217762
|
||||
flagg0=1744830464
|
||||
flagg0=1207959552
|
||||
flagh0=20
|
||||
flagi0=4194308
|
||||
flagi0=71303172
|
||||
tflag0=0
|
||||
initx0=0
|
||||
inity0=0
|
||||
|
@ -4,12 +4,12 @@ path0=D:\Games\Fifa 99\fifa99.exe
|
||||
launchpath0=
|
||||
module0=
|
||||
opengllib0=
|
||||
ver0=7
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=671105058
|
||||
flagg0=1207959552
|
||||
flagh0=20
|
||||
flagi0=138412036
|
||||
flagi0=205520900
|
||||
flagj0=128
|
||||
tflag0=0
|
||||
initx0=0
|
||||
@ -30,3 +30,6 @@ notes0=
|
||||
flagk0=65536
|
||||
swapeffect0=0
|
||||
registry0=
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
maxddinterface0=7
|
||||
|
@ -6,11 +6,11 @@ module0=
|
||||
opengllib0=
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=134218272
|
||||
flag0=134218274
|
||||
flagg0=1207959552
|
||||
flagh0=20
|
||||
flagi0=138412036
|
||||
flagj0=128
|
||||
flagj0=67108992
|
||||
tflag0=0
|
||||
initx0=0
|
||||
inity0=0
|
||||
@ -26,3 +26,10 @@ maxfps0=0
|
||||
initts0=0
|
||||
winver0=0
|
||||
maxres0=-1
|
||||
notes0=
|
||||
registry0=
|
||||
flagk0=65536
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
swapeffect0=0
|
||||
maxddinterface0=7
|
||||
|
@ -5,7 +5,7 @@ module0=
|
||||
opengllib0=
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=134218272
|
||||
flag0=134218274
|
||||
flagg0=1207959552
|
||||
flagh0=20
|
||||
flagi0=4194308
|
||||
@ -27,5 +27,9 @@ maxres0=-1
|
||||
launchpath0=
|
||||
notes0=
|
||||
flagj0=128
|
||||
flagk0=0
|
||||
flagk0=65536
|
||||
swapeffect0=0
|
||||
registry0=
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
maxddinterface0=7
|
||||
|
@ -9,7 +9,7 @@ flag0=134217762
|
||||
flagg0=1207959552
|
||||
flagh0=20
|
||||
flagi0=4194308
|
||||
tflag0=6402
|
||||
tflag0=0
|
||||
initx0=0
|
||||
inity0=0
|
||||
minx0=0
|
||||
@ -27,5 +27,9 @@ maxres0=-1
|
||||
launchpath0=
|
||||
notes0=
|
||||
flagj0=128
|
||||
flagk0=0
|
||||
flagk0=65536
|
||||
swapeffect0=0
|
||||
registry0=
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
maxddinterface0=7
|
||||
|
29
build/exports/Grand Theft Auto 3 Vice City.dxw
Normal file
29
build/exports/Grand Theft Auto 3 Vice City.dxw
Normal file
@ -0,0 +1,29 @@
|
||||
[target]
|
||||
title0=Grand Theft Auto 3: Vice City
|
||||
path0=D:\Games\GTA3ViceCity\gta-vc.exe
|
||||
launchpath0=
|
||||
module0=
|
||||
opengllib0=
|
||||
notes0=
|
||||
registry0=
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=-2011168218
|
||||
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
|
29
build/exports/Gunbound.dxw
Normal file
29
build/exports/Gunbound.dxw
Normal file
@ -0,0 +1,29 @@
|
||||
[target]
|
||||
title0=Gunbound
|
||||
path0=D:\Games\GunBound\GunGame.gme
|
||||
launchpath0=D:\Games\GunBound\Launcher.exe
|
||||
module0=
|
||||
opengllib0=
|
||||
notes0=
|
||||
registry0=
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=136314922
|
||||
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
|
29
build/exports/Mechwarrior 3.dxw
Normal file
29
build/exports/Mechwarrior 3.dxw
Normal file
@ -0,0 +1,29 @@
|
||||
[target]
|
||||
title0=Mechwarrior 3
|
||||
path0=D:\Games\Mechwarrior 3 (full)\Mech3.exe
|
||||
launchpath0=
|
||||
module0=
|
||||
opengllib0=
|
||||
notes0=
|
||||
registry0=\n[HKEY_LOCAL_MACHINE\Software]\n[HKEY_LOCAL_MACHINE\Software\MicroProse]\n[HKEY_LOCAL_MACHINE\Software\MicroProse\MechWarrior 3 EP1]\n[HKEY_LOCAL_MACHINE\Software\MicroProse\MechWarrior 3 EP1\1.0]\n"Program"="..\\"\n"Version"="1.0"\n"InstallOptions"=dword:00050707\n\n[HKEY_LOCAL_MACHINE\Software\Microsoft]\n[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay]\n[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay\Applications]\n[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectPlay\Applications\MechWarrior 3 EP1]\n"Guid"="{FA96C421-18DD-11D3-95AF-0060089877F0}"\n"File"="Mech3.exe"\n"CommandLine"="\n"Path"=".\\"\n"CurrentDirectory"=".\\"\n\n
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=136331398
|
||||
flagg0=1207959552
|
||||
flagh0=9236
|
||||
flagi0=1277165574
|
||||
flagj0=4224
|
||||
flagk0=65600
|
||||
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
|
@ -12,7 +12,7 @@ flagg0=1744830592
|
||||
flagh0=20
|
||||
flagi0=138412036
|
||||
flagj0=4224
|
||||
tflag0=6403
|
||||
tflag0=0
|
||||
initx0=0
|
||||
inity0=0
|
||||
minx0=0
|
||||
@ -27,3 +27,9 @@ maxfps0=0
|
||||
initts0=0
|
||||
winver0=0
|
||||
maxres0=-1
|
||||
registry0=
|
||||
flagk0=65536
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
swapeffect0=0
|
||||
maxddinterface0=7
|
||||
|
@ -8,9 +8,9 @@ notes0=
|
||||
registry0=
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=136314912
|
||||
flag0=136331296
|
||||
flagg0=1207959552
|
||||
flagh0=20
|
||||
flagh0=262164
|
||||
flagi0=138412038
|
||||
flagj0=266368
|
||||
flagk0=65536
|
||||
|
29
build/exports/Tomb Raider - Anniversary Demo.dxw
Normal file
29
build/exports/Tomb Raider - Anniversary Demo.dxw
Normal file
@ -0,0 +1,29 @@
|
||||
[target]
|
||||
title0=Tomb Raider - Anniversary Demo
|
||||
path0=D:\Games\Tomb Raider - Anniversary Demo\tra.exe
|
||||
launchpath0=
|
||||
module0=
|
||||
opengllib0=
|
||||
notes0=
|
||||
registry0=
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=136314914
|
||||
flagg0=1207959552
|
||||
flagh0=20
|
||||
flagi0=134217732
|
||||
flagj0=4232
|
||||
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
|
@ -6,11 +6,11 @@ module0=
|
||||
opengllib0=
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=134218272
|
||||
flag0=134218274
|
||||
flagg0=1207959552
|
||||
flagh0=20
|
||||
flagi0=4194308
|
||||
tflag0=64
|
||||
tflag0=0
|
||||
initx0=0
|
||||
inity0=0
|
||||
minx0=0
|
||||
@ -26,3 +26,10 @@ initts0=0
|
||||
winver0=0
|
||||
maxres0=-1
|
||||
flagj0=4224
|
||||
notes0=
|
||||
registry0=
|
||||
flagk0=0
|
||||
flagl0=0
|
||||
flagm0=0
|
||||
swapeffect0=0
|
||||
maxddinterface0=7
|
||||
|
35
build/exports/dxwnd.ini
Normal file
35
build/exports/dxwnd.ini
Normal file
@ -0,0 +1,35 @@
|
||||
[window]
|
||||
posx=981
|
||||
posy=578
|
||||
sizx=320
|
||||
sizy=200
|
||||
exportpath=D:\DxWnd\exports\
|
||||
[target]
|
||||
title0=Imperialism
|
||||
path0=D:\Games\Imperialism\Imperialism.exe
|
||||
launchpath0=
|
||||
module0=
|
||||
opengllib0=
|
||||
notes0=Note:\nMap zooming is currently not workind. Do not click on the magnifying glass, \nor the game will crash.
|
||||
registry0=
|
||||
ver0=0
|
||||
coord0=0
|
||||
flag0=1746935851
|
||||
flagg0=1207959553
|
||||
flagh0=20
|
||||
flagi0=4194308
|
||||
flagj0=128
|
||||
flagk0=262144
|
||||
flagl0=4
|
||||
flagm0=0
|
||||
tflag0=-2147477245
|
||||
posx0=50
|
||||
posy0=50
|
||||
sizx0=800
|
||||
sizy0=600
|
||||
maxfps0=0
|
||||
initts0=0
|
||||
winver0=0
|
||||
maxres0=-1
|
||||
swapeffect0=0
|
||||
maxddinterface0=7
|
@ -1081,5 +1081,11 @@ fix: added CDS_UPDATEREGISTRY to the ChangeDisplaySettings modes to be neutraliz
|
||||
v2.03.62
|
||||
fix: flag "Intercept Alt-F4 key" now working also alone with no need to set "Enable hot keys"
|
||||
fix: file open dialogs initialization on WinXP platform
|
||||
fix: hooked ANSI & WIDECHAR version of DirectInput8Create: makes "Gooka the Mystery of Janatris" working.
|
||||
fix: hooked ANSI & WIDECHAR version of DirectInput8CreateDevice: makes "Gooka the Mystery of Janatris" working.
|
||||
fix: rebuild up-to-date dxwnd proxies
|
||||
|
||||
v2.03.63
|
||||
fix: saved config changes in case DxWnd is restarted for acquiring admin caps
|
||||
fix: duplicated several function pointers in D3D8/9 wrappers: fix some GTA3 crashes and reduce the need to suppress Reset operation
|
||||
add: flag "Widechar program vs. ANSI" to replace default ansi calls with widechar equivalents: fixes "Tomb Raider Anniversary" mouse problems
|
||||
|
||||
|
BIN
build/v2_03_63_fix3_build.rar
Normal file
BIN
build/v2_03_63_fix3_build.rar
Normal file
Binary file not shown.
@ -3978,13 +3978,13 @@ HRESULT WINAPI extSetPalette(SetPalette_Type pSetPalette, LPDIRECTDRAWSURFACE lp
|
||||
HRESULT WINAPI extSetPalette1(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpddp)
|
||||
{ return extSetPalette(pSetPalette1, lpdds, lpddp); }
|
||||
HRESULT WINAPI extSetPalette2(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpddp)
|
||||
{ return extSetPalette(pSetPalette1, lpdds, lpddp); }
|
||||
{ return extSetPalette(pSetPalette2, lpdds, lpddp); }
|
||||
HRESULT WINAPI extSetPalette3(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpddp)
|
||||
{ return extSetPalette(pSetPalette1, lpdds, lpddp); }
|
||||
{ return extSetPalette(pSetPalette3, lpdds, lpddp); }
|
||||
HRESULT WINAPI extSetPalette4(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpddp)
|
||||
{ return extSetPalette(pSetPalette1, lpdds, lpddp); }
|
||||
{ return extSetPalette(pSetPalette4, lpdds, lpddp); }
|
||||
HRESULT WINAPI extSetPalette7(LPDIRECTDRAWSURFACE lpdds, LPDIRECTDRAWPALETTE lpddp)
|
||||
{ return extSetPalette(pSetPalette1, lpdds, lpddp); }
|
||||
{ return extSetPalette(pSetPalette7, lpdds, lpddp); }
|
||||
|
||||
HRESULT WINAPI extSetEntries(LPDIRECTDRAWPALETTE lpddp, DWORD dwflags, DWORD dwstart, DWORD dwcount, LPPALETTEENTRY lpentries)
|
||||
{
|
||||
|
@ -29,6 +29,8 @@ dxwCore dxw;
|
||||
dxwSStack dxwss;
|
||||
dxwWStack dxwws;
|
||||
dxwSDC sdc;
|
||||
GetWindowLong_Type pGetWindowLong;
|
||||
SetWindowLong_Type pSetWindowLong;
|
||||
|
||||
extern LRESULT CALLBACK MessageHook(int, WPARAM, LPARAM);
|
||||
|
||||
@ -99,7 +101,7 @@ static char *Flag4Names[32]={
|
||||
};
|
||||
|
||||
static char *Flag5Names[32]={
|
||||
"DIABLOTWEAK", "CLEARTARGET", "NOWINPOSCHANGES", "**",
|
||||
"DIABLOTWEAK", "CLEARTARGET", "NOWINPOSCHANGES", "ANSIWIDE",
|
||||
"NOBLT", "**", "DOFASTBLT", "AEROBOOST",
|
||||
"QUARTERBLT", "NOIMAGEHLP", "BILINEARFILTER", "REPLACEPRIVOPS",
|
||||
"REMAPMCI", "TEXTUREHIGHLIGHT", "TEXTUREDUMP", "TEXTUREHACK",
|
||||
@ -564,8 +566,8 @@ void CalculateWindowPos(HWND hwnd, DWORD width, DWORD height, LPWINDOWPOS wp)
|
||||
|
||||
RECT UnmappedRect;
|
||||
UnmappedRect=rect;
|
||||
dwStyle=(*pGetWindowLongA)(hwnd, GWL_STYLE);
|
||||
dwExStyle=(*pGetWindowLongA)(hwnd, GWL_EXSTYLE);
|
||||
dwStyle=(*pGetWindowLong)(hwnd, GWL_STYLE);
|
||||
dwExStyle=(*pGetWindowLong)(hwnd, GWL_EXSTYLE);
|
||||
// BEWARE: from MSDN - If the window is a child window, the return value is undefined.
|
||||
hMenu = (dwStyle & WS_CHILD) ? NULL : GetMenu(hwnd);
|
||||
AdjustWindowRectEx(&rect, dwStyle, (hMenu!=NULL), dwExStyle);
|
||||
@ -624,7 +626,7 @@ void HookWindowProc(HWND hwnd)
|
||||
|
||||
if(dxw.dwFlags6 & NOWINDOWHOOKS) return;
|
||||
|
||||
pWindowProc = (WNDPROC)(*pGetWindowLongA)(hwnd, GWL_WNDPROC);
|
||||
pWindowProc = (WNDPROC)(*pGetWindowLong)(hwnd, GWL_WNDPROC);
|
||||
// don't hook twice ....
|
||||
if ((pWindowProc == extWindowProc) ||
|
||||
(pWindowProc == extChildWindowProc) ||
|
||||
|
@ -137,6 +137,12 @@ void dxwCore::InitTarget(TARGETMAP *target)
|
||||
if (dwFlags2 & GDISTRETCHED) GDIEmulationMode = GDIMODE_STRETCHED;
|
||||
if (dwFlags3 & GDIEMULATEDC) GDIEmulationMode = GDIMODE_EMULATED;
|
||||
if (dwFlags6 & SHAREDDC) GDIEmulationMode = GDIMODE_SHAREDDC;
|
||||
|
||||
extern GetWindowLong_Type pGetWindowLong;
|
||||
extern SetWindowLong_Type pSetWindowLong;
|
||||
// made before hooking !!!
|
||||
pGetWindowLong = (dwFlags5 & ANSIWIDE) ? GetWindowLongW : GetWindowLongA;
|
||||
pSetWindowLong = (dwFlags5 & ANSIWIDE) ? SetWindowLongW : SetWindowLongA;
|
||||
}
|
||||
|
||||
void dxwCore::SetScreenSize(void)
|
||||
@ -1516,7 +1522,7 @@ void dxwCore::FixWindowFrame(HWND hwnd)
|
||||
|
||||
OutTraceDW("FixWindowFrame: hwnd=%x\n", hwnd);
|
||||
|
||||
nOldStyle=(*pGetWindowLongA)(hwnd, GWL_STYLE);
|
||||
nOldStyle=(*pGetWindowLong)(hwnd, GWL_STYLE);
|
||||
if (!nOldStyle){
|
||||
OutTraceE("FixWindowFrame: GetWindowLong ERROR %d at %d\n",GetLastError(),__LINE__);
|
||||
return;
|
||||
@ -1553,7 +1559,7 @@ void dxwCore::FixStyle(char *ApiName, HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
lpSS->styleNew= WS_OVERLAPPEDWINDOW;
|
||||
}
|
||||
if (dxw.dwFlags1 & LOCKWINSTYLE){ // set to current value
|
||||
lpSS->styleNew= (*pGetWindowLongA)(hwnd, GWL_STYLE);
|
||||
lpSS->styleNew= (*pGetWindowLong)(hwnd, GWL_STYLE);
|
||||
}
|
||||
if (dxw.dwFlags1 & PREVENTMAXIMIZE){ // disable maximize settings
|
||||
if (lpSS->styleNew & WS_MAXIMIZE){
|
||||
@ -1569,7 +1575,7 @@ void dxwCore::FixStyle(char *ApiName, HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
lpSS->styleNew= 0;
|
||||
}
|
||||
if (dxw.dwFlags1 & LOCKWINSTYLE){ // set to current value
|
||||
lpSS->styleNew= (*pGetWindowLongA)(hwnd, GWL_EXSTYLE);
|
||||
lpSS->styleNew= (*pGetWindowLong)(hwnd, GWL_EXSTYLE);
|
||||
}
|
||||
if ((dxw.dwFlags1 & PREVENTMAXIMIZE) && (hwnd==hWnd)){ // disable maximize settings
|
||||
if (lpSS->styleNew & WS_EX_TOPMOST){
|
||||
|
@ -372,3 +372,5 @@ typedef enum {
|
||||
typedef HRESULT (WINAPI *ColorConversion_Type)(int, LPDIRECTDRAWSURFACE, RECT, LPDIRECTDRAWSURFACE *);
|
||||
extern ColorConversion_Type pColorConversion;
|
||||
extern void ToggleAcquiredDevices(BOOL);
|
||||
extern GetWindowLong_Type pGetWindowLong;
|
||||
extern SetWindowLong_Type pSetWindowLong;
|
@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "TlHelp32.h"
|
||||
|
||||
#define VERSION "2.03.62.fix2"
|
||||
#define VERSION "2.03.63"
|
||||
|
||||
#define DDTHREADLOCK 1
|
||||
//#define LOCKTHREADS
|
||||
|
Binary file not shown.
113
dll/hd3d.cpp
113
dll/hd3d.cpp
@ -3,6 +3,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
#include <d3d9.h>
|
||||
#include <d3d8caps.h>
|
||||
#include <D3D10_1.h>
|
||||
#include <D3D10Misc.h>
|
||||
#include <D3D11.h>
|
||||
@ -56,7 +57,8 @@ typedef HRESULT (WINAPI *CheckDeviceFormat_Type)(void *, UINT, D3DDEVTYPE, D3DFO
|
||||
typedef HRESULT (WINAPI *CheckDeviceMultiSampleType_Type)(void *, UINT, D3DDEVTYPE, D3DFORMAT, BOOL, D3DMULTISAMPLE_TYPE, DWORD *);
|
||||
typedef HRESULT (WINAPI *CheckDepthStencilMatch_Type)(void *, UINT, D3DDEVTYPE, D3DFORMAT, D3DFORMAT, D3DFORMAT);
|
||||
typedef HRESULT (WINAPI *CheckDeviceFormatConversion_Type)(void *, UINT, D3DDEVTYPE, D3DFORMAT, D3DFORMAT);
|
||||
typedef HRESULT (WINAPI *D3DGetDeviceCaps_Type)(void *, UINT, D3DDEVTYPE, D3DCAPS9 *);
|
||||
typedef HRESULT (WINAPI *D3DGetDeviceCaps8_Type)(void *, UINT, D3DDEVTYPE, D3DCAPS8 *);
|
||||
typedef HRESULT (WINAPI *D3DGetDeviceCaps9_Type)(void *, UINT, D3DDEVTYPE, D3DCAPS9 *);
|
||||
typedef HMONITOR (WINAPI *GetAdapterMonitor_Type)(void *, UINT);
|
||||
typedef HRESULT (WINAPI *CreateDevice_Type)(void *, UINT, D3DDEVTYPE, HWND, DWORD, void *, void **);
|
||||
typedef HRESULT (WINAPI *CreateDeviceEx_Type)(void *, UINT, D3DDEVTYPE, HWND, DWORD, void *, D3DDISPLAYMODEEX *, void **);
|
||||
@ -73,10 +75,11 @@ HRESULT WINAPI extCheckDeviceFormat(void *, UINT, D3DDEVTYPE, D3DFORMAT, DWORD,
|
||||
HRESULT WINAPI extCheckDeviceMultiSampleType(void *, UINT, D3DDEVTYPE, D3DFORMAT, BOOL, D3DMULTISAMPLE_TYPE, DWORD *);
|
||||
HRESULT WINAPI extCheckDepthStencilMatch(void *, UINT, D3DDEVTYPE, D3DFORMAT, D3DFORMAT, D3DFORMAT);
|
||||
HRESULT WINAPI extCheckDeviceFormatConversion(void *, UINT, D3DDEVTYPE, D3DFORMAT, D3DFORMAT);
|
||||
HRESULT WINAPI extD3DGetDeviceCaps8(void *, UINT, D3DDEVTYPE, D3DCAPS9 *);
|
||||
HRESULT WINAPI extD3DGetDeviceCaps8(void *, UINT, D3DDEVTYPE, D3DCAPS8 *);
|
||||
HRESULT WINAPI extD3DGetDeviceCaps9(void *, UINT, D3DDEVTYPE, D3DCAPS9 *);
|
||||
HMONITOR WINAPI extGetAdapterMonitor(void *, UINT);
|
||||
HRESULT WINAPI extCreateDevice(void *, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS *, void **);
|
||||
HRESULT WINAPI extCreateDevice8(void *, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS *, void **);
|
||||
HRESULT WINAPI extCreateDevice9(void *, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS *, void **);
|
||||
HRESULT WINAPI extCreateDeviceEx(void *, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS *, D3DDISPLAYMODEEX *, void **);
|
||||
|
||||
RegisterSoftwareDevice_Type pRegisterSoftwareDevice = 0;
|
||||
@ -90,7 +93,8 @@ CheckDeviceFormat_Type pCheckDeviceFormat = 0;
|
||||
CheckDeviceMultiSampleType_Type pCheckDeviceMultiSampleType = 0;
|
||||
CheckDepthStencilMatch_Type pCheckDepthStencilMatch = 0;
|
||||
CheckDeviceFormatConversion_Type pCheckDeviceFormatConversion = 0;
|
||||
D3DGetDeviceCaps_Type pD3DGetDeviceCaps = 0;
|
||||
D3DGetDeviceCaps8_Type pD3DGetDeviceCaps8 = 0;
|
||||
D3DGetDeviceCaps9_Type pD3DGetDeviceCaps9 = 0;
|
||||
GetAdapterMonitor_Type pGetAdapterMonitor = 0;
|
||||
CreateDevice_Type pCreateDevice8 = 0;
|
||||
CreateDevice_Type pCreateDevice9 = 0;
|
||||
@ -133,7 +137,8 @@ void WINAPI extSetCursorPosition9(void *, int, int, DWORD);
|
||||
void WINAPI extSetCursorPosition8(void *, int, int, DWORD);
|
||||
BOOL WINAPI extShowCursor8(void *, BOOL);
|
||||
BOOL WINAPI extShowCursor9(void *, BOOL);
|
||||
HRESULT WINAPI extCreateAdditionalSwapChain(void *, D3DPRESENT_PARAMETERS *, IDirect3DSwapChain9 **);
|
||||
HRESULT WINAPI extCreateAdditionalSwapChain8(void *, D3DPRESENT_PARAMETERS *, IDirect3DSwapChain9 **);
|
||||
HRESULT WINAPI extCreateAdditionalSwapChain9(void *, D3DPRESENT_PARAMETERS *, IDirect3DSwapChain9 **);
|
||||
HRESULT WINAPI extGetSwapChain(void *, UINT, IDirect3DSwapChain9**);
|
||||
UINT WINAPI extGetNumberOfSwapChains(void *);
|
||||
HRESULT WINAPI extBeginStateBlock8(void *);
|
||||
@ -158,7 +163,8 @@ SetCursorPosition9_Type pSetCursorPosition9 = 0;
|
||||
SetCursorPosition8_Type pSetCursorPosition8 = 0;
|
||||
ShowCursor8_Type pShowCursor8 = 0;
|
||||
ShowCursor9_Type pShowCursor9 = 0;
|
||||
CreateAdditionalSwapChain_Type pCreateAdditionalSwapChain = 0;
|
||||
CreateAdditionalSwapChain_Type pCreateAdditionalSwapChain8 = 0;
|
||||
CreateAdditionalSwapChain_Type pCreateAdditionalSwapChain9 = 0;
|
||||
GetSwapChain_Type pGetSwapChain = 0;
|
||||
GetNumberOfSwapChains_Type pGetNumberOfSwapChains = 0;
|
||||
BeginStateBlock_Type pBeginStateBlock8 = 0;
|
||||
@ -239,12 +245,14 @@ HRESULT WINAPI extEnumAdapterModes8(void *, UINT, UINT , D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extEnumAdapterModes9(void *, UINT, D3DFORMAT, UINT , D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extGetAdapterDisplayMode8(void *, UINT, D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extGetAdapterDisplayMode9(void *, UINT, D3DDISPLAYMODE *);
|
||||
HRESULT WINAPI extPresent(void *, CONST RECT *, CONST RECT *, HWND, CONST RGNDATA *);
|
||||
HRESULT WINAPI extPresent8(void *, CONST RECT *, CONST RECT *, HWND, CONST RGNDATA *);
|
||||
HRESULT WINAPI extPresent9(void *, CONST RECT *, CONST RECT *, HWND, CONST RGNDATA *);
|
||||
HRESULT WINAPI extSetRenderState(void *, D3DRENDERSTATETYPE, DWORD);
|
||||
HRESULT WINAPI extGetRenderState(void *, D3DRENDERSTATETYPE, DWORD);
|
||||
HRESULT WINAPI extGetViewport(void *, D3DVIEWPORT9 *);
|
||||
HRESULT WINAPI extSetViewport(void *, D3DVIEWPORT9 *);
|
||||
HRESULT WINAPI extReset(void *, D3DPRESENT_PARAMETERS *);
|
||||
HRESULT WINAPI extReset8(void *, D3DPRESENT_PARAMETERS *);
|
||||
HRESULT WINAPI extReset9(void *, D3DPRESENT_PARAMETERS *);
|
||||
void WINAPI extSetGammaRamp(void *, UINT, DWORD, D3DGAMMARAMP *);
|
||||
void WINAPI extGetGammaRamp(void *, UINT, D3DGAMMARAMP *);
|
||||
ULONG WINAPI extAddRef9(void *);
|
||||
@ -286,7 +294,8 @@ EnumAdapterModes8_Type pEnumAdapterModes8 = 0;
|
||||
EnumAdapterModes9_Type pEnumAdapterModes9 = 0;
|
||||
GetAdapterDisplayMode_Type pGetAdapterDisplayMode8 = 0;
|
||||
GetAdapterDisplayMode_Type pGetAdapterDisplayMode9 = 0;
|
||||
Present_Type pPresent = 0;
|
||||
Present_Type pPresent8 = 0;
|
||||
Present_Type pPresent9 = 0;
|
||||
SetRenderState_Type pSetRenderState = 0;
|
||||
GetRenderState_Type pGetRenderState = 0;
|
||||
GetViewport_Type pGetViewport = 0;
|
||||
@ -300,7 +309,8 @@ BeginScene_Type pBeginScene8 = 0;
|
||||
EndScene_Type pEndScene8 = 0;
|
||||
BeginScene_Type pBeginScene9 = 0;
|
||||
EndScene_Type pEndScene9 = 0;
|
||||
Reset_Type pReset = 0;
|
||||
Reset_Type pReset8 = 0;
|
||||
Reset_Type pReset9 = 0;
|
||||
SetTexture8_Type pSetTexture8 = 0;
|
||||
SetTexture9_Type pSetTexture9 = 0;
|
||||
|
||||
@ -486,9 +496,9 @@ void HookD3DDevice8(void** ppD3Ddev8)
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 32), extGetDisplayMode8, (void **)&pGetDisplayMode8, "GetDisplayMode(D8)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 44), extSetCursorPosition8, (void **)&pSetCursorPosition8, "SetCursorPosition(D8)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 48), extShowCursor8, (void **)&pShowCursor8, "ShowCursor(D8)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D8)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 56), extReset, (void **)&pReset, "Reset(D8)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 60), extPresent, (void **)&pPresent, "Present(D8)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 52), extCreateAdditionalSwapChain8, (void **)&pCreateAdditionalSwapChain8, "CreateAdditionalSwapChain(D8)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 56), extReset8, (void **)&pReset8, "Reset(D8)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 60), extPresent8, (void **)&pPresent8, "Present(D8)");
|
||||
if(dxw.dwFlags2 & DISABLEGAMMARAMP){
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 72), extSetGammaRamp, (void **)&pSetGammaRamp, "SetGammaRamp(D8)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev8 + 76), extGetGammaRamp, (void **)&pGetGammaRamp, "GetGammaRamp(D8)");
|
||||
@ -528,11 +538,11 @@ void HookD3DDevice9(void** ppD3Ddev9)
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 32), extGetDisplayMode9, (void **)&pGetDisplayMode9, "GetDisplayMode(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 44), extSetCursorPosition9, (void **)&pSetCursorPosition9, "SetCursorPosition(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 48), extShowCursor9, (void **)&pShowCursor9, "ShowCursor(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 52), extCreateAdditionalSwapChain9, (void **)&pCreateAdditionalSwapChain9, "CreateAdditionalSwapChain(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 56), extGetSwapChain, (void **)&pGetSwapChain, "GetSwapChain(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 60), extGetNumberOfSwapChains, (void **)&pGetNumberOfSwapChains, "extGetNumberOfSwapChains(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 64), extReset, (void **)&pReset, "Reset(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 68), extPresent, (void **)&pPresent, "Present(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 64), extReset9, (void **)&pReset9, "Reset(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 68), extPresent9, (void **)&pPresent9, "Present(D9)");
|
||||
if(dxw.dwFlags2 & DISABLEGAMMARAMP){
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 84), extSetGammaRamp, (void **)&pSetGammaRamp, "SetGammaRamp(D9)");
|
||||
SetHook((void *)(**(DWORD **)ppD3Ddev9 + 88), extGetGammaRamp, (void **)&pGetGammaRamp, "GetGammaRamp(D9)");
|
||||
@ -595,8 +605,8 @@ void HookDirect3D8(void *lpd3d)
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier8, (void **)&pGetAdapterIdentifier8, "GetAdapterIdentifier(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes8, (void **)&pEnumAdapterModes8, "EnumAdapterModes(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode8, (void **)&pGetAdapterDisplayMode8, "GetAdapterDisplayMode(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 52), extD3DGetDeviceCaps8, (void **)&pD3DGetDeviceCaps, "GetDeviceCaps(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 60), extCreateDevice, (void **)&pCreateDevice8, "CreateDevice(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 52), extD3DGetDeviceCaps8, (void **)&pD3DGetDeviceCaps8, "GetDeviceCaps(D8)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 60), extCreateDevice8, (void **)&pCreateDevice8, "CreateDevice(D8)");
|
||||
}
|
||||
|
||||
BOOL WINAPI extDisableD3DSpy(void)
|
||||
@ -629,8 +639,8 @@ void HookDirect3D9(void *lpd3d, BOOL ex)
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 20), extGetAdapterIdentifier9, (void **)&pGetAdapterIdentifier9, "GetAdapterIdentifier(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 28), extEnumAdapterModes9, (void **)&pEnumAdapterModes9, "EnumAdapterModes(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 32), extGetAdapterDisplayMode9, (void **)&pGetAdapterDisplayMode9, "GetAdapterDisplayMode(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 56), extD3DGetDeviceCaps9, (void **)&pD3DGetDeviceCaps, "GetDeviceCaps(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 64), extCreateDevice, (void **)&pCreateDevice9, "CreateDevice(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 56), extD3DGetDeviceCaps9, (void **)&pD3DGetDeviceCaps9, "GetDeviceCaps(D9)");
|
||||
SetHook((void *)(*(DWORD *)lpd3d + 64), extCreateDevice9, (void **)&pCreateDevice9, "CreateDevice(D9)");
|
||||
if(ex) SetHook((void *)(*(DWORD *)lpd3d + 80), extCreateDeviceEx, (void **)&pCreateDeviceEx, "CreateDeviceEx(D9)");
|
||||
//if (!(dxw.dwTFlags & OUTPROXYTRACE)) return;
|
||||
//SetHook((void *)(*(DWORD *)lpd3d + 12), extRegisterSoftwareDevice, (void **)&pRegisterSoftwareDevice, "RegisterSoftwareDevice(D9)");
|
||||
@ -751,13 +761,14 @@ static char *ExplainSwapEffect(DWORD f)
|
||||
return s;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extReset(void *pd3dd, D3DPRESENT_PARAMETERS* pPresParam)
|
||||
static HRESULT WINAPI extReset(int dwD3DVersion, void *pd3dd, D3DPRESENT_PARAMETERS* pPresParam)
|
||||
{
|
||||
HRESULT res;
|
||||
DWORD param[64], *tmp;
|
||||
D3DDISPLAYMODE mode;
|
||||
DWORD Windowed;
|
||||
void *pD3D;
|
||||
Reset_Type pReset;
|
||||
|
||||
memcpy(param, pPresParam, (dwD3DVersion == 9)?56:52);
|
||||
dxw.SetScreenSize(param[0], param[1]);
|
||||
@ -784,6 +795,7 @@ HRESULT WINAPI extReset(void *pd3dd, D3DPRESENT_PARAMETERS* pPresParam)
|
||||
}
|
||||
|
||||
Windowed = (dwD3DVersion == 8) ? param[7] : param[8];
|
||||
pReset = (dwD3DVersion == 8) ? pReset8 : pReset9;
|
||||
if(dxw.Windowize){
|
||||
if(Windowed) {
|
||||
// do not attempt to reset when returning to windowed mode: it is useless (you are windowed already)
|
||||
@ -876,7 +888,12 @@ HRESULT WINAPI extReset(void *pd3dd, D3DPRESENT_PARAMETERS* pPresParam)
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extPresent(void *pd3dd, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
|
||||
HRESULT WINAPI extReset8(void *pd3dd, D3DPRESENT_PARAMETERS* pPresParam)
|
||||
{ return extReset(8, pd3dd, pPresParam); }
|
||||
HRESULT WINAPI extReset9(void *pd3dd, D3DPRESENT_PARAMETERS* pPresParam)
|
||||
{ return extReset(9, pd3dd, pPresParam); }
|
||||
|
||||
static HRESULT WINAPI extPresent(Present_Type pPresent, void *pd3dd, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
|
||||
{
|
||||
HRESULT res;
|
||||
RECT RemappedSrcRect, RemappedDstRect;
|
||||
@ -916,6 +933,11 @@ HRESULT WINAPI extPresent(void *pd3dd, CONST RECT *pSourceRect, CONST RECT *pDes
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extPresent8(void *pd3dd, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
|
||||
{ return extPresent(pPresent8, pd3dd, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion); }
|
||||
HRESULT WINAPI extPresent9(void *pd3dd, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
|
||||
{ return extPresent(pPresent9, pd3dd, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion); }
|
||||
|
||||
HRESULT WINAPI extGetDisplayMode8(void *lpd3d, D3DDISPLAYMODE *pMode)
|
||||
{
|
||||
HRESULT res;
|
||||
@ -1045,14 +1067,14 @@ HWND FixD3DWindowFrame(HWND hFocusWin)
|
||||
return hRetWnd;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
|
||||
HWND hfocuswindow, DWORD behaviorflags, D3DPRESENT_PARAMETERS *ppresentparam, void **ppd3dd)
|
||||
static HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
|
||||
HWND hfocuswindow, DWORD behaviorflags, D3DPRESENT_PARAMETERS *ppresentparam, void **ppd3dd, int dwD3DVersion)
|
||||
{
|
||||
HRESULT res;
|
||||
DWORD param[64], *tmp;
|
||||
D3DDISPLAYMODE mode;
|
||||
|
||||
OutTraceD3D("CreateDevice: D3DVersion=%d lpd3d=%x adapter=%x hFocusWnd=%x behavior=%x, size=(%d,%d)\n",
|
||||
OutTraceD3D("CreateDevice(%d): lpd3d=%x adapter=%x hFocusWnd=%x behavior=%x, size=(%d,%d)\n",
|
||||
dwD3DVersion, lpd3d, adapter, hfocuswindow, behaviorflags, ppresentparam->BackBufferWidth, ppresentparam->BackBufferHeight);
|
||||
|
||||
memcpy(param, ppresentparam, (dwD3DVersion == 9)?56:52);
|
||||
@ -1180,6 +1202,12 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extCreateDevice8(void *lpd3d, UINT adapter, D3DDEVTYPE dt, HWND hfw, DWORD bf, D3DPRESENT_PARAMETERS *ppp, void **ppd3dd)
|
||||
{ return extCreateDevice(lpd3d, adapter, dt, hfw, bf, ppp, ppd3dd, 8); }
|
||||
HRESULT WINAPI extCreateDevice9(void *lpd3d, UINT adapter, D3DDEVTYPE dt, HWND hfw, DWORD bf, D3DPRESENT_PARAMETERS *ppp, void **ppd3dd)
|
||||
{ return extCreateDevice(lpd3d, adapter, dt, hfw, bf, ppp, ppd3dd, 9); }
|
||||
|
||||
|
||||
HRESULT WINAPI extCreateDeviceEx(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype,
|
||||
HWND hfocuswindow, DWORD behaviorflags, D3DPRESENT_PARAMETERS *ppresentparam, D3DDISPLAYMODEEX *pFullscreenDisplayMode, void **ppd3dd)
|
||||
{
|
||||
@ -1335,13 +1363,20 @@ HRESULT WINAPI extSetViewport(void *pd3dd, D3DVIEWPORT9 *pViewport)
|
||||
return (*pSetViewport)(pd3dd, pViewport);
|
||||
}
|
||||
|
||||
HRESULT WINAPI extCreateAdditionalSwapChain(void *lpd3dd, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **ppSwapChain)
|
||||
static HRESULT WINAPI extCreateAdditionalSwapChain(int dwD3DVersion, void *lpd3dd, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **ppSwapChain)
|
||||
{
|
||||
HRESULT res, res2;
|
||||
DWORD param[64], *tmp;
|
||||
D3DDISPLAYMODE mode;
|
||||
CreateAdditionalSwapChain_Type pCreateAdditionalSwapChain;
|
||||
Reset_Type pReset;
|
||||
GetAdapterDisplayMode_Type pGetAdapterDisplayMode;
|
||||
|
||||
OutTraceD3D("CreateAdditionalSwapChain: d3d=%x\n", lpd3dd);
|
||||
OutTraceD3D("CreateAdditionalSwapChain(%d): d3d=%x\n", dwD3DVersion, lpd3dd);
|
||||
|
||||
pCreateAdditionalSwapChain = (dwD3DVersion == 8) ? pCreateAdditionalSwapChain8 : pCreateAdditionalSwapChain9;
|
||||
pReset = (dwD3DVersion == 8) ? pReset8 : pReset9;
|
||||
pGetAdapterDisplayMode = (dwD3DVersion == 8) ? pGetAdapterDisplayMode8 : pGetAdapterDisplayMode9;
|
||||
|
||||
memcpy(param, pPresentationParameters, (dwD3DVersion == 9)?56:52);
|
||||
dxw.SetScreenSize(param[0], param[1]);
|
||||
@ -1368,10 +1403,8 @@ HRESULT WINAPI extCreateAdditionalSwapChain(void *lpd3dd, D3DPRESENT_PARAMETERS
|
||||
OutTrace(" PresentationInterval = 0x%x\n", *(tmp ++));
|
||||
}
|
||||
|
||||
if (dwD3DVersion == 9)
|
||||
res2=(*pGetAdapterDisplayMode9)(lpd3dd, D3DADAPTER_DEFAULT, &mode);
|
||||
else
|
||||
res2=(*pGetAdapterDisplayMode8)(lpd3dd, D3DADAPTER_DEFAULT, &mode);
|
||||
res2=(*pGetAdapterDisplayMode)(lpd3dd, D3DADAPTER_DEFAULT, &mode);
|
||||
|
||||
if(res2==DD_OK){
|
||||
OutTraceD3D(" Current Format = 0x%x\n", mode.Format);
|
||||
OutTraceD3D(" Current ScreenSize = (%dx%d)\n", mode.Width, mode.Height);
|
||||
@ -1431,6 +1464,11 @@ HRESULT WINAPI extCreateAdditionalSwapChain(void *lpd3dd, D3DPRESENT_PARAMETERS
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extCreateAdditionalSwapChain8(void *lpd3dd, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **ppSwapChain)
|
||||
{ return extCreateAdditionalSwapChain(8, lpd3dd, pPresentationParameters, ppSwapChain); }
|
||||
HRESULT WINAPI extCreateAdditionalSwapChain9(void *lpd3dd, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **ppSwapChain)
|
||||
{ return extCreateAdditionalSwapChain(9, lpd3dd, pPresentationParameters, ppSwapChain); }
|
||||
|
||||
// to do:
|
||||
// hook SetCursorPosition ShowCursor to handle cursor
|
||||
|
||||
@ -1952,7 +1990,12 @@ HRESULT WINAPI extD3DGetDeviceCaps(void *lpd3d, UINT Adapter, D3DDEVTYPE DeviceT
|
||||
{
|
||||
HRESULT res;
|
||||
OutTraceD3D("GetDeviceCaps(%d): d3d=%x adapter=%d devtype=%x(%s)\n", version, lpd3d, Adapter, DeviceType, ExplainD3D9DeviceType(DeviceType));
|
||||
res=(*pD3DGetDeviceCaps)(lpd3d, Adapter, DeviceType, pCaps);
|
||||
|
||||
if(version == 8)
|
||||
res=(*pD3DGetDeviceCaps8)(lpd3d, Adapter, DeviceType, (D3DCAPS8 *)pCaps);
|
||||
else
|
||||
res=(*pD3DGetDeviceCaps9)(lpd3d, Adapter, DeviceType, pCaps);
|
||||
|
||||
if(res){
|
||||
OutTraceE("GetDeviceCaps: ERROR: err=%x\n", res);
|
||||
}
|
||||
@ -2091,12 +2134,12 @@ HRESULT WINAPI extD3DGetDeviceCaps(void *lpd3d, UINT Adapter, D3DDEVTYPE DeviceT
|
||||
return res;
|
||||
}
|
||||
|
||||
HRESULT WINAPI extD3DGetDeviceCaps8(void *lpd3d, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps)
|
||||
HRESULT WINAPI extD3DGetDeviceCaps8(void *lpd3d, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8 *pCaps)
|
||||
{
|
||||
return extD3DGetDeviceCaps(lpd3d, Adapter, DeviceType, pCaps, 8);
|
||||
return extD3DGetDeviceCaps(lpd3d, Adapter, DeviceType, (D3DCAPS9 *)pCaps, 8);
|
||||
}
|
||||
|
||||
HRESULT WINAPI extD3DGetDeviceCaps9(void *lpd3d, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps)
|
||||
HRESULT WINAPI extD3DGetDeviceCaps9(void *lpd3d, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9 *pCaps)
|
||||
{
|
||||
return extD3DGetDeviceCaps(lpd3d, Adapter, DeviceType, pCaps, 9);
|
||||
}
|
||||
|
@ -488,11 +488,11 @@ void dxwFixWindowPos(char *ApiName, HWND hwnd, LPARAM lParam)
|
||||
RECT client, full;
|
||||
LONG dwStyle, dwExStyle;
|
||||
HMENU hMenu;
|
||||
extern GetWindowLong_Type pGetWindowLongA;
|
||||
extern GetWindowLong_Type pGetWindowLong;
|
||||
(*pGetClientRect)(hwnd, &client);
|
||||
full=client;
|
||||
dwStyle=(*pGetWindowLongA)(hwnd, GWL_STYLE);
|
||||
dwExStyle=(*pGetWindowLongA)(hwnd, GWL_EXSTYLE);
|
||||
dwStyle=(*pGetWindowLong)(hwnd, GWL_STYLE);
|
||||
dwExStyle=(*pGetWindowLong)(hwnd, GWL_EXSTYLE);
|
||||
hMenu = (dwStyle & WS_CHILD) ? NULL : GetMenu(hwnd);
|
||||
AdjustWindowRectEx(&full, dwStyle, (hMenu!=NULL), dwExStyle);
|
||||
if (hMenu && (hMenu != (HMENU)-1)) __try {CloseHandle(hMenu);} __except(EXCEPTION_EXECUTE_HANDLER){};
|
||||
@ -531,8 +531,8 @@ void dxwFixWindowPos(char *ApiName, HWND hwnd, LPARAM lParam)
|
||||
HMENU hMenu;
|
||||
int minx, miny;
|
||||
wrect = dxw.GetScreenRect();
|
||||
dwStyle=(*pGetWindowLongA)(hwnd, GWL_STYLE);
|
||||
dwExStyle=(*pGetWindowLongA)(hwnd, GWL_EXSTYLE);
|
||||
dwStyle=(*pGetWindowLong)(hwnd, GWL_STYLE);
|
||||
dwExStyle=(*pGetWindowLong)(hwnd, GWL_EXSTYLE);
|
||||
hMenu = (dwStyle & WS_CHILD) ? NULL : GetMenu(hwnd);
|
||||
AdjustWindowRectEx(&wrect, dwStyle, (hMenu!=NULL), dwExStyle);
|
||||
minx = wrect.right - wrect.left;
|
||||
@ -724,7 +724,7 @@ LONG WINAPI extGetWindowLongW(HWND hwnd, int nIndex)
|
||||
return extGetWindowLong(pGetWindowLongW, "GetWindowLongW", hwnd, nIndex);
|
||||
}
|
||||
|
||||
LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong, SetWindowLong_Type pSetWindowLong)
|
||||
LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong, SetWindowLong_Type pSetWindowLong, GetWindowLong_Type pGetWindowLong)
|
||||
{
|
||||
LONG res;
|
||||
|
||||
@ -735,11 +735,11 @@ LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong, SetWindowLon
|
||||
if(dxw.dwFlags1 & LOCKWINSTYLE){
|
||||
if(nIndex==GWL_STYLE){
|
||||
OutTraceDW("SetWindowLong: Lock GWL_STYLE=%x\n", dwNewLong);
|
||||
return (*pGetWindowLongA)(hwnd, nIndex);
|
||||
return (*pGetWindowLong)(hwnd, nIndex);
|
||||
}
|
||||
if(nIndex==GWL_EXSTYLE){
|
||||
OutTraceDW("SetWindowLong: Lock GWL_EXSTYLE=%x\n", dwNewLong);
|
||||
return (*pGetWindowLongA)(hwnd, nIndex);
|
||||
return (*pGetWindowLong)(hwnd, nIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -781,7 +781,7 @@ LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong, SetWindowLon
|
||||
}
|
||||
// end of GPL fix
|
||||
|
||||
OldProc = (WNDPROC)(*pGetWindowLongA)(hwnd, nIndex);
|
||||
OldProc = (WNDPROC)(*pGetWindowLong)(hwnd, nIndex);
|
||||
// v2.02.70 fix
|
||||
if((OldProc==extWindowProc) ||
|
||||
(OldProc==extChildWindowProc)||
|
||||
@ -790,11 +790,11 @@ LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong, SetWindowLon
|
||||
dxwws.PutProc(hwnd, (WNDPROC)dwNewLong);
|
||||
res=(LONG)OldProc;
|
||||
SetLastError(0);
|
||||
lres=(WNDPROC)(*pSetWindowLongA)(hwnd, nIndex, (LONG)extWindowProc);
|
||||
lres=(WNDPROC)(*pSetWindowLong)(hwnd, nIndex, (LONG)extWindowProc);
|
||||
if(!lres && GetLastError())OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
else {
|
||||
res=(*pSetWindowLongA)(hwnd, nIndex, dwNewLong);
|
||||
res=(*pSetWindowLong)(hwnd, nIndex, dwNewLong);
|
||||
}
|
||||
|
||||
OutTraceDW("SetWindowLong: hwnd=%x, nIndex=%x, Val=%x, res=%x\n", hwnd, nIndex, dwNewLong, res);
|
||||
@ -803,12 +803,12 @@ LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong, SetWindowLon
|
||||
|
||||
LONG WINAPI extSetWindowLongA(HWND hwnd, int nIndex, LONG dwNewLong)
|
||||
{
|
||||
return extSetWindowLong(hwnd, nIndex, dwNewLong, pSetWindowLongA);
|
||||
return extSetWindowLong(hwnd, nIndex, dwNewLong, pSetWindowLongA, pGetWindowLongA);
|
||||
}
|
||||
|
||||
LONG WINAPI extSetWindowLongW(HWND hwnd, int nIndex, LONG dwNewLong)
|
||||
{
|
||||
return extSetWindowLong(hwnd, nIndex, dwNewLong, pSetWindowLongW);
|
||||
return extSetWindowLong(hwnd, nIndex, dwNewLong, pSetWindowLongW, pGetWindowLongW);
|
||||
}
|
||||
|
||||
BOOL WINAPI extSetWindowPos(HWND hwnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags)
|
||||
@ -832,7 +832,7 @@ BOOL WINAPI extSetWindowPos(HWND hwnd, HWND hWndInsertAfter, int X, int Y, int c
|
||||
r.right = X + cx;
|
||||
r.top = Y;
|
||||
r.bottom = Y + cy;
|
||||
if ((*pGetWindowLongA)(hwnd, GWL_STYLE) & WS_CHILD){
|
||||
if ((*pGetWindowLong)(hwnd, GWL_STYLE) & WS_CHILD){
|
||||
r = dxw.MapClientRect(&r);
|
||||
}
|
||||
else {
|
||||
@ -884,8 +884,8 @@ BOOL WINAPI extSetWindowPos(HWND hwnd, HWND hWndInsertAfter, int X, int Y, int c
|
||||
RECT rect;
|
||||
rect.top=rect.left=0;
|
||||
rect.right=cx; rect.bottom=cy;
|
||||
dwCurStyle=(*pGetWindowLongA)(hwnd, GWL_STYLE);
|
||||
dwExStyle=(*pGetWindowLongA)(hwnd, GWL_EXSTYLE);
|
||||
dwCurStyle=(*pGetWindowLong)(hwnd, GWL_STYLE);
|
||||
dwExStyle=(*pGetWindowLong)(hwnd, GWL_EXSTYLE);
|
||||
// BEWARE: from MSDN - If the window is a child window, the return value is undefined.
|
||||
hMenu = (dwCurStyle & WS_CHILD) ? NULL : GetMenu(hwnd);
|
||||
AdjustWindowRectEx(&rect, dwCurStyle, (hMenu!=NULL), dwExStyle);
|
||||
@ -1386,7 +1386,7 @@ static void HookChildWndProc(HWND hwnd, DWORD dwStyle, LPCTSTR ApiName)
|
||||
|
||||
if(dxw.dwFlags6 & NOWINDOWHOOKS) return;
|
||||
|
||||
pWindowProc = (WNDPROC)(*pGetWindowLongA)(hwnd, GWL_WNDPROC);
|
||||
pWindowProc = (WNDPROC)(*pGetWindowLong)(hwnd, GWL_WNDPROC);
|
||||
if((pWindowProc == extWindowProc) ||
|
||||
(pWindowProc == extChildWindowProc) ||
|
||||
(pWindowProc == extDialogWindowProc)){ // avoid recursions
|
||||
@ -1402,11 +1402,11 @@ static void HookChildWndProc(HWND hwnd, DWORD dwStyle, LPCTSTR ApiName)
|
||||
dxwws.PutProc(hwnd, pWindowProc);
|
||||
if(dwStyle & WS_CHILD){
|
||||
OutTraceDW("%s: Hooking CHILD hwnd=%x father WindowProc %x->%x\n", ApiName, hwnd, pWindowProc, extChildWindowProc);
|
||||
res=(*pSetWindowLongA)(hwnd, GWL_WNDPROC, (LONG)extChildWindowProc);
|
||||
res=(*pSetWindowLong)(hwnd, GWL_WNDPROC, (LONG)extChildWindowProc);
|
||||
}
|
||||
else { // must be dwStyle & WS_DLGFRAME
|
||||
OutTraceDW("%s: Hooking DLGFRAME hwnd=%x father WindowProc %x->%x\n", ApiName, hwnd, pWindowProc, extDialogWindowProc);
|
||||
res=(*pSetWindowLongA)(hwnd, GWL_WNDPROC, (LONG)extDialogWindowProc);
|
||||
res=(*pSetWindowLong)(hwnd, GWL_WNDPROC, (LONG)extDialogWindowProc);
|
||||
}
|
||||
if(!res) OutTraceE("%s: SetWindowLong ERROR %x\n", ApiName, GetLastError());
|
||||
}
|
||||
@ -1612,8 +1612,8 @@ static HWND WINAPI extCreateWindowCommon(
|
||||
if ((!isValidHandle) && dxw.IsFullScreen()){
|
||||
dxw.SethWnd(hwnd);
|
||||
extern void AdjustWindowPos(HWND, DWORD, DWORD);
|
||||
(*pSetWindowLongA)(hwnd, GWL_STYLE, (dxw.dwFlags2 & MODALSTYLE) ? 0 : WS_OVERLAPPEDWINDOW);
|
||||
(*pSetWindowLongA)(hwnd, GWL_EXSTYLE, 0);
|
||||
(*pSetWindowLong)(hwnd, GWL_STYLE, (dxw.dwFlags2 & MODALSTYLE) ? 0 : WS_OVERLAPPEDWINDOW);
|
||||
(*pSetWindowLong)(hwnd, GWL_EXSTYLE, 0);
|
||||
OutTraceDW("%s: hwnd=%x, set style=WS_OVERLAPPEDWINDOW extstyle=0\n", ApiName, hwnd);
|
||||
AdjustWindowPos(hwnd, nWidth, nHeight);
|
||||
(*pShowWindow)(hwnd, SW_SHOWNORMAL);
|
||||
@ -2360,7 +2360,7 @@ HWND WINAPI extCreateDialogIndirectParam(HINSTANCE hInstance, LPCDLGTEMPLATE lpT
|
||||
if( lpDialogFunc &&
|
||||
!(dxw.dwFlags6 & NOWINDOWHOOKS)){ // v2.03.41 - debug option
|
||||
dxwws.PutProc(RetHWND, (WNDPROC)lpDialogFunc);
|
||||
if(!(*pSetWindowLongA)(RetHWND, DWL_DLGPROC, (LONG)extDialogWindowProc))
|
||||
if(!(*pSetWindowLong)(RetHWND, DWL_DLGPROC, (LONG)extDialogWindowProc))
|
||||
OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
|
||||
@ -2384,7 +2384,7 @@ HWND WINAPI extCreateDialogParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, HW
|
||||
if( lpDialogFunc &&
|
||||
!(dxw.dwFlags6 & NOWINDOWHOOKS)){ // v2.03.41 - debug option
|
||||
dxwws.PutProc(RetHWND, (WNDPROC)lpDialogFunc);
|
||||
if(!(*pSetWindowLongA)(RetHWND, DWL_DLGPROC, (LONG)extDialogWindowProc))
|
||||
if(!(*pSetWindowLong)(RetHWND, DWL_DLGPROC, (LONG)extDialogWindowProc))
|
||||
OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__);
|
||||
}
|
||||
|
||||
@ -2417,7 +2417,7 @@ BOOL WINAPI extMoveWindow(HWND hwnd, int X, int Y, int nWidth, int nHeight, BOOL
|
||||
BOOL isChild;
|
||||
(*pClientToScreen)(dxw.GethWnd(),&upleft);
|
||||
(*pGetClientRect)(dxw.GethWnd(),&client);
|
||||
if ((*pGetWindowLongA)(hwnd, GWL_STYLE) & WS_CHILD){
|
||||
if ((*pGetWindowLong)(hwnd, GWL_STYLE) & WS_CHILD){
|
||||
isChild=TRUE;
|
||||
// child coordinate adjustement
|
||||
X = (X * client.right) / dxw.GetScreenWidth();
|
||||
@ -2446,7 +2446,7 @@ BOOL WINAPI extMoveWindow(HWND hwnd, int X, int Y, int nWidth, int nHeight, BOOL
|
||||
POINT upleft = {0,0};
|
||||
(*pGetClientRect)(dxw.GethWnd(),&screen);
|
||||
(*pClientToScreen)(dxw.GethWnd(),&upleft);
|
||||
if((dwStyle=(*pGetWindowLongA)(hwnd, GWL_STYLE)) && WS_CHILDWINDOW){
|
||||
if((dwStyle=(*pGetWindowLong)(hwnd, GWL_STYLE)) && WS_CHILDWINDOW){
|
||||
// Big main child window: see "Reah"
|
||||
X=Y=0;
|
||||
}
|
||||
|
@ -175,18 +175,18 @@ static void dx_Cornerize(HWND hwnd)
|
||||
|
||||
if (bCornerized){ // toggle ....
|
||||
OutTraceDW("DxWnd: exiting corner mode\n");
|
||||
(*pSetWindowLongA)(hwnd, GWL_STYLE, OldStyle);
|
||||
(*pSetWindowLongA)(hwnd, GWL_EXSTYLE, OldExtStyle);
|
||||
(*pSetWindowLong)(hwnd, GWL_STYLE, OldStyle);
|
||||
(*pSetWindowLong)(hwnd, GWL_EXSTYLE, OldExtStyle);
|
||||
(*pMoveWindow)(hwnd, WinRect.left, WinRect.top, WinRect.right, WinRect.bottom, TRUE);
|
||||
memset(&WinRect, 0, sizeof(WinRect));
|
||||
}
|
||||
else {
|
||||
OutTraceDW("DxWnd: entering corner mode\n");
|
||||
(*pGetWindowRect)(hwnd, &WinRect);
|
||||
OldStyle = (*pGetWindowLongA)(hwnd, GWL_STYLE);
|
||||
OldExtStyle = (*pGetWindowLongA)(hwnd, GWL_EXSTYLE);
|
||||
(*pSetWindowLongA)(hwnd, GWL_STYLE, WS_VISIBLE|WS_CLIPSIBLINGS|WS_OVERLAPPED);
|
||||
(*pSetWindowLongA)(hwnd, GWL_EXSTYLE, 0);
|
||||
OldStyle = (*pGetWindowLong)(hwnd, GWL_STYLE);
|
||||
OldExtStyle = (*pGetWindowLong)(hwnd, GWL_EXSTYLE);
|
||||
(*pSetWindowLong)(hwnd, GWL_STYLE, WS_VISIBLE|WS_CLIPSIBLINGS|WS_OVERLAPPED);
|
||||
(*pSetWindowLong)(hwnd, GWL_EXSTYLE, 0);
|
||||
(*pMoveWindow)(hwnd, 0, 0, dxw.GetScreenWidth(), dxw.GetScreenHeight(), TRUE);
|
||||
}
|
||||
bCornerized = !bCornerized; // switch toggle
|
||||
@ -211,8 +211,8 @@ void dx_FullScreenToggle(HWND hwnd)
|
||||
MessageBox(NULL,"Error: Failed to recover display mode.", "Error", 0);
|
||||
}
|
||||
// MoveWindow doesn't recover the exact position!!!
|
||||
(*pSetWindowLongA)(hwnd, GWL_STYLE, OldStyle);
|
||||
(*pSetWindowLongA)(hwnd, GWL_EXSTYLE, OldExtStyle);
|
||||
(*pSetWindowLong)(hwnd, GWL_STYLE, OldStyle);
|
||||
(*pSetWindowLong)(hwnd, GWL_EXSTYLE, OldExtStyle);
|
||||
(*pSetWindowPos)(hwnd, HWND_TOP,
|
||||
WinRect.left, WinRect.top, (WinRect.right-WinRect.left), (WinRect.bottom-WinRect.top),
|
||||
SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_SHOWWINDOW);
|
||||
@ -224,8 +224,8 @@ void dx_FullScreenToggle(HWND hwnd)
|
||||
if((WinRect.left==0) && (WinRect.right==0) && (WinRect.top==0) && (WinRect.bottom==0)) (*pGetWindowRect)(hwnd, &WinRect);
|
||||
OldStyle = (*pGetWindowLongA)(hwnd, GWL_STYLE);
|
||||
OldExtStyle = (*pGetWindowLongA)(hwnd, GWL_EXSTYLE);
|
||||
(*pSetWindowLongA)(hwnd, GWL_STYLE, WS_VISIBLE|WS_CLIPSIBLINGS|WS_OVERLAPPED);
|
||||
(*pSetWindowLongA)(hwnd, GWL_EXSTYLE, 0);
|
||||
(*pSetWindowLong)(hwnd, GWL_STYLE, WS_VISIBLE|WS_CLIPSIBLINGS|WS_OVERLAPPED);
|
||||
(*pSetWindowLong)(hwnd, GWL_EXSTYLE, 0);
|
||||
(*pMoveWindow)(hwnd, 0, 0, dxw.GetScreenWidth(), dxw.GetScreenHeight(), TRUE);
|
||||
(*pUpdateWindow)(hwnd);
|
||||
|
||||
@ -278,8 +278,8 @@ static void dx_DesktopToggle(HWND hwnd, BOOL bWorkArea)
|
||||
if (bDesktopToggle){ // toggle ....
|
||||
OutTraceDW("DxWnd: exiting desktop mode: style=%x extstyle=%x pos=(%d,%d)-(%d,%d)\n",
|
||||
OldStyle, OldExtStyle, WinRect.left, WinRect.top, WinRect.right, WinRect.bottom);
|
||||
(*pSetWindowLongA)(hwnd, GWL_STYLE, OldStyle);
|
||||
(*pSetWindowLongA)(hwnd, GWL_EXSTYLE, OldExtStyle);
|
||||
(*pSetWindowLong)(hwnd, GWL_STYLE, OldStyle);
|
||||
(*pSetWindowLong)(hwnd, GWL_EXSTYLE, OldExtStyle);
|
||||
// MoveWindow doesn't recover the exact position!!!
|
||||
(*pSetWindowPos)(hwnd, HWND_TOP,
|
||||
WinRect.left, WinRect.top, (WinRect.right-WinRect.left), (WinRect.bottom-WinRect.top),
|
||||
@ -294,8 +294,8 @@ static void dx_DesktopToggle(HWND hwnd, BOOL bWorkArea)
|
||||
if((WinRect.left==0) && (WinRect.right==0) && (WinRect.top==0) && (WinRect.bottom==0)) (*pGetWindowRect)(hwnd, &WinRect);
|
||||
OldStyle = (*pGetWindowLongA)(hwnd, GWL_STYLE);
|
||||
OldExtStyle = (*pGetWindowLongA)(hwnd, GWL_EXSTYLE);
|
||||
(*pSetWindowLongA)(hwnd, GWL_STYLE, WS_VISIBLE|WS_CLIPSIBLINGS|WS_OVERLAPPED);
|
||||
(*pSetWindowLongA)(hwnd, GWL_EXSTYLE, 0);
|
||||
(*pSetWindowLong)(hwnd, GWL_STYLE, WS_VISIBLE|WS_CLIPSIBLINGS|WS_OVERLAPPED);
|
||||
(*pSetWindowLong)(hwnd, GWL_EXSTYLE, 0);
|
||||
(*pUpdateWindow)(hwnd);
|
||||
DesktopWnd = (*pGetDesktopWindow)();
|
||||
hClientDC=(*pGDIGetDC)(hwnd);
|
||||
|
@ -32,6 +32,7 @@ void CTabHook::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Check(pDX, IDC_STARTDEBUG, cTarget->m_StartDebug);
|
||||
DDX_Check(pDX, IDC_HOTPATCH, cTarget->m_HotPatch);
|
||||
DDX_Check(pDX, IDC_HOOKDLLS, cTarget->m_HookDLLs);
|
||||
DDX_Check(pDX, IDC_ANSIWIDE, cTarget->m_AnsiWide);
|
||||
DDX_Check(pDX, IDC_HOOKCHILDWIN, cTarget->m_HookChildWin);
|
||||
|
||||
// Kernel32
|
||||
|
@ -80,45 +80,65 @@ static BOOL IsWinXP()
|
||||
|
||||
void CTabProgram::OnOpen()
|
||||
{
|
||||
// TODO: Please add your control notification handler code here
|
||||
char path[MAX_PATH];
|
||||
CTargetDlg *cTarget = ((CTargetDlg *)(this->GetParent()->GetParent()));
|
||||
cTarget->m_File.GetWindowText(path, MAX_PATH);
|
||||
GetPrivateProfileString("window", "exepath", NULL, path, MAX_PATH, gInitPath);
|
||||
if(!dirExists(path)) strcpy(path, "");
|
||||
// XP fix: path must end with '\.'
|
||||
if(IsWinXP()) strcat(path, ".");
|
||||
CFileDialog dlg( TRUE, "*.*", path, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
"Program (*.exe)|*.exe|All Files (*.*)|*.*||", this);
|
||||
if( dlg.DoModal() == IDOK) {
|
||||
cTarget->m_File.SetWindowText(dlg.GetPathName());
|
||||
if(GetPrivateProfileInt("window", "updatepaths", 1, gInitPath)){
|
||||
strcpy(path, dlg.GetPathName());
|
||||
GetFolderFromPath(path);
|
||||
WritePrivateProfileString("window", "exepath", path, gInitPath);
|
||||
if(IsWinXP()) if((strlen(path) > 2) && (path[strlen(path)-1] == '\\')) strcat(path, ".");
|
||||
while(TRUE){
|
||||
int ret;
|
||||
CFileDialog dlg( TRUE, "*.*", path, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
"Program (*.exe)|*.exe|All Files (*.*)|*.*||", this);
|
||||
ret = dlg.DoModal();
|
||||
//char debug[512];
|
||||
//sprintf(debug, "ret=%x path=%s", ret, path);
|
||||
//MessageBox(debug, "debug", MB_OK);
|
||||
if(ret==IDOK){
|
||||
cTarget->m_File.SetWindowText(dlg.GetPathName());
|
||||
if(GetPrivateProfileInt("window", "updatepaths", 1, gInitPath)){
|
||||
strcpy(path, dlg.GetPathName());
|
||||
GetFolderFromPath(path);
|
||||
WritePrivateProfileString("window", "exepath", path, gInitPath);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(ret==IDCANCEL) break;
|
||||
//else
|
||||
strcpy(path,"");
|
||||
}
|
||||
}
|
||||
|
||||
void CTabProgram::OnOpenLaunch()
|
||||
{
|
||||
// TODO: Please add your control notification handler code here
|
||||
char path[MAX_PATH];
|
||||
CTargetDlg *cTarget = ((CTargetDlg *)(this->GetParent()->GetParent()));
|
||||
cTarget->m_File.GetWindowText(path, MAX_PATH);
|
||||
GetPrivateProfileString("window", "exepath", NULL, path, MAX_PATH, gInitPath);
|
||||
if(!dirExists(path)) strcpy(path, "");
|
||||
// XP fix: path must end with '\.'
|
||||
if(IsWinXP()) strcat(path, ".");
|
||||
CFileDialog dlg( TRUE, "*.*", path, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
"Program (*.exe)|*.exe|All Files (*.*)|*.*||", this);
|
||||
if( dlg.DoModal() == IDOK) {
|
||||
cTarget->m_Launch.SetWindowText(dlg.GetPathName());
|
||||
if(GetPrivateProfileInt("window", "updatepaths", 1, gInitPath)){
|
||||
strcpy(path, dlg.GetPathName());
|
||||
GetFolderFromPath(path);
|
||||
WritePrivateProfileString("window", "exepath", path, gInitPath);
|
||||
if(IsWinXP()) if((strlen(path) > 2) && (path[strlen(path)-1] == '\\')) strcat(path, ".");
|
||||
while(TRUE){
|
||||
int ret;
|
||||
CFileDialog dlg( TRUE, "*.*", path, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
"Program (*.exe)|*.exe|All Files (*.*)|*.*||", this);
|
||||
ret = dlg.DoModal();
|
||||
//char debug[512];
|
||||
//sprintf(debug, "ret=%x path=%s", ret, path);
|
||||
//MessageBox(debug, "debug", MB_OK);
|
||||
if(ret==IDOK){
|
||||
cTarget->m_Launch.SetWindowText(dlg.GetPathName());
|
||||
if(GetPrivateProfileInt("window", "updatepaths", 1, gInitPath)){
|
||||
strcpy(path, dlg.GetPathName());
|
||||
GetFolderFromPath(path);
|
||||
WritePrivateProfileString("window", "exepath", path, gInitPath);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(ret==IDCANCEL) break;
|
||||
//else
|
||||
strcpy(path,"");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,6 +110,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
|
||||
m_Windowize = TRUE; // default true !!
|
||||
m_HotPatch = FALSE;
|
||||
m_HookDLLs = TRUE; // default true !!
|
||||
m_AnsiWide = FALSE;
|
||||
m_TerminateOnClose = FALSE;
|
||||
m_ConfirmOnClose = FALSE;
|
||||
m_HookEnabled = TRUE; // default true !!
|
||||
|
@ -60,6 +60,7 @@ public:
|
||||
BOOL m_Windowize;
|
||||
BOOL m_HotPatch;
|
||||
BOOL m_HookDLLs;
|
||||
BOOL m_AnsiWide;
|
||||
BOOL m_TerminateOnClose;
|
||||
BOOL m_ConfirmOnClose;
|
||||
BOOL m_EmulateRegistry;
|
||||
@ -257,6 +258,7 @@ protected:
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CTargetDlg)
|
||||
afx_msg void OnOpen();
|
||||
afx_msg void OnOpenLaunch();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
extern BOOL IsProcessElevated();
|
||||
extern BOOL IsUserInAdminGroup();
|
||||
|
||||
BOOL DxSelfElevate()
|
||||
BOOL DxSelfElevate(CDxwndhostView *view)
|
||||
{
|
||||
BOOL const fInAdminGroup = IsUserInAdminGroup();
|
||||
if(!fInAdminGroup) return TRUE;
|
||||
@ -20,6 +20,11 @@ BOOL DxSelfElevate()
|
||||
MustRestart=MessageBoxLang(DXW_STRING_ADMINCAP, DXW_STRING_WARNING, MB_OKCANCEL | MB_ICONQUESTION);
|
||||
if(MustRestart==IDOK){
|
||||
extern HANDLE GlobalLocker;
|
||||
// Autoelevation at startup has no HostView yet, but nothing to save either
|
||||
if (view && view->isUpdated){
|
||||
if (MessageBoxLang(DXW_STRING_LISTUPDATE, DXW_STRING_WARNING, MB_YESNO | MB_ICONQUESTION)==IDYES)
|
||||
view->SaveConfigFile();
|
||||
}
|
||||
CloseHandle(GlobalLocker);
|
||||
char szPath[MAX_PATH];
|
||||
if (GetModuleFileName(NULL, szPath, ARRAYSIZE(szPath)))
|
||||
|
@ -138,12 +138,6 @@ BOOL CDxwndhostApp::InitInstance()
|
||||
|
||||
// standard initialization
|
||||
|
||||
//#ifdef _AFXDLL
|
||||
// Enable3dControls(); // if MFC is in shared DLL use this call.
|
||||
//#else
|
||||
// Enable3dControlsStatic(); // if MFC is statically linked use this call.
|
||||
//#endif
|
||||
|
||||
// Register the document template.
|
||||
|
||||
CSingleDocTemplate* pDocTemplate;
|
||||
@ -228,11 +222,11 @@ BOOL CDxwndhostApp::InitInstance()
|
||||
m_pMainWnd->UpdateWindow();
|
||||
|
||||
BOOL bCheckAdminRights = GetPrivateProfileInt("window", "checkadmin", 0, InitPath);
|
||||
extern BOOL DxSelfElevate();
|
||||
extern BOOL DxSelfElevate(CDxwndhostView *);
|
||||
OSVERSIONINFO osver = { sizeof(osver) };
|
||||
// self elevation at start if configured for the whole DxWnd session
|
||||
if (bCheckAdminRights && (GetVersionEx(&osver)) && (osver.dwMajorVersion >= 6)){
|
||||
DxSelfElevate();
|
||||
DxSelfElevate((CDxwndhostView *)NULL);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -197,6 +197,7 @@ void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
|
||||
if(dlg->m_UnNotify) t->flags |= UNNOTIFY;
|
||||
if(dlg->m_Windowize) t->flags2 |= WINDOWIZE;
|
||||
if(dlg->m_HookDLLs) t->flags3 |= HOOKDLLS;
|
||||
if(dlg->m_AnsiWide) t->flags5 |= ANSIWIDE;
|
||||
if(dlg->m_TerminateOnClose) t->flags6 |= TERMINATEONCLOSE;
|
||||
if(dlg->m_ConfirmOnClose) t->flags6 |= CONFIRMONCLOSE;
|
||||
if(dlg->m_EmulateRegistry) t->flags3 |= EMULATEREGISTRY;
|
||||
@ -468,6 +469,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
|
||||
dlg->m_Windowize = t->flags2 & WINDOWIZE ? 1 : 0;
|
||||
dlg->m_HotPatch = t->flags4 & HOTPATCH ? 1 : 0;
|
||||
dlg->m_HookDLLs = t->flags3 & HOOKDLLS ? 1 : 0;
|
||||
dlg->m_AnsiWide = t->flags5 & ANSIWIDE ? 1 : 0;
|
||||
dlg->m_TerminateOnClose = t->flags6 & TERMINATEONCLOSE ? 1 : 0;
|
||||
dlg->m_ConfirmOnClose = t->flags6 & CONFIRMONCLOSE ? 1 : 0;
|
||||
dlg->m_EmulateRegistry = t->flags3 & EMULATEREGISTRY ? 1 : 0;
|
||||
@ -2476,10 +2478,10 @@ void CDxwndhostView::OnRun()
|
||||
|
||||
// self-elevation if configured and necessary
|
||||
if(TargetMaps[i].flags & NEEDADMINCAPS){
|
||||
extern BOOL DxSelfElevate();
|
||||
extern BOOL DxSelfElevate(CDxwndhostView *);
|
||||
OSVERSIONINFO osver = { sizeof(osver) };
|
||||
if (GetVersionEx(&osver) && (osver.dwMajorVersion >= 6)){
|
||||
DxSelfElevate();
|
||||
DxSelfElevate(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,13 +16,13 @@ class CDxwndhostView : public CListView
|
||||
protected: // Create from serialization only features.
|
||||
CDxwndhostView();
|
||||
DECLARE_DYNCREATE(CDxwndhostView)
|
||||
BOOL isUpdated;
|
||||
void SaveConfigFile();
|
||||
|
||||
private:
|
||||
void Resize(void);
|
||||
void SaveConfigFile();
|
||||
TARGETMAP TargetMaps[MAXTARGETS];
|
||||
PRIVATEMAP PrivateMaps[MAXTARGETS];
|
||||
BOOL isUpdated;
|
||||
DEVMODE InitDevMode;
|
||||
CSystemTray SystemTray;
|
||||
int LastX, LastY, LastCX, LastCY;
|
||||
|
BIN
host/resource
BIN
host/resource
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user