Some minor fixes.

This commit is contained in:
Birunthan Mohanathas 2012-02-16 17:38:45 +00:00
parent bf27206d8c
commit b48791dd58
4 changed files with 13 additions and 13 deletions

View File

@ -43,5 +43,5 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
//_CrtSetBreakAlloc(000);
return RainmeterMain(hInstance, lpCmdLine);
return RainmeterMain(lpCmdLine);
}

View File

@ -490,7 +490,7 @@ void CDialogAbout::CTabLog::AddItem(int level, LPCWSTR time, LPCWSTR message)
break;
case LOG_WARNING:
if (!m_Error) return;
if (!m_Warning) return;
item = GetDlgItem(m_Window, IDC_ABOUTLOG_WARNING_CHECKBOX);
vitem.iImage = 1;
break;

View File

@ -50,7 +50,7 @@ CRainmeter* Rainmeter; // The module
** Initializes Rainmeter.
**
*/
int RainmeterMain(HINSTANCE hInstance, LPWSTR cmdLine)
int RainmeterMain(LPWSTR cmdLine)
{
HWND wnd = NULL;
while (wnd = FindWindowEx(NULL, wnd, RAINMETER_CLASS_NAME, RAINMETER_WINDOW_NAME))
@ -101,7 +101,7 @@ int RainmeterMain(HINSTANCE hInstance, LPWSTR cmdLine)
{
try
{
ret = Rainmeter->Initialize(hInstance, cmdLine);
ret = Rainmeter->Initialize(cmdLine);
}
catch (CError& error)
{
@ -110,7 +110,7 @@ int RainmeterMain(HINSTANCE hInstance, LPWSTR cmdLine)
if (ret == 0)
{
ret = Rainmeter->MessagePump();
ret = Rainmeter->MessagePump();
}
delete Rainmeter;
@ -739,13 +739,15 @@ CRainmeter::~CRainmeter()
** May throw CErrors !!!!
**
*/
int CRainmeter::Initialize(HINSTANCE hInstance, LPCWSTR szPath)
int CRainmeter::Initialize(LPCWSTR szPath)
{
int result = 0;
m_Instance = GetModuleHandle(L"Rainmeter");
WNDCLASS wc = {0};
wc.lpfnWndProc = (WNDPROC)MainWndProc;
wc.hInstance = hInstance;
wc.hInstance = m_Instance;
wc.lpszClassName = RAINMETER_CLASS_NAME;
RegisterClass(&wc);
@ -760,13 +762,11 @@ int CRainmeter::Initialize(HINSTANCE hInstance, LPCWSTR szPath)
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
m_Instance,
NULL);
if (!m_Window) return 1;
m_Instance = hInstance;
WCHAR* tmpSzPath = new WCHAR[MAX_LINE_LENGTH];
GetModuleFileName(m_Instance, tmpSzPath, MAX_LINE_LENGTH);
@ -1007,7 +1007,7 @@ int CRainmeter::Initialize(HINSTANCE hInstance, LPCWSTR szPath)
// Test that the Rainmeter.ini file is writable
TestSettingsFile(bDefaultIniLocation);
CSystem::Initialize(hInstance);
CSystem::Initialize(m_Instance);
CMeasureNet::InitializeNewApi();
if (m_Debug)

View File

@ -120,7 +120,7 @@ public:
CRainmeter();
~CRainmeter();
int Initialize(HINSTANCE hInstance, LPCWSTR szPath);
int Initialize(LPCWSTR szPath);
int MessagePump();
void SetNetworkStatisticsTimer();
@ -332,6 +332,6 @@ private:
#define EXPORT_PLUGIN EXTERN_C __declspec(dllimport)
#endif
EXPORT_PLUGIN int RainmeterMain(HINSTANCE Instance, LPWSTR cmdLine);
EXPORT_PLUGIN int RainmeterMain(LPWSTR cmdLine);
#endif