mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Minor tweaks and cleanup.
This commit is contained in:
parent
2835739b12
commit
13b3241307
@ -366,7 +366,7 @@ void CDialogAbout::CTabLog::Initialize()
|
||||
|
||||
// Set folder/.ini icons for tree list
|
||||
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32, 2, 10);
|
||||
HMODULE hDLL = LoadLibrary(L"user32.dll");
|
||||
HMODULE hDLL = GetModuleHandle(L"user32");
|
||||
|
||||
HICON hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(103), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
|
||||
ImageList_AddIcon(hImageList, hIcon);
|
||||
@ -380,8 +380,6 @@ void CDialogAbout::CTabLog::Initialize()
|
||||
ImageList_AddIcon(hImageList, hIcon);
|
||||
DeleteObject(hIcon);
|
||||
|
||||
FreeLibrary(hDLL);
|
||||
|
||||
ListView_SetImageList(item, (WPARAM)hImageList, LVSIL_SMALL);
|
||||
|
||||
LVCOLUMN lvc;
|
||||
@ -757,7 +755,7 @@ void CDialogAbout::CTabMeasures::UpdateMeasureList(CMeterWindow* meterWindow)
|
||||
range += buffer;
|
||||
|
||||
ListView_SetItemText(item, index, 1, (WCHAR*)range.c_str());
|
||||
ListView_SetItemText(item, index, 2, (WCHAR*)(*j)->GetStats());
|
||||
ListView_SetItemText(item, index, 2, (WCHAR*)(*j)->GetStringValue(AUTOSCALE_OFF, 1, -1, false));
|
||||
++index;
|
||||
}
|
||||
|
||||
|
@ -369,15 +369,13 @@ void CDialogManage::CTabSkins::Initialize()
|
||||
|
||||
// Load folder/.ini icons from shell32
|
||||
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32, 2, 10);
|
||||
HMODULE hDLL = LoadLibrary(L"shell32.dll");
|
||||
HMODULE hDLL = GetModuleHandle(L"shell32");
|
||||
|
||||
HICON hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(4), IMAGE_ICON, 16, 16, LR_SHARED);
|
||||
ImageList_AddIcon(hImageList, hIcon);
|
||||
hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(151), IMAGE_ICON, 16, 16, LR_SHARED);
|
||||
ImageList_AddIcon(hImageList, hIcon);
|
||||
|
||||
FreeLibrary(hDLL);
|
||||
|
||||
// Apply icons and populate tree
|
||||
item = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW);
|
||||
TreeView_SetImageList(item, hImageList, TVSIL_NORMAL);
|
||||
@ -1394,10 +1392,10 @@ INT_PTR CDialogManage::CTabThemes::OnCommand(WPARAM wParam, LPARAM lParam)
|
||||
if (HIWORD(wParam) == EN_CHANGE)
|
||||
{
|
||||
WCHAR buffer[32];
|
||||
Edit_GetText((HWND)lParam, buffer, 32);
|
||||
int len = Edit_GetText((HWND)lParam, buffer, 32);
|
||||
|
||||
// Disable save button if no text or if name is "Backup"
|
||||
BOOL state = (wcslen(buffer) != 0 && _wcsicmp(buffer, L"Backup") != 0);
|
||||
BOOL state = (len > 0 && _wcsicmp(buffer, L"Backup") != 0);
|
||||
EnableWindow(GetDlgItem(m_Window, IDC_MANAGETHEMES_SAVE_BUTTON), state);
|
||||
}
|
||||
break;
|
||||
|
@ -759,16 +759,6 @@ void CMeasure::RemoveTrailingZero(WCHAR* str, int strLen)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** GetStats
|
||||
**
|
||||
** Returns the stats as string. The stats are shown in the About dialog.
|
||||
*/
|
||||
const WCHAR* CMeasure::GetStats()
|
||||
{
|
||||
return GetStringValue(AUTOSCALE_OFF, 1, -1, false);
|
||||
}
|
||||
|
||||
/*
|
||||
** Create
|
||||
**
|
||||
|
@ -52,8 +52,6 @@ public:
|
||||
virtual void Initialize();
|
||||
virtual bool Update() = 0;
|
||||
|
||||
virtual const WCHAR* GetStats();
|
||||
|
||||
const WCHAR* GetName() { return m_Name.c_str(); }
|
||||
const std::wstring& GetOriginalName() { return m_Name; }
|
||||
const char* GetAsciiName() { return m_AsciiName.c_str(); }
|
||||
|
@ -20,8 +20,6 @@
|
||||
#include "MeasureCalc.h"
|
||||
#include "Rainmeter.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
hqStrMap* CMeasureCalc::c_VarMap = NULL;
|
||||
bool CMeasureCalc::c_RandSeeded = false;
|
||||
|
||||
|
@ -635,9 +635,7 @@ bool CMeter::ReplaceMeasures(const std::vector<std::wstring>& stringValues, std:
|
||||
// Create the actual text (i.e. replace %1, %2, .. with the measure texts)
|
||||
for (size_t i = stringValues.size(); i > 0; --i)
|
||||
{
|
||||
_snwprintf_s(buffer, _TRUNCATE, L"%%%i", (int)i);
|
||||
|
||||
size_t len = wcslen(buffer);
|
||||
size_t len = _snwprintf_s(buffer, _TRUNCATE, L"%%%i", (int)i);
|
||||
size_t start = 0, pos;
|
||||
do
|
||||
{
|
||||
|
@ -1157,8 +1157,6 @@ void CSystem::SetClipboardText(const std::wstring& text)
|
||||
if (hMem)
|
||||
{
|
||||
LPVOID data = GlobalLock(hMem);
|
||||
if (data)
|
||||
{
|
||||
memcpy(data, text.c_str(), len * sizeof(WCHAR));
|
||||
GlobalUnlock(hMem);
|
||||
|
||||
@ -1168,7 +1166,6 @@ void CSystem::SetClipboardText(const std::wstring& text)
|
||||
GlobalFree(hMem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CloseClipboard();
|
||||
}
|
||||
|
@ -410,20 +410,7 @@ void CTrayWindow::ReadConfig(CConfigParser& parser)
|
||||
|
||||
LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static CTrayWindow* tray = NULL;
|
||||
|
||||
if (uMsg == WM_CREATE)
|
||||
{
|
||||
tray=(CTrayWindow*)((LPCREATESTRUCT)lParam)->lpCreateParams;
|
||||
}
|
||||
else if (uMsg == WM_TASKBARCREATED)
|
||||
{
|
||||
if (tray && tray->IsTrayIconEnabled())
|
||||
{
|
||||
tray->RemoveTrayIcon();
|
||||
tray->AddTrayIcon();
|
||||
}
|
||||
}
|
||||
CTrayWindow* tray = Rainmeter->GetTrayWindow();
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
@ -818,6 +805,17 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (uMsg == WM_TASKBARCREATED)
|
||||
{
|
||||
if (tray && tray->IsTrayIconEnabled())
|
||||
{
|
||||
tray->RemoveTrayIcon();
|
||||
tray->AddTrayIcon();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
|
Loading…
Reference in New Issue
Block a user