From b172c4bbc75cdad0e8ccd22292aa671ba43cac45 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 18 Apr 2018 18:14:33 +0300 Subject: PLUGIN<> to half-automatically calculate the dll's g_hInstance and pass it inside --- plugins/Weather/src/weather_mwin.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/Weather/src/weather_mwin.cpp') diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 6a5151429f..0775bcfff6 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -48,7 +48,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara data->hContact = (DWORD_PTR)((LPCREATESTRUCT)lParam)->lpCreateParams; data->hAvt = CreateWindow(AVATAR_CONTROL_CLASS, TEXT(""), WS_CHILD, - 0, 0, opt.AvatarSize, opt.AvatarSize, hwnd, nullptr, hInst, nullptr); + 0, 0, opt.AvatarSize, opt.AvatarSize, hwnd, nullptr, g_hInstance, nullptr); if (data->hAvt) SendMessage(data->hAvt, AVATAR_SETCONTACT, 0, (LPARAM)data->hContact); break; @@ -238,7 +238,7 @@ static void addWindow(MCONTACT hContact) db_free(&dbv); HWND hWnd = CreateWindow(L"WeatherFrame", L"", WS_CHILD | WS_VISIBLE, - 0, 0, 10, 10, pcli->hwndContactList, nullptr, hInst, (void*)hContact); + 0, 0, 10, 10, pcli->hwndContactList, nullptr, g_hInstance, (void*)hContact); WindowList_Add(hMwinWindowList, hWnd, hContact); CLISTFrame Frame = { 0 }; @@ -308,7 +308,7 @@ void InitMwin(void) wndclass.lpfnWndProc = wndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; - wndclass.hInstance = hInst; + wndclass.hInstance = g_hInstance; wndclass.hIcon = nullptr; wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW); wndclass.hbrBackground = nullptr; //(HBRUSH)(COLOR_3DFACE+1); @@ -362,7 +362,7 @@ void DestroyMwin(void) if (frameId) CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0); } - UnregisterClass(L"WeatherFrame", hInst); + UnregisterClass(L"WeatherFrame", g_hInstance); WindowList_Destroy(hMwinWindowList); UnhookEvent(hFontHook); } -- cgit v1.2.3