2016-01-29 06:17:43 +13:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
2021-03-13 15:51:58 +13:00
|
|
|
#include <thread>
|
|
|
|
#include <array>
|
|
|
|
|
|
|
|
|
|
|
|
#include "Logger.h"
|
|
|
|
|
|
|
|
#include "MinHook.h"
|
|
|
|
#include "SimpleIni.h"
|
2016-01-29 06:17:43 +13:00
|
|
|
|
|
|
|
#include "IDirect3D9.h"
|
2021-03-13 15:51:58 +13:00
|
|
|
#include "Context.h"
|
|
|
|
#include "Wrapper.h"
|
2016-01-29 06:17:43 +13:00
|
|
|
|
|
|
|
MainContext context;
|
|
|
|
|
|
|
|
Config::Config()
|
|
|
|
{
|
|
|
|
std::string inifile = FullPathFromPath(inifilename);
|
|
|
|
|
|
|
|
CSimpleIniW ini;
|
|
|
|
ini.LoadFile(inifile.c_str());
|
|
|
|
|
|
|
|
u32 config_version = ini.GetLongValue(L"Version", L"Config");
|
|
|
|
if (config_version != CONFIG_VERSION)
|
|
|
|
{
|
|
|
|
// save file and reload
|
|
|
|
ini.Reset();
|
|
|
|
|
2021-03-13 15:51:58 +13:00
|
|
|
#define SETTING(_type, _func, _var, _section, _defaultval, _comment) \
|
|
|
|
ini.Set##_func(L#_section, L#_var, _defaultval, _comment)
|
2016-01-29 06:17:43 +13:00
|
|
|
#include "Settings.h"
|
|
|
|
#undef SETTING
|
|
|
|
|
|
|
|
ini.SetLongValue(L"Version", L"Config", CONFIG_VERSION);
|
|
|
|
ini.SaveFile(inifile.c_str());
|
|
|
|
ini.Reset();
|
|
|
|
ini.LoadFile(inifile.c_str());
|
|
|
|
}
|
|
|
|
|
2021-03-13 15:51:58 +13:00
|
|
|
#define SETTING(_type, _func, _var, _section, _defaultval, _comment) \
|
2016-01-29 06:17:43 +13:00
|
|
|
_var = ini.Get##_func(L#_section, L#_var)
|
|
|
|
#include "Settings.h"
|
|
|
|
#undef SETTING
|
|
|
|
}
|
|
|
|
|
2021-03-13 15:51:58 +13:00
|
|
|
MainContext::MainContext()
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
2019-12-24 15:01:31 +13:00
|
|
|
LogFile("FF13Fix.log");
|
2020-01-23 11:34:48 +13:00
|
|
|
context.PrintVersionInfo();
|
2016-01-29 06:17:43 +13:00
|
|
|
|
2020-02-02 09:03:46 +13:00
|
|
|
PrintLog("Enabling hooks:");
|
|
|
|
const MH_STATUS initializeHooks = MH_Initialize();
|
|
|
|
PrintLog("initializeHooks = %d", initializeHooks);
|
|
|
|
|
|
|
|
const MH_STATUS createHookDirect3DCreate9 = MH_CreateHook(D3D9DLL::Get().Direct3DCreate9, HookDirect3DCreate9, reinterpret_cast<void**>(&TrueDirect3DCreate9));
|
|
|
|
PrintLog("createHookDirect3DCreate9 = %d", createHookDirect3DCreate9);
|
|
|
|
const MH_STATUS enableHookDirect3DCreate9 = MH_EnableHook(D3D9DLL::Get().Direct3DCreate9);
|
|
|
|
PrintLog("enableHookDirect3DCreate9 = %d", enableHookDirect3DCreate9);
|
|
|
|
|
|
|
|
const MH_STATUS createHookCreateWindowExA = MH_CreateHook(CreateWindowExA, HookCreateWindowExA, reinterpret_cast<void**>(&TrueCreateWindowExA));
|
|
|
|
PrintLog("createHookCreateWindowExA = %d", createHookCreateWindowExA);
|
|
|
|
const MH_STATUS enableHookCreateWindowExA = MH_EnableHook(CreateWindowExA);
|
|
|
|
PrintLog("enableHookCreateWindowExA = %d", enableHookCreateWindowExA);
|
|
|
|
|
|
|
|
const MH_STATUS createHookCreateWindowExW = MH_CreateHook(CreateWindowExW, HookCreateWindowExW, reinterpret_cast<void**>(&TrueCreateWindowExW));
|
|
|
|
PrintLog("createHookCreateWindowExW = %d", createHookCreateWindowExW);
|
|
|
|
const MH_STATUS enableHookCreateWindowExW = MH_EnableHook(CreateWindowExW);
|
|
|
|
PrintLog("enableHookCreateWindowExW = %d", enableHookCreateWindowExW);
|
|
|
|
|
|
|
|
const MH_STATUS createHookSetWindowLongA = MH_CreateHook(SetWindowLongA, HookSetWindowLongA, reinterpret_cast<void**>(&TrueSetWindowLongA));
|
|
|
|
PrintLog("createHookSetWindowLongA = %d", createHookSetWindowLongA);
|
|
|
|
const MH_STATUS enableHookSetWindowLongA = MH_EnableHook(SetWindowLongA);
|
|
|
|
PrintLog("enableHookSetWindowLongA = %d", enableHookSetWindowLongA);
|
|
|
|
|
|
|
|
const MH_STATUS createHookSetWindowLongW = MH_CreateHook(SetWindowLongW, HookSetWindowLongW, reinterpret_cast<void**>(&TrueSetWindowLongW));
|
|
|
|
PrintLog("createHookSetWindowLongW = %d", createHookSetWindowLongW);
|
|
|
|
const MH_STATUS enableHookSetWindowLongW = MH_EnableHook(SetWindowLongW);
|
|
|
|
PrintLog("enableHookSetWindowLongW = %d", enableHookSetWindowLongW);
|
2021-03-21 13:31:44 +13:00
|
|
|
|
|
|
|
if (config.GetOptionsAutoFix()) EnableAutoFix();
|
2016-01-29 06:17:43 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
MainContext::~MainContext()
|
|
|
|
{
|
|
|
|
while (::ShowCursor(TRUE) <= 0);
|
|
|
|
}
|
|
|
|
|
2019-12-24 15:01:31 +13:00
|
|
|
IDirect3D9* WINAPI MainContext::HookDirect3DCreate9(UINT SDKVersion)
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
|
|
|
IDirect3D9* d3d9 = context.TrueDirect3DCreate9(SDKVersion);
|
|
|
|
if (d3d9)
|
|
|
|
{
|
|
|
|
return new hkIDirect3D9(d3d9);
|
|
|
|
}
|
|
|
|
|
|
|
|
return d3d9;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MainContext::BehaviorFlagsToString(DWORD BehaviorFlags, std::string* BehaviorFlagsString)
|
|
|
|
{
|
|
|
|
#define BF2STR(x) if (BehaviorFlags & x) BehaviorFlagsString->append(#x" ");
|
|
|
|
|
|
|
|
BF2STR(D3DCREATE_ADAPTERGROUP_DEVICE);
|
|
|
|
BF2STR(D3DCREATE_DISABLE_DRIVER_MANAGEMENT);
|
|
|
|
BF2STR(D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX);
|
|
|
|
BF2STR(D3DCREATE_DISABLE_PRINTSCREEN);
|
|
|
|
BF2STR(D3DCREATE_DISABLE_PSGP_THREADING);
|
|
|
|
BF2STR(D3DCREATE_ENABLE_PRESENTSTATS);
|
|
|
|
BF2STR(D3DCREATE_FPU_PRESERVE);
|
|
|
|
BF2STR(D3DCREATE_HARDWARE_VERTEXPROCESSING);
|
|
|
|
BF2STR(D3DCREATE_MIXED_VERTEXPROCESSING);
|
|
|
|
BF2STR(D3DCREATE_SOFTWARE_VERTEXPROCESSING);
|
|
|
|
BF2STR(D3DCREATE_MULTITHREADED);
|
|
|
|
BF2STR(D3DCREATE_NOWINDOWCHANGES);
|
|
|
|
BF2STR(D3DCREATE_PUREDEVICE);
|
|
|
|
BF2STR(D3DCREATE_SCREENSAVER);
|
|
|
|
|
|
|
|
#undef BF2STR
|
|
|
|
|
|
|
|
if (BehaviorFlagsString->back() == ' ')
|
|
|
|
BehaviorFlagsString->pop_back();
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MainContext::ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentationParameters)
|
|
|
|
{
|
|
|
|
if (pPresentationParameters)
|
|
|
|
{
|
2021-03-03 06:45:13 +13:00
|
|
|
// -1 = Auto, enabled when no DXVK is used
|
2021-03-13 15:51:58 +13:00
|
|
|
if (config.GetOptionsTripleBuffering() == 1 || (config.GetOptionsTripleBuffering() == -1 && !IsDXVK()))
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
|
|
|
pPresentationParameters->BackBufferCount = 3;
|
2019-12-24 15:01:31 +13:00
|
|
|
PrintLog("BackBufferCount: BackBufferCount set to %u", pPresentationParameters->BackBufferCount);
|
|
|
|
}
|
|
|
|
|
2021-03-03 06:45:13 +13:00
|
|
|
if ((s32)config.GetOptionsFullScreenRefreshRate() >= 0 && pPresentationParameters->FullScreen_RefreshRateInHz != 0)
|
2019-12-24 15:01:31 +13:00
|
|
|
{
|
2021-03-03 06:45:13 +13:00
|
|
|
PrintLog("Changing refresh rate from %u to %u", pPresentationParameters->FullScreen_RefreshRateInHz, config.GetOptionsFullScreenRefreshRate());
|
|
|
|
pPresentationParameters->FullScreen_RefreshRateInHz = config.GetOptionsFullScreenRefreshRate();
|
2016-01-29 06:17:43 +13:00
|
|
|
}
|
|
|
|
|
2021-03-03 06:45:13 +13:00
|
|
|
if (config.GetOptionsMultisample() > 0)
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
|
|
|
pPresentationParameters->SwapEffect = D3DSWAPEFFECT_DISCARD;
|
2021-03-03 06:45:13 +13:00
|
|
|
pPresentationParameters->MultiSampleType = (D3DMULTISAMPLE_TYPE)config.GetOptionsMultisample();
|
2016-01-29 06:17:43 +13:00
|
|
|
pPresentationParameters->MultiSampleQuality = 0;
|
|
|
|
|
|
|
|
PrintLog("MultiSampleType %u, MultiSampleQuality %u", pPresentationParameters->MultiSampleType, pPresentationParameters->MultiSampleQuality);
|
|
|
|
}
|
|
|
|
|
2021-03-11 19:40:59 +13:00
|
|
|
if (config.GetOptionsPresentationInterval() != 0)
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
2021-03-11 19:40:59 +13:00
|
|
|
if (config.GetOptionsPresentationInterval() == -1)
|
|
|
|
pPresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
|
|
|
|
else if (config.GetOptionsPresentationInterval() > 0)
|
|
|
|
pPresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_ONE;
|
|
|
|
|
|
|
|
PrintLog("PresentationInterval: PresentationInterval set to 0x%x", pPresentationParameters->PresentationInterval);
|
2016-01-29 06:17:43 +13:00
|
|
|
}
|
|
|
|
|
2021-03-03 06:45:13 +13:00
|
|
|
if (config.GetOptionsSwapEffect() != -1)
|
2019-12-24 15:01:31 +13:00
|
|
|
{
|
2021-03-03 06:45:13 +13:00
|
|
|
pPresentationParameters->SwapEffect = (D3DSWAPEFFECT)config.GetOptionsSwapEffect();
|
2019-12-24 15:01:31 +13:00
|
|
|
PrintLog("SwapEffect: SwapEffect set to %u", pPresentationParameters->SwapEffect);
|
|
|
|
}
|
|
|
|
|
2021-03-03 06:45:13 +13:00
|
|
|
if (config.GetBorderlessBorderless())
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
2016-02-02 10:22:54 +13:00
|
|
|
int cx = GetSystemMetrics(SM_CXSCREEN);
|
|
|
|
int cy = GetSystemMetrics(SM_CYSCREEN);
|
|
|
|
|
|
|
|
SetWindowPos(pPresentationParameters->hDeviceWindow, HWND_TOP, 0, 0, cx, cy, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
|
2016-01-29 06:17:43 +13:00
|
|
|
|
2021-03-03 06:45:13 +13:00
|
|
|
if (config.GetBorderlessForceWindowedMode())
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
2016-02-02 10:22:54 +13:00
|
|
|
pPresentationParameters->SwapEffect = pPresentationParameters->MultiSampleType == D3DMULTISAMPLE_NONE ? D3DSWAPEFFECT_DISCARD : D3DSWAPEFFECT_FLIP;
|
2016-01-29 06:17:43 +13:00
|
|
|
pPresentationParameters->Windowed = TRUE;
|
|
|
|
pPresentationParameters->FullScreen_RefreshRateInHz = 0;
|
2021-03-17 03:17:01 +13:00
|
|
|
|
2016-02-02 10:22:54 +13:00
|
|
|
PrintLog("ForceWindowedMode");
|
2016-01-29 06:17:43 +13:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-03 06:45:13 +13:00
|
|
|
if (config.GetOptionsHideCursor()) while (::ShowCursor(FALSE) >= 0); // ShowCursor < 0 -> hidden
|
2016-01-29 06:17:43 +13:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MainContext::CheckWindow(HWND hWnd)
|
|
|
|
{
|
|
|
|
std::unique_ptr<wchar_t[]> className(new wchar_t[MAX_PATH]);
|
|
|
|
std::unique_ptr<wchar_t[]> windowName(new wchar_t[MAX_PATH]);
|
|
|
|
|
|
|
|
GetClassNameW(hWnd, className.get(), MAX_PATH);
|
|
|
|
GetWindowTextW(hWnd, windowName.get(), MAX_PATH);
|
|
|
|
|
|
|
|
PrintLog("HWND 0x%p: ClassName \"%ls\", WindowName: \"%ls\"", hWnd, className.get(), windowName.get());
|
|
|
|
|
2021-03-13 15:51:58 +13:00
|
|
|
bool class_found = config.GetWindowWindowClass().compare(className.get()) == 0;
|
|
|
|
bool window_found = config.GetWindowWindowName().compare(windowName.get()) == 0;
|
2021-03-03 06:45:13 +13:00
|
|
|
bool force = config.GetBorderlessAllWindows();
|
2021-03-14 05:54:49 +13:00
|
|
|
bool ff13fix = OneTimeFixInit(className, hWnd);
|
2016-01-29 06:17:43 +13:00
|
|
|
|
2021-03-13 15:51:58 +13:00
|
|
|
return class_found || window_found || force || ff13fix;
|
2016-01-29 06:17:43 +13:00
|
|
|
}
|
|
|
|
|
2021-03-13 15:51:58 +13:00
|
|
|
void MainContext::ApplyWindow(HWND hWnd)
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
2021-03-14 05:54:49 +13:00
|
|
|
if (config.GetOptionsAlwaysActive() || config.GetOptionsHideCursor())
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
|
|
|
context.oldWndProc = (WNDPROC)context.TrueSetWindowLongA(hWnd, GWLP_WNDPROC, (LONG_PTR)context.WindowProc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainContext::ApplyBorderless(HWND hWnd)
|
|
|
|
{
|
2021-03-03 06:45:13 +13:00
|
|
|
if (config.GetBorderlessBorderless())
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
|
|
|
LONG_PTR dwStyle = GetWindowLongPtr(hWnd, GWL_STYLE);
|
|
|
|
LONG_PTR dwExStyle = GetWindowLongPtr(hWnd, GWL_EXSTYLE);
|
|
|
|
|
|
|
|
DWORD new_dwStyle = dwStyle & ~WS_OVERLAPPEDWINDOW;
|
2016-02-02 10:22:54 +13:00
|
|
|
DWORD new_dwExStyle = dwExStyle & ~(WS_EX_OVERLAPPEDWINDOW);
|
2016-01-29 06:17:43 +13:00
|
|
|
|
|
|
|
context.TrueSetWindowLongW(hWnd, GWL_STYLE, new_dwStyle);
|
|
|
|
context.TrueSetWindowLongW(hWnd, GWL_EXSTYLE, new_dwExStyle);
|
|
|
|
|
|
|
|
int cx = GetSystemMetrics(SM_CXSCREEN);
|
|
|
|
int cy = GetSystemMetrics(SM_CYSCREEN);
|
|
|
|
|
2021-03-13 15:51:58 +13:00
|
|
|
HWND insertAfter = HWND_TOP;
|
|
|
|
|
|
|
|
if (config.GetWindowTopMost())
|
|
|
|
insertAfter = HWND_TOPMOST;
|
|
|
|
|
|
|
|
SetWindowPos(hWnd, insertAfter, 0, 0, cx, cy, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
|
2018-04-27 07:37:42 +12:00
|
|
|
SetFocus(hWnd);
|
2016-01-29 06:17:43 +13:00
|
|
|
|
|
|
|
PrintLog("HWND 0x%p: Borderless dwStyle: %lX->%lX", hWnd, dwStyle, new_dwStyle);
|
|
|
|
PrintLog("HWND 0x%p: Borderless dwExStyle: %lX->%lX", hWnd, dwExStyle, new_dwExStyle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LRESULT CALLBACK MainContext::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
switch (uMsg)
|
|
|
|
{
|
|
|
|
|
|
|
|
case WM_ACTIVATE:
|
|
|
|
switch (LOWORD(wParam))
|
|
|
|
{
|
|
|
|
case WA_ACTIVE:
|
|
|
|
case WA_CLICKACTIVE:
|
|
|
|
while (::ShowCursor(FALSE) >= 0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WA_INACTIVE:
|
2021-03-03 06:45:13 +13:00
|
|
|
if (context.config.GetOptionsAlwaysActive())
|
2016-01-29 06:17:43 +13:00
|
|
|
return TRUE;
|
|
|
|
|
2021-03-14 05:54:49 +13:00
|
|
|
if (!context.config.GetOptionsForceHideCursor())
|
2019-09-01 06:58:56 +12:00
|
|
|
while (::ShowCursor(TRUE) < 0);
|
2016-01-29 06:17:43 +13:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case WM_ACTIVATEAPP:
|
2021-03-03 06:45:13 +13:00
|
|
|
if (context.config.GetOptionsAlwaysActive())
|
2016-01-29 06:17:43 +13:00
|
|
|
return TRUE;
|
|
|
|
}
|
2019-09-01 06:58:56 +12:00
|
|
|
|
2021-03-14 05:54:49 +13:00
|
|
|
if (context.config.GetOptionsForceHideCursor())
|
2019-09-01 06:58:56 +12:00
|
|
|
while (::ShowCursor(FALSE) >= 0);
|
|
|
|
|
2016-01-29 06:17:43 +13:00
|
|
|
return CallWindowProc(context.oldWndProc, hWnd, uMsg, wParam, lParam);
|
|
|
|
}
|
|
|
|
|
|
|
|
LONG WINAPI MainContext::HookSetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong)
|
|
|
|
{
|
2021-03-03 06:45:13 +13:00
|
|
|
if (context.config.GetBorderlessBorderless())
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
|
|
|
DWORD olddwNewLong = dwNewLong;
|
|
|
|
if (nIndex == GWL_STYLE)
|
|
|
|
{
|
|
|
|
dwNewLong &= ~WS_OVERLAPPEDWINDOW;
|
|
|
|
PrintLog("SetWindowLongA dwStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nIndex == GWL_EXSTYLE)
|
|
|
|
{
|
2016-02-02 10:22:54 +13:00
|
|
|
dwNewLong &= ~(WS_EX_OVERLAPPEDWINDOW);
|
2016-01-29 06:17:43 +13:00
|
|
|
PrintLog("SetWindowLongA dwExStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return context.TrueSetWindowLongA(hWnd, nIndex, dwNewLong);
|
|
|
|
}
|
|
|
|
|
|
|
|
LONG WINAPI MainContext::HookSetWindowLongW(HWND hWnd, int nIndex, LONG dwNewLong)
|
|
|
|
{
|
2021-03-03 06:45:13 +13:00
|
|
|
if (context.config.GetBorderlessBorderless())
|
2016-01-29 06:17:43 +13:00
|
|
|
{
|
|
|
|
DWORD olddwNewLong = dwNewLong;
|
|
|
|
if (nIndex == GWL_STYLE)
|
|
|
|
{
|
|
|
|
dwNewLong &= ~WS_OVERLAPPEDWINDOW;
|
|
|
|
PrintLog("SetWindowLongW dwStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nIndex == GWL_EXSTYLE)
|
|
|
|
{
|
2016-02-02 10:22:54 +13:00
|
|
|
dwNewLong &= ~(WS_EX_OVERLAPPEDWINDOW);
|
2016-01-29 06:17:43 +13:00
|
|
|
PrintLog("SetWindowLongW dwExStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return context.TrueSetWindowLongW(hWnd, nIndex, dwNewLong);
|
|
|
|
}
|
|
|
|
|
|
|
|
HWND WINAPI MainContext::HookCreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam)
|
|
|
|
{
|
|
|
|
HWND hWnd = context.TrueCreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
|
|
|
if (!hWnd)
|
|
|
|
{
|
|
|
|
PrintLog("CreateWindowExA failed");
|
|
|
|
return hWnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (context.CheckWindow(hWnd))
|
|
|
|
{
|
2021-03-13 15:51:58 +13:00
|
|
|
context.ApplyWindow(hWnd);
|
2016-01-29 06:17:43 +13:00
|
|
|
context.ApplyBorderless(hWnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hWnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
HWND WINAPI MainContext::HookCreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam)
|
|
|
|
{
|
|
|
|
HWND hWnd = context.TrueCreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
|
|
|
if (!hWnd)
|
|
|
|
{
|
|
|
|
PrintLog("CreateWindowExW failed");
|
|
|
|
return hWnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (context.CheckWindow(hWnd))
|
|
|
|
{
|
2021-03-13 15:51:58 +13:00
|
|
|
context.ApplyWindow(hWnd);
|
2016-01-29 06:17:43 +13:00
|
|
|
context.ApplyBorderless(hWnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hWnd;
|
|
|
|
}
|
2021-03-13 15:51:58 +13:00
|
|
|
|
|
|
|
bool MainContext::IsDXVK() { return D3D9DLL::Get().IsDXVK(); }
|