Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
00fox authored Oct 27, 2021
1 parent 0455c2c commit 728d019
Show file tree
Hide file tree
Showing 17 changed files with 750 additions and 571 deletions.
64 changes: 30 additions & 34 deletions Ds2vjoy/Ds2vJoy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ ATOM RegisterWndClass(HINSTANCE hInstance)
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DS2VJOY_ICON));
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
// wcex.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
// wcex.hbrBackground = CreateSolidBrush(RGB(0, 0, 0));
// wcex.lpszMenuName = MAKEINTRESOURCEW(IDS_DS2VJOY);
wcex.lpszMenuName = 0;
Expand Down Expand Up @@ -815,6 +816,30 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

switch (message)
{
case WM_CTLCOLOREDIT:
{
HDC hdcStatic = (HDC)wParam;
SetTextColor((HDC)wParam, tape.Tx_EDIT_TERMINAL);
SetBkMode((HDC)wParam, OPAQUE);
SetBkColor(hdcStatic, tape.Bk_EDIT);
return (LRESULT)tape.hB_EDIT_TERMINAL;
}
case WM_PAINT:
{
if (!IsIconic(hWnd))
{
PAINTSTRUCT ps;
HDC hDC = BeginPaint(hWnd, &ps);

RECT rect;
GetClientRect(hWnd, &rect);
FillRect(hDC, &rect, tape.hB_BackGround);

::ReleaseDC(hWnd, hDC);
EndPaint(hWnd, &ps);
}
return FALSE;
}
case WM_MEASUREITEM:
{
LPMEASUREITEMSTRUCT DrawMenuSize = (LPMEASUREITEMSTRUCT)lParam;
Expand Down Expand Up @@ -875,16 +900,12 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
BOOL bSelected = DrawMenuStructure->itemState & ODS_SELECTED;

// Background
HBRUSH hBrushColor = ::CreateSolidBrush(RGB(200, 200, 205));
::FillRect(DrawMenuStructure->hDC, &(DrawMenuStructure->rcItem), hBrushColor);

// Highlight
if (DrawMenuStructure->itemState & ODS_SELECTED)
{
hBrushColor = ::CreateSolidBrush(::GetSysColor(COLOR_HIGHLIGHT));
::FillRect(DrawMenuStructure->hDC, &(DrawMenuStructure->rcItem), hBrushColor);
}
::FillRect(DrawMenuStructure->hDC, &(DrawMenuStructure->rcItem), tape.hB_MENU_HIGHLIGHT);
// Background
else
::FillRect(DrawMenuStructure->hDC, &(DrawMenuStructure->rcItem), tape.hB_MENU_CLONE);

// Caption
WCHAR wszBuffer[MAX_PATH];
Expand All @@ -893,7 +914,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
COLORREF crPrevText = 0;
COLORREF crCurrText = 0;
crCurrText = ::GetSysColor((bSelected) ? COLOR_HIGHLIGHTTEXT : RGB(166, 134, 170));
crCurrText = ::GetSysColor((bSelected) ? tape.Tx_MENU_HIGHLIGHT : tape.Tx_MENU);
crPrevText = ::SetTextColor(DrawMenuStructure->hDC, crCurrText);

int nAcceleratorDelimiter;
Expand Down Expand Up @@ -941,31 +962,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
break;
}
case WM_CTLCOLOREDIT:
{
HDC hdcStatic = (HDC)wParam;
SetTextColor((HDC)wParam, RGB(172, 196, 226));
SetBkMode((HDC)wParam, OPAQUE);
SetBkColor(hdcStatic, RGB(0, 0, 0));
return (INT_PTR)CreateSolidBrush(RGB(0, 0, 0));
}
case WM_PAINT:
{
if (!IsIconic(hWnd))
{
PAINTSTRUCT ps;
HDC hDC = BeginPaint(hWnd, &ps);

RECT rect;
GetClientRect(hWnd, &rect);

HBRUSH brush = CreateSolidBrush(RGB(210, 210, 215));
FillRect(hDC, &rect, brush);
DeleteObject(brush);
EndPaint(hWnd, &ps);
}
return FALSE;
}
case WM_SHOWWINDOW:
switch (TabCtrl_GetCurSel(hTab))
{
Expand Down
Binary file modified Ds2vjoy/Ds2vJoy.rc
Binary file not shown.
121 changes: 60 additions & 61 deletions Ds2vjoy/GuardianDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,102 +42,104 @@ INT_PTR GuardianDlg::_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch (uMsg)
{
case WM_CTLCOLORDLG:
{
HDC hdcStatic = (HDC)wParam;
SetTextColor(hdcStatic, tape.Tx_DLG);
SetBkMode(hdcStatic, TRANSPARENT);
SetBkColor(hdcStatic, tape.Bk_DLG);
return (LRESULT)tape.hB_DLG;
}
case WM_CTLCOLORMSGBOX:
{
HDC hdcStatic = (HDC)wParam;
SetTextColor(hdcStatic, tape.Tx_MSGBOX);
SetBkMode(hdcStatic, TRANSPARENT);
SetBkColor(hdcStatic, tape.Bk_MSGBOX);
return (LRESULT)tape.hB_MSGBOX;
}
case WM_CTLCOLORSCROLLBAR:
{
HDC hdcStatic = (HDC)wParam;
static HBRUSH hBrushColor;
hBrushColor = CreateSolidBrush(RGB(191, 200, 196));
SetTextColor(hdcStatic, RGB(10, 10, 10));
SetTextColor(hdcStatic, tape.Tx_SCROLLBAR);
SetBkMode(hdcStatic, TRANSPARENT);
SetBkColor(hdcStatic, RGB(191, 200, 196));
return (LRESULT)hBrushColor;
SetBkColor(hdcStatic, tape.Bk_SCROLLBAR);
return (LRESULT)tape.hB_SCROLLBAR;
}
case WM_CTLCOLORBTN:
{
DWORD CtrlID = GetDlgCtrlID((HWND)lParam);
HDC hdcStatic = (HDC)wParam;
static HBRUSH hBrushColor = CreateSolidBrush(RGB(128, 128, 128));
DWORD CtrlID = GetDlgCtrlID((HWND)lParam);
SetBkMode(hdcStatic, TRANSPARENT);

switch (hid.GetHidGState())
{
case -1:
case 0:
if (CtrlID == IDC_HID_GUARDIAN_INSTALL) hBrushColor = CreateSolidBrush(RGB(160, 160, 160));
if (CtrlID == IDC_HID_GUARDIAN_STATUS) hBrushColor = CreateSolidBrush(RGB(160, 160, 160));
if (CtrlID == IDC_HID_GUARDIAN_INSTALL) return (LRESULT)tape.hB_Not_Installed;
if (CtrlID == IDC_HID_GUARDIAN_STATUS) return (LRESULT)tape.hB_Not_Installed;
break;
case 1:
if (CtrlID == IDC_HID_GUARDIAN_INSTALL) hBrushColor = CreateSolidBrush(RGB(240, 240, 0));
if (CtrlID == IDC_HID_GUARDIAN_INSTALL) return (LRESULT)tape.hB_Running;
if (CtrlID == IDC_HID_GUARDIAN_STATUS)
{
if (tmpGstate)
hBrushColor = CreateSolidBrush(RGB(96, 160, 96));
return (LRESULT)tape.hB_Paused;
else
hBrushColor = CreateSolidBrush(RGB(240, 240, 0));
return (LRESULT)tape.hB_Running;
}
break;
case 2:
if (CtrlID == IDC_HID_GUARDIAN_INSTALL) hBrushColor = CreateSolidBrush(RGB(240, 240, 0));
if (CtrlID == IDC_HID_GUARDIAN_STATUS) hBrushColor = CreateSolidBrush(RGB(96, 192, 96));
if (CtrlID == IDC_HID_GUARDIAN_INSTALL) return (LRESULT)tape.hB_Running;
if (CtrlID == IDC_HID_GUARDIAN_STATUS) return (LRESULT)tape.hB_Paused;
break;
}
switch (hid.GetHidCState())
{
case -1:
case 0:
if (CtrlID == IDC_HID_CERBERUS_INSTALL) hBrushColor = CreateSolidBrush(RGB(160, 160, 160));
if (CtrlID == IDC_HID_CERBERUS_STATUS) hBrushColor = CreateSolidBrush(RGB(160, 160, 160));
if (CtrlID == IDC_HID_CERBERUS_INSTALL) return (LRESULT)tape.hB_Not_Installed;
if (CtrlID == IDC_HID_CERBERUS_STATUS) return (LRESULT)tape.hB_Not_Installed;
break;
case 2:
case 4:
case 5:
if (CtrlID == IDC_HID_CERBERUS_INSTALL) hBrushColor = CreateSolidBrush(RGB(240, 240, 0));
if (CtrlID == IDC_HID_CERBERUS_STATUS) hBrushColor = CreateSolidBrush(RGB(240, 240, 0));
if (CtrlID == IDC_HID_CERBERUS_INSTALL) return (LRESULT)tape.hB_Running;
if (CtrlID == IDC_HID_CERBERUS_STATUS) return (LRESULT)tape.hB_Running;
break;
case 1:
case 3:
if (CtrlID == IDC_HID_CERBERUS_INSTALL)hBrushColor = CreateSolidBrush(RGB(240, 240, 0));
if (CtrlID == IDC_HID_CERBERUS_STATUS) hBrushColor = CreateSolidBrush(RGB(255, 140, 0));
if (CtrlID == IDC_HID_CERBERUS_INSTALL) return (LRESULT)tape.hB_Running;
if (CtrlID == IDC_HID_CERBERUS_STATUS) return (LRESULT)tape.hB_Stopped;
break;
case 6:
case 7:
if (CtrlID == IDC_HID_CERBERUS_INSTALL) hBrushColor = CreateSolidBrush(RGB(240, 240, 0));
if (CtrlID == IDC_HID_CERBERUS_STATUS) hBrushColor = CreateSolidBrush(RGB(96, 192, 96));
if (CtrlID == IDC_HID_CERBERUS_INSTALL) return (LRESULT)tape.hB_Running;
if (CtrlID == IDC_HID_CERBERUS_STATUS) return (LRESULT)tape.hB_Paused;
break;
}
return (LRESULT)hBrushColor;
return TRUE;
return (LRESULT)tape.hB_Grey;
}
case WM_CTLCOLORSTATIC:
{
HDC hdcStatic = (HDC)wParam;
static HBRUSH hBrushColor;
hBrushColor = CreateSolidBrush(RGB(210, 210, 215));
SetTextColor(hdcStatic, RGB(100, 93, 79));
SetTextColor(hdcStatic, tape.Tx_STATIC);
SetBkMode(hdcStatic, TRANSPARENT);
SetBkColor(hdcStatic, RGB(36, 163, 163));
return (LRESULT)hBrushColor;
SetBkColor(hdcStatic, tape.Bk_STATIC);
return (LRESULT)tape.hB_STATIC;
}
case WM_CTLCOLOREDIT:
{
HDC hdcStatic = (HDC)wParam;
static HBRUSH hBrushColor;
hBrushColor = CreateSolidBrush(RGB(228, 228, 232));
SetTextColor(hdcStatic, RGB(10, 10, 10));
SetTextColor(hdcStatic, tape.Tx_EDIT);
SetBkMode(hdcStatic, TRANSPARENT);
SetBkColor(hdcStatic, RGB(255, 255, 0));
return (LRESULT)hBrushColor;
return (LRESULT)tape.hB_EDIT;
}
case WM_CTLCOLORLISTBOX:
{
HDC hdcStatic = (HDC)wParam;
static HBRUSH hBrushColor;
hBrushColor = CreateSolidBrush(RGB(216, 215, 220));
SetTextColor(hdcStatic, RGB(10, 10, 10));
SetTextColor(hdcStatic, tape.Tx_LISTBOX);
SetBkMode(hdcStatic, TRANSPARENT);
SetBkColor(hdcStatic, RGB(255, 255, 0));
return (LRESULT)hBrushColor;
return (LRESULT)tape.hB_LISTBOX;
}
case WM_PAINT:
{
Expand All @@ -148,31 +150,25 @@ INT_PTR GuardianDlg::_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

RECT rect;
GetClientRect(hWnd, &rect);

HBRUSH brush = CreateSolidBrush(RGB(210, 210, 215));
FillRect(hDC, &rect, brush);
FillRect(hDC, &rect, tape.hB_BackGround);

SetRect(&rect, 351, 103, 366, 113);
brush = CreateSolidBrush(RGB(160, 160, 160));
FillRect(hDC, &rect, brush);
FillRect(hDC, &rect, tape.hB_Not_Installed);

SetRect(&rect, 351, 119, 366, 129);
brush = CreateSolidBrush(RGB(240, 240, 0));
FillRect(hDC, &rect, brush);
FillRect(hDC, &rect, tape.hB_Running);

SetRect(&rect, 402, 103, 415, 113);
brush = CreateSolidBrush(RGB(255, 140, 0));
FillRect(hDC, &rect, brush);
FillRect(hDC, &rect, tape.hB_Stopped);

SetRect(&rect, 402, 119, 415, 129);
brush = CreateSolidBrush(RGB(96, 192, 96));
FillRect(hDC, &rect, brush);
FillRect(hDC, &rect, tape.hB_Paused);

LPCWSTR b1Text = L"Waiting...";
LPCWSTR b2Text = L"Waiting...";
LPCWSTR b3Text = L"Waiting...";
LPCWSTR b4Text = L"Waiting...";
SetTextColor(hDC, RGB(10, 10, 10));
SetTextColor(hDC, tape.TextColor);
switch (hid.GetHidGState())
{
case -1:
Expand Down Expand Up @@ -214,38 +210,41 @@ INT_PTR GuardianDlg::_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
}

brush = CreateSolidBrush(RGB(195, 195, 200));
HFONT hFont = CreateFont(13, 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_SWISS, L"Segoe UI");


::ReleaseDC(hWnd, hDC);
hDC = BeginPaint(GetDlgItem(hWnd, IDC_HID_GUARDIAN_INSTALL), &ps);
GetClientRect(GetDlgItem(hWnd, IDC_HID_GUARDIAN_INSTALL), &rect);
HFONT oldHFont = (HFONT)SelectObject(hDC, hFont);
DrawText(hDC, b1Text, 9, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SelectObject(hDC, oldHFont);
FrameRect(hDC, &rect, brush);
FrameRect(hDC, &rect, tape.hB_BTN_Border);

::ReleaseDC(hWnd, hDC);
hDC = BeginPaint(GetDlgItem(hWnd, IDC_HID_GUARDIAN_STATUS), &ps);
GetClientRect(GetDlgItem(hWnd, IDC_HID_GUARDIAN_STATUS), &rect);
oldHFont = (HFONT)SelectObject(hDC, hFont);
DrawText(hDC, b2Text, 9, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SelectObject(hDC, oldHFont);
FrameRect(hDC, &rect, brush);
FrameRect(hDC, &rect, tape.hB_BTN_Border);

::ReleaseDC(hWnd, hDC);
hDC = BeginPaint(GetDlgItem(hWnd, IDC_HID_CERBERUS_INSTALL), &ps);
GetClientRect(GetDlgItem(hWnd, IDC_HID_CERBERUS_INSTALL), &rect);
oldHFont = (HFONT)SelectObject(hDC, hFont);
DrawText(hDC, b3Text, 9, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SelectObject(hDC, oldHFont);
FrameRect(hDC, &rect, brush);
FrameRect(hDC, &rect, tape.hB_BTN_Border);

::ReleaseDC(hWnd, hDC);
hDC = BeginPaint(GetDlgItem(hWnd, IDC_HID_CERBERUS_STATUS), &ps);
GetClientRect(GetDlgItem(hWnd, IDC_HID_CERBERUS_STATUS), &rect);
oldHFont = (HFONT)SelectObject(hDC, hFont);
DrawText(hDC, b4Text, 9, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SelectObject(hDC, oldHFont);
FrameRect(hDC, &rect, brush);
FrameRect(hDC, &rect, tape.hB_BTN_Border);

DeleteObject(brush);
::ReleaseDC(hWnd, hDC);
EndPaint(hWnd, &ps);
}
return FALSE;
Expand Down Expand Up @@ -289,10 +288,10 @@ INT_PTR GuardianDlg::_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(hWnd, IDC_STATIC_INSTALL, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
}
break;
case WM_INITDIALOG: {
case WM_INITDIALOG:
return TRUE;
}
case WM_COMMAND: {
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
case IDC_HID_HID1:
Expand Down
Loading

0 comments on commit 728d019

Please sign in to comment.