Skip to content

Commit

Permalink
basic glass implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ALTaleX531 committed Jun 28, 2024
1 parent 60ca882 commit f7411e1
Show file tree
Hide file tree
Showing 23 changed files with 2,250 additions and 974 deletions.
442 changes: 0 additions & 442 deletions OpenGlass/BackdropManager.cpp

This file was deleted.

56 changes: 0 additions & 56 deletions OpenGlass/BackdropManager.hpp

This file was deleted.

10 changes: 4 additions & 6 deletions OpenGlass/CaptionTextHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,8 @@ HRESULT CaptionTextHandler::Startup()
);
RETURN_LAST_ERROR_IF_NULL(g_IWICImagingFactory2_CreateBitmapFromHBITMAP_Org);

HMODULE udwmModule{ GetModuleHandleW(L"uDwm.dll") };
g_DrawTextW_Org = reinterpret_cast<decltype(g_DrawTextW_Org)>(HookHelper::WriteIAT(udwmModule, "user32.dll", "DrawTextW", MyDrawTextW));
g_CreateBitmap_Org = reinterpret_cast<decltype(g_CreateBitmap_Org)>(HookHelper::WriteIAT(udwmModule, "gdi32.dll", "CreateBitmap", MyCreateBitmap));
g_DrawTextW_Org = reinterpret_cast<decltype(g_DrawTextW_Org)>(HookHelper::WriteIAT(uDwm::g_moduleHandle, "user32.dll", "DrawTextW", MyDrawTextW));
g_CreateBitmap_Org = reinterpret_cast<decltype(g_CreateBitmap_Org)>(HookHelper::WriteIAT(uDwm::g_moduleHandle, "gdi32.dll", "CreateBitmap", MyCreateBitmap));

HookHelper::Detours::Write([]()
{
Expand Down Expand Up @@ -348,14 +347,13 @@ void CaptionTextHandler::Shutdown()
g_IWICImagingFactory2_CreateBitmapFromHBITMAP_Org
);
}
HMODULE udwmModule{ GetModuleHandleW(L"uDwm.dll") };
if (g_DrawTextW_Org)
{
HookHelper::WriteIAT(udwmModule, "user32.dll", "DrawTextW", g_DrawTextW_Org);
HookHelper::WriteIAT(uDwm::g_moduleHandle, "user32.dll", "DrawTextW", g_DrawTextW_Org);
}
if (g_CreateBitmap_Org)
{
HookHelper::WriteIAT(udwmModule, "gdi32.dll", "CreateBitmap", g_CreateBitmap_Org);
HookHelper::WriteIAT(uDwm::g_moduleHandle, "gdi32.dll", "CreateBitmap", g_CreateBitmap_Org);
}

g_textVisual = nullptr;
Expand Down
3 changes: 2 additions & 1 deletion OpenGlass/ConfigurationFramework.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "pch.h"
#include "ConfigurationFramework.hpp"
#include "BackdropManager.hpp"
#include "CaptionTextHandler.hpp"
#include "GlassFramework.hpp"
#include "GlassRenderer.hpp"
#include "CustomMsstyleLoader.hpp"
#include "ServiceApi.hpp"

Expand All @@ -16,6 +16,7 @@ namespace OpenGlass::ConfigurationFramework
void ConfigurationFramework::Update(UpdateType type)
{
GlassFramework::UpdateConfiguration(type);
GlassRenderer::UpdateConfiguration(type);
CaptionTextHandler::UpdateConfiguration(type);
CustomMsstyleLoader::UpdateConfiguration(type);
DwmFlush();
Expand Down
1 change: 0 additions & 1 deletion OpenGlass/ConfigurationFramework.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "framework.hpp"
#include "cpprt.hpp"
#include "winrt.hpp"
#include "uDwmProjection.hpp"

namespace OpenGlass::ConfigurationFramework
Expand Down
Loading

0 comments on commit f7411e1

Please sign in to comment.