- Fixed: Multibang [] not assumed when [Measure] is replaced in CConfigParser::ReadString().

- Minor changes of ConvertToXXX(): Get an appropriate buffer size to convert the string. And using [] when deleting arrays.
- Fixed a few memory leaks.
- It's now possible to send the !BANG command when all windows are "On Desktop". (Rainmeter.exe and WebParser)
This commit is contained in:
spx
2009-09-12 11:11:40 +00:00
parent 8ea3c6780a
commit 9d96ec61c1
10 changed files with 155 additions and 82 deletions

View File

@ -58,7 +58,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
hWnd=InitInstance(hInstance, WinClass, WinName);
if(!hWnd) return FALSE;
if (lpCmdLine[0] == '!')
if (lpCmdLine && lpCmdLine[0] == L'!')
{
// It's a !bang
Bang(hWnd, lpCmdLine);
@ -158,8 +158,17 @@ HWND InitInstance(HINSTANCE hInstance, const WCHAR* WinClass, const WCHAR* WinNa
*/
void Bang(HWND hWnd, const WCHAR* command)
{
// Check if Rainlendar is running
// Check if Rainmeter is running
HWND wnd = FindWindow(L"RainmeterMeterWindow", NULL);
if (wnd == NULL)
{
// Check if all windows are "On Desktop"
HWND ProgmanHwnd = FindWindow(L"Progman", L"Program Manager");
if (ProgmanHwnd)
{
wnd = FindWindowEx(ProgmanHwnd, NULL, L"RainmeterMeterWindow", NULL);
}
}
if (wnd != NULL)
{
@ -169,7 +178,7 @@ void Bang(HWND hWnd, const WCHAR* command)
copyData.cbData = (DWORD)((wcslen(command) + 1) * sizeof(WCHAR));
copyData.lpData = (void*)command;
// Send the bang to the Rainlendar window
// Send the bang to the Rainmeter window
SendMessage(wnd, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&copyData);
}
else