|
|
|
|
@ -517,6 +517,79 @@ void LVT_StartUI_EnableRoundedCorners(HWND hWnd, DWORD dwReceipe, DWORD dwPos, H
@@ -517,6 +517,79 @@ void LVT_StartUI_EnableRoundedCorners(HWND hWnd, DWORD dwReceipe, DWORD dwPos, H
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void LVT_StartDocked_120DPIHack(int maxHeight) |
|
|
|
|
{ |
|
|
|
|
HRESULT hr = S_OK; |
|
|
|
|
Windows_UI_Xaml_IDependencyObject* pRootDependencyObject = NULL; |
|
|
|
|
if (SUCCEEDED(hr)) |
|
|
|
|
{ |
|
|
|
|
HSTRING_HEADER hshWindowStatics; |
|
|
|
|
HSTRING hsWindowStatics = NULL; |
|
|
|
|
hr = WindowsCreateStringReference(L"Windows.UI.Xaml.Window", 22, &hshWindowStatics, &hsWindowStatics); |
|
|
|
|
if (SUCCEEDED(hr) && hsWindowStatics) |
|
|
|
|
{ |
|
|
|
|
Windows_UI_Xaml_IWindowStatics* pWindowStatics = NULL; |
|
|
|
|
hr = RoGetActivationFactory(hsWindowStatics, &IID_Windows_UI_Xaml_IWindowStatics, &pWindowStatics); |
|
|
|
|
if (SUCCEEDED(hr)) |
|
|
|
|
{ |
|
|
|
|
Windows_UI_Xaml_IWindow* pWindow = NULL; |
|
|
|
|
hr = pWindowStatics->lpVtbl->get_Current(pWindowStatics, &pWindow); |
|
|
|
|
if (SUCCEEDED(hr)) |
|
|
|
|
{ |
|
|
|
|
IInspectable* pUIElement = NULL; |
|
|
|
|
hr = pWindow->lpVtbl->get_Content(pWindow, &pUIElement); |
|
|
|
|
if (SUCCEEDED(hr)) |
|
|
|
|
{ |
|
|
|
|
hr = pUIElement->lpVtbl->QueryInterface(pUIElement, &IID_Windows_UI_Xaml_IDependencyObject, &pRootDependencyObject); |
|
|
|
|
|
|
|
|
|
pUIElement->lpVtbl->Release(pUIElement); |
|
|
|
|
} |
|
|
|
|
pWindow->lpVtbl->Release(pWindow); |
|
|
|
|
} |
|
|
|
|
pWindowStatics->lpVtbl->Release(pWindowStatics); |
|
|
|
|
} |
|
|
|
|
WindowsDeleteString(hsWindowStatics); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (pRootDependencyObject) |
|
|
|
|
{ |
|
|
|
|
HSTRING_HEADER hshVisualTreeHelperStatics; |
|
|
|
|
HSTRING hsVisualTreeHelperStatics = NULL; |
|
|
|
|
hr = WindowsCreateStringReference(L"Windows.UI.Xaml.Media.VisualTreeHelper", 38, &hshVisualTreeHelperStatics, &hsVisualTreeHelperStatics); |
|
|
|
|
if (SUCCEEDED(hr) && hsVisualTreeHelperStatics) |
|
|
|
|
{ |
|
|
|
|
Windows_UI_Xaml_IVisualTreeHelperStatics* pVisualTreeHelperStatics = NULL; |
|
|
|
|
hr = RoGetActivationFactory(hsVisualTreeHelperStatics, &IID_Windows_UI_Xaml_IVisualTreeHelperStatics, &pVisualTreeHelperStatics); |
|
|
|
|
if (SUCCEEDED(hr)) |
|
|
|
|
{ |
|
|
|
|
Windows_UI_Xaml_IDependencyObject* pStartSizingFrame = LVT_FindChildByClassName(pRootDependencyObject, pVisualTreeHelperStatics, L"StartDocked.StartSizingFrame", NULL); |
|
|
|
|
if (pStartSizingFrame) |
|
|
|
|
{ |
|
|
|
|
Windows_UI_Xaml_IUIElement* pIUIElement = NULL; |
|
|
|
|
pStartSizingFrame->lpVtbl->QueryInterface(pStartSizingFrame, &IID_Windows_UI_Xaml_IUIElement, &pIUIElement); |
|
|
|
|
if (pIUIElement) |
|
|
|
|
{ |
|
|
|
|
Windows_UI_Xaml_IFrameworkElement* pFrameworkElement = NULL; |
|
|
|
|
pStartSizingFrame->lpVtbl->QueryInterface(pStartSizingFrame, &IID_Windows_UI_Xaml_IFrameworkElement, &pFrameworkElement); |
|
|
|
|
if (pFrameworkElement) |
|
|
|
|
{ |
|
|
|
|
pIUIElement->lpVtbl->put_Visibility(pIUIElement, Windows_UI_Xaml_Visibility_Collapsed); |
|
|
|
|
pFrameworkElement->lpVtbl->put_MaxHeight(pFrameworkElement, maxHeight); |
|
|
|
|
pIUIElement->lpVtbl->put_Visibility(pIUIElement, Windows_UI_Xaml_Visibility_Visible); |
|
|
|
|
pFrameworkElement->lpVtbl->Release(pFrameworkElement); |
|
|
|
|
} |
|
|
|
|
pIUIElement->lpVtbl->Release(pIUIElement); |
|
|
|
|
} |
|
|
|
|
pStartSizingFrame->lpVtbl->Release(pStartSizingFrame); |
|
|
|
|
} |
|
|
|
|
pVisualTreeHelperStatics->lpVtbl->Release(pVisualTreeHelperStatics); |
|
|
|
|
} |
|
|
|
|
WindowsDeleteString(hsVisualTreeHelperStatics); |
|
|
|
|
} |
|
|
|
|
pRootDependencyObject->lpVtbl->Release(pRootDependencyObject); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Reference: https://www.reddit.com/r/Windows11/comments/p1ksou/this_is_not_a_concept_microsoft_in_windows_11/
|
|
|
|
|
void LVT_StartDocked_DisableRecommendedSection(HWND hWnd, BOOL bApply, RECT* rect) |
|
|
|
|
{ |
|
|
|
|
@ -604,6 +677,20 @@ void LVT_StartDocked_DisableRecommendedSection(HWND hWnd, BOOL bApply, RECT* rec
@@ -604,6 +677,20 @@ void LVT_StartDocked_DisableRecommendedSection(HWND hWnd, BOOL bApply, RECT* rec
|
|
|
|
|
SetRect(&rc, drc.Left, drc.Top, drc.Right, drc.Bottom); |
|
|
|
|
SetRect(&rc, MulDiv(rc.left, dpi, 96), MulDiv(rc.top, dpi, 96), MulDiv(rc.right, dpi, 96), MulDiv(rc.bottom, dpi, 96)); |
|
|
|
|
*rect = rc; |
|
|
|
|
if (bApply && dpi == 120) |
|
|
|
|
{ |
|
|
|
|
HANDLE hRealThreadHandle = NULL; |
|
|
|
|
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hRealThreadHandle, THREAD_SET_CONTEXT, FALSE, 0); |
|
|
|
|
if (hRealThreadHandle) |
|
|
|
|
{ |
|
|
|
|
QueueUserAPC(LVT_StartDocked_120DPIHack, hRealThreadHandle, 826); |
|
|
|
|
CloseHandle(hRealThreadHandle); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (pFrameworkElement) |
|
|
|
|
{ |
|
|
|
|
pFrameworkElement->lpVtbl->put_MaxHeight(pFrameworkElement, 726.0); |
|
|
|
|
} |
|
|
|
|
if (pFrameworkElement) |
|
|
|
|
{ |
|
|
|
|
pFrameworkElement->lpVtbl->Release(pFrameworkElement); |
|
|
|
|
|