mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Added OnWakeAction.
Executes when returning from sleep/hibernation.
This commit is contained in:
parent
d09c18a862
commit
497f6bbf54
@ -2042,6 +2042,7 @@ bool CMeterWindow::ReadSkin()
|
||||
m_OnFocusAction = m_Parser.ReadString(L"Rainmeter", L"OnFocusAction", L"", false);
|
||||
m_OnUnfocusAction = m_Parser.ReadString(L"Rainmeter", L"OnUnfocusAction", L"", false);
|
||||
m_OnUpdateAction = m_Parser.ReadString(L"Rainmeter", L"OnUpdateAction", L"", false);
|
||||
m_OnWakeAction = m_Parser.ReadString(L"Rainmeter", L"OnWakeAction", L"", false);
|
||||
|
||||
m_WindowUpdate = m_Parser.ReadInt(L"Rainmeter", L"Update", INTERVAL_METER);
|
||||
m_TransitionUpdate = m_Parser.ReadInt(L"Rainmeter", L"TransitionUpdate", INTERVAL_TRANSITION);
|
||||
@ -4528,6 +4529,20 @@ LRESULT CMeterWindow::OnMove(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Performs an action when returning from sleep
|
||||
**
|
||||
*/
|
||||
LRESULT CMeterWindow::OnWake(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (wParam == PBT_APMRESUMEAUTOMATIC && !m_OnWakeAction.empty())
|
||||
{
|
||||
Rainmeter->ExecuteCommand(m_OnWakeAction.c_str(), this);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** The main window procedure for the meter window.
|
||||
**
|
||||
@ -4588,6 +4603,7 @@ LRESULT CALLBACK CMeterWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
||||
MESSAGE(OnDisplayChange, WM_DISPLAYCHANGE)
|
||||
MESSAGE(OnSetWindowFocus, WM_SETFOCUS)
|
||||
MESSAGE(OnSetWindowFocus, WM_KILLFOCUS)
|
||||
MESSAGE(OnWake, WM_POWERBROADCAST)
|
||||
END_MESSAGEPROC
|
||||
}
|
||||
|
||||
|
@ -295,6 +295,7 @@ protected:
|
||||
LRESULT OnSettingChange(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT OnDisplayChange(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT OnSetWindowFocus(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT OnWake(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
private:
|
||||
enum STATE
|
||||
@ -385,6 +386,7 @@ private:
|
||||
std::wstring m_OnFocusAction;
|
||||
std::wstring m_OnUnfocusAction;
|
||||
std::wstring m_OnUpdateAction;
|
||||
std::wstring m_OnWakeAction;
|
||||
|
||||
std::wstring m_BackgroundName;
|
||||
RECT m_BackgroundMargins;
|
||||
|
Loading…
Reference in New Issue
Block a user