Skip to content

Commit

Permalink
add ref to og project (gui)
Browse files Browse the repository at this point in the history
  • Loading branch information
rounk-ctrl committed Feb 9, 2022
1 parent 2dbab2a commit 5814371
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
35 changes: 33 additions & 2 deletions MicaForEveryone/MicaForEveryone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
ShowWindow(Title, SW_SHOW);
SetWindowText(Title, L"Settings");
hFont = 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");
SendMessage(Title, WM_SETFONT, WPARAM(hFont), TRUE);
SendMessage(Title, WM_SETFONT, WPARAM(hFont), TRUE);
DwmExtendFrameIntoClientArea(hWnd, &margins);
hEvent = SetWinEventHook(EVENT_OBJECT_CREATE, EVENT_OBJECT_CREATE, NULL,
WinEventProcCallback, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNTHREAD);
s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated"));
Expand Down Expand Up @@ -594,24 +595,38 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
return 0;
}

// Message handler for about box.
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
BOOL ok = TRUE;
UNREFERENCED_PARAMETER(lParam);
DWORD dwStyle;
switch (message)
{
case WM_INITDIALOG:
{
SetWindowTheme(GetDlgItem(hDlg, IDOK), L"Explorer", nullptr);
SendMessageW(hDlg, WM_THEMECHANGED, 0, 0);
HFONT hOrigFont = (HFONT)SendMessage(GetDlgItem(hDlg, IDC_STATIC_LINK), WM_GETFONT, 0, 0);
LOGFONT lf;
GetObject(hOrigFont, sizeof(lf), &lf);
lf.lfUnderline = TRUE;
HFONT hFont = CreateFontIndirect(&lf);
SendMessage(GetDlgItem(hDlg, IDC_STATIC_LINK), WM_SETFONT, WPARAM(hFont), TRUE);
}
return (INT_PTR)TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
switch (LOWORD(wParam))
{
case IDC_STATIC_LINK:
ShellExecute(NULL, L"open", L"https://github.com/minusium/MicaForEveryone", NULL, NULL, SW_SHOWNORMAL);
return TRUE;
}
break;
case WM_CTLCOLORDLG:
return (INT_PTR)CreateSolidBrush(darkBkColor);
Expand All @@ -622,9 +637,25 @@ INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
SetBkColor(hdc, darkBkColor);
if (!hbrBkgnd)
hbrBkgnd = CreateSolidBrush(darkBkColor);
if ((HWND)lParam == GetDlgItem(hDlg, IDC_STATIC_LINK))
{
SetTextColor((HDC)wParam, RGB(166, 216, 255));
}
return reinterpret_cast<INT_PTR>(hbrBkgnd);

}
break;
case WM_SETCURSOR:
{
if ((HWND)(wParam) == ::GetDlgItem(hDlg, IDC_STATIC_LINK))
{
HCURSOR hCursorHelp = ::LoadCursor(NULL, IDC_HAND);
::SetCursor(hCursorHelp);
::SetWindowLongPtr(hDlg, DWLP_MSGRESULT, TRUE);
return TRUE; // indicate we processed this message
}
return FALSE; // do default handling
}
case WM_DESTROY:
if (hbrBkgnd)
{
Expand Down
Binary file modified MicaForEveryone/MicaForEveryone.rc
Binary file not shown.
3 changes: 2 additions & 1 deletion MicaForEveryone/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define IDC_MICAFOREVERYONE 109
#define IDR_MAINFRAME 128
#define IDC_SYSLINK1 1001
#define IDC_STATIC_LINK 1003
#define IDM_DEFAULT 32794
#define IDM_LIGHT 32795
#define IDM_DARK 32796
Expand All @@ -36,7 +37,7 @@
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 32816
#define _APS_NEXT_CONTROL_VALUE 1002
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

0 comments on commit 5814371

Please sign in to comment.