Compare commits

..

1 Commits

Author SHA1 Message Date
Quantum
9e6f21f91e [idd] helper: implement UI for default refresh rate
The UI is not yet hooked up to anything.
2025-11-08 22:54:35 -05:00
4 changed files with 7 additions and 15 deletions

View File

@@ -111,9 +111,9 @@ LRESULT CConfigWindow::onCreate()
m_heightLabel.reset(new CStaticWidget(L"Height:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
m_refreshLabel.reset(new CStaticWidget(L"Refresh:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
m_modeWidth.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
m_modeHeight.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
m_modeWidth.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT, m_hwnd));
m_modeHeight.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT, m_hwnd));
m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT, m_hwnd));
m_modeUpdate.reset(new CButton(L"Save", WS_CHILD | WS_VISIBLE, m_hwnd));
m_modeDelete.reset(new CButton(L"Delete", WS_CHILD | WS_VISIBLE, m_hwnd));
@@ -220,7 +220,7 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
LRESULT result = m_settings.setModes(*m_modes);
if (result != ERROR_SUCCESS)
DEBUG_ERROR_HR((HRESULT) result, "Failed to save modes");
DEBUG_ERROR_HR(result, "Failed to save modes");
}
else if (hwnd == *m_modeDelete && code == BN_CLICKED && m_modes)
{
@@ -234,7 +234,7 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
LRESULT result = m_settings.setModes(*m_modes);
if (result != ERROR_SUCCESS)
DEBUG_ERROR_HR((HRESULT) result, "Failed to save modes");
DEBUG_ERROR_HR(result, "Failed to save modes");
updateModeList();
onModeListSelectChange();

View File

@@ -15,7 +15,7 @@ std::wstring CEditWidget::getValue()
{
std::wstring result;
result.resize(Edit_GetTextLength(m_hwnd));
Edit_GetText(m_hwnd, result.data(), (int) (result.size() + 1));
Edit_GetText(m_hwnd, result.data(), result.size() + 1);
return result;
}

View File

@@ -42,7 +42,7 @@ int CListBox::getSel()
int CListBox::getData(int index)
{
return (int) ListBox_GetItemData(m_hwnd, index);
return ListBox_GetItemData(m_hwnd, index);
}
void CListBox::setSel(int index)

View File

@@ -51,7 +51,6 @@ LRESULT CNotifyWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
case WM_NOTIFY_ICON:
return onNotifyIcon(LOWORD(lParam), HIWORD(lParam), GET_X_LPARAM(wParam), GET_Y_LPARAM(wParam));
case WM_CLEAN_UP_CONFIG:
if (m_config && !m_config->hwnd())
{
@@ -59,7 +58,6 @@ LRESULT CNotifyWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
m_config.reset();
}
return 0;
default:
if (s_taskbarCreated && uMsg == s_taskbarCreated)
{
@@ -72,9 +70,6 @@ LRESULT CNotifyWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT CNotifyWindow::onCreate()
{
// Allow explorer to send us this message to register the notification icon.
ChangeWindowMessageFilterEx(m_hwnd, s_taskbarCreated, MSGFLT_ALLOW, NULL);
registerIcon();
return 0;
}
@@ -134,10 +129,7 @@ void CNotifyWindow::registerIcon()
StringCbCopy(m_iconData.szTip, sizeof m_iconData.szTip, L"Looking Glass (IDD)");
if (!Shell_NotifyIcon(NIM_ADD, &m_iconData))
{
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_ADD)");
return;
}
if (!Shell_NotifyIcon(NIM_SETVERSION, &m_iconData))
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_SETVERSION)");