Skip to content

Commit

Permalink
decided to make ui in xaml islands, undo gui
Browse files Browse the repository at this point in the history
  • Loading branch information
rounk-ctrl committed Feb 11, 2022
1 parent be4e51b commit 323763a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 148 deletions.
92 changes: 0 additions & 92 deletions MicaForEveryone/IatHook.h

This file was deleted.

54 changes: 4 additions & 50 deletions MicaForEveryone/MicaForEveryone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);


int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
Expand Down Expand Up @@ -366,63 +365,17 @@ VOID CALLBACK WinEventProcCallback(HWINEVENTHOOK hWinEventHook, DWORD dwEvent, H
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HBRUSH hBrush;
hBrush = CreateSolidBrush(RGB(0, 0, 0));
HBRUSH brush = CreateSolidBrush(darkBkColor);
RtlGetVersion(&os);
static UINT s_uTaskbarRestart;
switch (message)
{
case WM_CREATE:
{
InitCommonControls();
AllowDarkModeForWindow(hWnd, true);
ApplyDarkTitleBar(hWnd, TRUE);
Title = CreateWindowW(L"static", L"",
WS_CHILD | WS_VISIBLE | SS_LEFT,
20, 20, 150, 35,
hWnd, (HMENU)1, NULL, NULL);

TitleBarText = CreateWindowW(L"static", L"",
WS_CHILD | WS_VISIBLE | SS_LEFT,
20, 70, 150, 35,
hWnd, (HMENU)1, NULL, NULL);

ColorText = CreateWindowW(L"static", L"",
WS_CHILD | WS_VISIBLE | SS_LEFT,
20, 100, 150, 35,
hWnd, (HMENU)1, NULL, NULL);
hWndComboBox = CreateWindowW(WC_COMBOBOX, TEXT(""),
CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE,
200, 70, 150, 10, hWnd, (HMENU)1, NULL, NULL);
ExtendText = CreateWindow(TEXT("button"), TEXT("Show Title"),
WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
20, 130, 200, 35,
hWnd, (HMENU)1, NULL, NULL);
TCHAR Planets[8][8] =
{
TEXT("Default"), TEXT("Light"), TEXT("Dark")
};
TCHAR A[16];
int k = 0;
memset(&A, 0, sizeof(A));
for (k = 0; k <= 2; k += 1)
{
wcscpy_s(A, sizeof(A) / sizeof(TCHAR), (TCHAR*)Planets[k]);
SendMessage(hWndComboBox, (UINT)CB_ADDSTRING, (WPARAM)0, (LPARAM)A);
}
SendMessage(hWndComboBox, CB_SETCURSEL, (WPARAM)0, (LPARAM)0);
SetWindowText(Title, L"Settings");
SetWindowText(TitleBarText, L"Titlebar Colour");
SetWindowText(ColorText, L"Backdrop Type");
SetWindowText(ExtendText, L"Extend Frame Into Client Area");
hFontBold = CreateFontW(35, 0, 0, 0, FW_SEMIBOLD, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, L"Segoe UI");
hFont = CreateFontW(18, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, L"Segoe UI");
SendMessage(Title, WM_SETFONT, WPARAM(hFontBold), TRUE);
SendMessage(TitleBarText, WM_SETFONT, WPARAM(hFont), TRUE);
SendMessage(ColorText, WM_SETFONT, WPARAM(hFont), TRUE);
SendMessage(hWndComboBox, WM_SETFONT, WPARAM(hFont), TRUE);
SendMessage(ExtendText, WM_SETFONT, WPARAM(hFont), TRUE);
SetWindowTheme(ExtendText, L"wstr", L"wstr");

DwmExtendFrameIntoClientArea(hWnd, &margins);
ApplyMica(hWnd);
hEvent = SetWinEventHook(EVENT_OBJECT_CREATE, EVENT_OBJECT_CREATE, NULL,
Expand Down Expand Up @@ -469,13 +422,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_CTLCOLORSTATIC:
{
HDC hdc = reinterpret_cast<HDC>(wParam);
HWND hWnd = (HWND)lParam;
SetTextColor(hdc, darkTextColor);
SetBkColor(hdc, darkBkColor);
if (!hbrBkgnd)
hbrBkgnd = CreateSolidBrush(darkBkColor);
return reinterpret_cast<INT_PTR>(hbrBkgnd);
}
break;
break;
case WM_CTLCOLORLISTBOX:
{
HDC hdc = reinterpret_cast<HDC>(wParam);
Expand Down
5 changes: 0 additions & 5 deletions MicaForEveryone/MicaForEveryone.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "resource.h"
#include "framework.h"
#include "IatHook.h"


// functions
Expand All @@ -12,10 +11,6 @@ constexpr COLORREF darkBkColor = 0x000000;
constexpr COLORREF darkTextColor = 0xFFFFFF;
static HBRUSH hbrBkgnd = nullptr;

#ifndef HINST_THISCOMPONENT
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)
#endif
enum IMMERSIVE_HC_CACHE_MODE
{
IHCM_USE_CACHED_VALUE,
Expand Down
1 change: 0 additions & 1 deletion MicaForEveryone/MicaForEveryone.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="framework.h" />
<ClInclude Include="IatHook.h" />
<ClInclude Include="MicaForEveryone.h" />
<ClInclude Include="MicaForEveryoneHelper.h" />
<ClInclude Include="Resource.h" />
Expand Down

0 comments on commit 323763a

Please sign in to comment.