mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-12-14 20:18:14 +00:00
Compare commits
4 Commits
idd-defaul
...
idd-warnin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4882a3fbd6 | ||
|
|
3ed08ba56c | ||
|
|
70da98c1a1 | ||
|
|
ed1602fc74 |
@@ -111,9 +111,9 @@ LRESULT CConfigWindow::onCreate()
|
|||||||
m_heightLabel.reset(new CStaticWidget(L"Height:", WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, m_hwnd));
|
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_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, 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, 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, m_hwnd));
|
m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | ES_LEFT | ES_NUMBER, m_hwnd));
|
||||||
|
|
||||||
m_modeUpdate.reset(new CButton(L"Save", WS_CHILD | WS_VISIBLE, 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));
|
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);
|
LRESULT result = m_settings.setModes(*m_modes);
|
||||||
if (result != ERROR_SUCCESS)
|
if (result != ERROR_SUCCESS)
|
||||||
DEBUG_ERROR_HR(result, "Failed to save modes");
|
DEBUG_ERROR_HR((HRESULT) result, "Failed to save modes");
|
||||||
}
|
}
|
||||||
else if (hwnd == *m_modeDelete && code == BN_CLICKED && m_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);
|
LRESULT result = m_settings.setModes(*m_modes);
|
||||||
if (result != ERROR_SUCCESS)
|
if (result != ERROR_SUCCESS)
|
||||||
DEBUG_ERROR_HR(result, "Failed to save modes");
|
DEBUG_ERROR_HR((HRESULT) result, "Failed to save modes");
|
||||||
|
|
||||||
updateModeList();
|
updateModeList();
|
||||||
onModeListSelectChange();
|
onModeListSelectChange();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ std::wstring CEditWidget::getValue()
|
|||||||
{
|
{
|
||||||
std::wstring result;
|
std::wstring result;
|
||||||
result.resize(Edit_GetTextLength(m_hwnd));
|
result.resize(Edit_GetTextLength(m_hwnd));
|
||||||
Edit_GetText(m_hwnd, result.data(), result.size() + 1);
|
Edit_GetText(m_hwnd, result.data(), (int) (result.size() + 1));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ int CListBox::getSel()
|
|||||||
|
|
||||||
int CListBox::getData(int index)
|
int CListBox::getData(int index)
|
||||||
{
|
{
|
||||||
return ListBox_GetItemData(m_hwnd, index);
|
return (int) ListBox_GetItemData(m_hwnd, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CListBox::setSel(int index)
|
void CListBox::setSel(int index)
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ LRESULT CNotifyWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
case WM_NOTIFY_ICON:
|
case WM_NOTIFY_ICON:
|
||||||
return onNotifyIcon(LOWORD(lParam), HIWORD(lParam), GET_X_LPARAM(wParam), GET_Y_LPARAM(wParam));
|
return onNotifyIcon(LOWORD(lParam), HIWORD(lParam), GET_X_LPARAM(wParam), GET_Y_LPARAM(wParam));
|
||||||
|
|
||||||
case WM_CLEAN_UP_CONFIG:
|
case WM_CLEAN_UP_CONFIG:
|
||||||
if (m_config && !m_config->hwnd())
|
if (m_config && !m_config->hwnd())
|
||||||
{
|
{
|
||||||
@@ -58,6 +59,7 @@ LRESULT CNotifyWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
m_config.reset();
|
m_config.reset();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (s_taskbarCreated && uMsg == s_taskbarCreated)
|
if (s_taskbarCreated && uMsg == s_taskbarCreated)
|
||||||
{
|
{
|
||||||
@@ -70,6 +72,9 @@ LRESULT CNotifyWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
LRESULT CNotifyWindow::onCreate()
|
LRESULT CNotifyWindow::onCreate()
|
||||||
{
|
{
|
||||||
|
// Allow explorer to send us this message to register the notification icon.
|
||||||
|
ChangeWindowMessageFilterEx(m_hwnd, s_taskbarCreated, MSGFLT_ALLOW, NULL);
|
||||||
|
|
||||||
registerIcon();
|
registerIcon();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -129,7 +134,10 @@ void CNotifyWindow::registerIcon()
|
|||||||
StringCbCopy(m_iconData.szTip, sizeof m_iconData.szTip, L"Looking Glass (IDD)");
|
StringCbCopy(m_iconData.szTip, sizeof m_iconData.szTip, L"Looking Glass (IDD)");
|
||||||
|
|
||||||
if (!Shell_NotifyIcon(NIM_ADD, &m_iconData))
|
if (!Shell_NotifyIcon(NIM_ADD, &m_iconData))
|
||||||
|
{
|
||||||
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_ADD)");
|
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_ADD)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Shell_NotifyIcon(NIM_SETVERSION, &m_iconData))
|
if (!Shell_NotifyIcon(NIM_SETVERSION, &m_iconData))
|
||||||
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_SETVERSION)");
|
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_SETVERSION)");
|
||||||
|
|||||||
Reference in New Issue
Block a user