diff options
Diffstat (limited to 'plugins/Weather/src/weather_mwin.cpp')
-rw-r--r-- | plugins/Weather/src/weather_mwin.cpp | 97 |
1 files changed, 47 insertions, 50 deletions
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 0d4ba8317a..6ccbfb19f0 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -325,56 +325,52 @@ void InitMwin(void) if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
return;
- hMwinWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
-
- {
- WNDCLASS wndclass;
- wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
- wndclass.lpfnWndProc = wndProc;
- wndclass.cbClsExtra = 0;
- wndclass.cbWndExtra = 0;
- wndclass.hInstance = hInst;
- wndclass.hIcon = NULL;
- wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
- wndclass.hbrBackground = 0; //(HBRUSH)(COLOR_3DFACE+1);
- wndclass.lpszMenuName = NULL;
- wndclass.lpszClassName = _T("WeatherFrame");
- RegisterClass(&wndclass);
- }
-
- {
- ColourIDT colourid = {0};
- colourid.cbSize = sizeof(ColourIDT);
- strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME);
- strcpy(colourid.setting, "ColorMwinFrame");
- _tcscpy(colourid.name, LPGENT("Frame Background"));
- _tcscpy(colourid.group, _T(WEATHERPROTONAME));
- colourid.defcolour = GetSysColor(COLOR_3DFACE);
- ColourRegisterT(&colourid);
-
- FontIDT fontid = {0};
- fontid.cbSize = sizeof(FontIDT);
- fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
- strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME);
- _tcscpy(fontid.group, _T(WEATHERPROTONAME));
- _tcscpy(fontid.name, LPGENT("Frame Font"));
- strcpy(fontid.prefix, "fnt0");
-
- HDC hdc = GetDC(NULL);
- fontid.deffontsettings.size = -13;
- ReleaseDC(0, hdc);
-
- fontid.deffontsettings.charset = DEFAULT_CHARSET;
- _tcscpy(fontid.deffontsettings.szFace, _T("Verdana"));
- _tcscpy(fontid.backgroundGroup, _T(WEATHERPROTONAME));
- _tcscpy(fontid.backgroundName, LPGENT("Frame Background"));
- FontRegisterT(&fontid);
-
- fontid.deffontsettings.style = DBFONTF_BOLD;
- _tcscpy(fontid.name, LPGENT("Frame Title Font"));
- strcpy(fontid.prefix, "fnt1");
- FontRegisterT(&fontid);
- }
+ hMwinWindowList = WindowList_Create();
+
+ WNDCLASS wndclass;
+ wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
+ wndclass.lpfnWndProc = wndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = hInst;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
+ wndclass.hbrBackground = 0; //(HBRUSH)(COLOR_3DFACE+1);
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = _T("WeatherFrame");
+ RegisterClass(&wndclass);
+
+ ColourIDT colourid = {0};
+ colourid.cbSize = sizeof(ColourIDT);
+ strcpy(colourid.dbSettingsGroup, WEATHERPROTONAME);
+ strcpy(colourid.setting, "ColorMwinFrame");
+ _tcscpy(colourid.name, LPGENT("Frame Background"));
+ _tcscpy(colourid.group, _T(WEATHERPROTONAME));
+ colourid.defcolour = GetSysColor(COLOR_3DFACE);
+ ColourRegisterT(&colourid);
+
+ FontIDT fontid = {0};
+ fontid.cbSize = sizeof(FontIDT);
+ fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
+ strcpy(fontid.dbSettingsGroup, WEATHERPROTONAME);
+ _tcscpy(fontid.group, _T(WEATHERPROTONAME));
+ _tcscpy(fontid.name, LPGENT("Frame Font"));
+ strcpy(fontid.prefix, "fnt0");
+
+ HDC hdc = GetDC(NULL);
+ fontid.deffontsettings.size = -13;
+ ReleaseDC(0, hdc);
+
+ fontid.deffontsettings.charset = DEFAULT_CHARSET;
+ _tcscpy(fontid.deffontsettings.szFace, _T("Verdana"));
+ _tcscpy(fontid.backgroundGroup, _T(WEATHERPROTONAME));
+ _tcscpy(fontid.backgroundName, LPGENT("Frame Background"));
+ FontRegisterT(&fontid);
+
+ fontid.deffontsettings.style = DBFONTF_BOLD;
+ _tcscpy(fontid.name, LPGENT("Frame Title Font"));
+ strcpy(fontid.prefix, "fnt1");
+ FontRegisterT(&fontid);
for (HANDLE hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0))
@@ -391,5 +387,6 @@ void DestroyMwin(void) CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0);
}
UnregisterClass( _T("WeatherFrame"), hInst);
+ WindowList_Destroy(hMwinWindowList);
UnhookEvent(hFontHook);
}
|