diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-07-31 05:07:21 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-07-31 05:07:21 +0000 |
commit | 0ff1d601dfadfd19e286c021fd1288e8b8b4b7c2 (patch) | |
tree | aafe89e4f6870ad528f00e081d31432cdfbb8d32 /ping/pingthread.cpp | |
parent | 87a314a0f8b3aa138601963c0e98d339997b9d6e (diff) |
use yapp api for popup classes
use fontservice for fame background colour
add beta changelog url link to svn log
use IPHLPAPI.dll if available, and use only one icmp file handle
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@316 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'ping/pingthread.cpp')
-rw-r--r-- | ping/pingthread.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/ping/pingthread.cpp b/ping/pingthread.cpp index afbaea2..3c6b2c9 100644 --- a/ping/pingthread.cpp +++ b/ping/pingthread.cpp @@ -21,7 +21,9 @@ int frame_id = -1; HBRUSH tbrush = 0;
FontID font_id;
+ColourID bk_col_id;
HFONT hFont = 0;
+COLORREF bk_col = RGB(255, 255, 255);
////////////////
#define WinVerMajor() LOBYTE(LOWORD(GetVersion()))
@@ -393,7 +395,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar tcol = DBGetContactSettingDword(NULL,"CLC","SelTextColour", GetSysColor(COLOR_HIGHLIGHTTEXT));
SetTextColor(dis->hDC, tcol);
} else {
- tcol = options.bg_colour;
+ tcol = bk_col;
SetBkColor(dis->hDC, tcol);
FillRect(dis->hDC, &dis->rcItem, (ttbrush = CreateSolidBrush(tcol)));
@@ -435,14 +437,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar {
if(tbrush) DeleteObject(tbrush);
- return (BOOL)(tbrush = CreateSolidBrush(options.bg_colour));
+ return (BOOL)(tbrush = CreateSolidBrush(bk_col));
}
case WM_ERASEBKGND:
{
RECT r;
GetClientRect(hwnd, &r);
- if(!tbrush) tbrush = CreateSolidBrush(options.bg_colour);
+ if(!tbrush) tbrush = CreateSolidBrush(bk_col);
FillRect((HDC)wParam, &r, tbrush);
}
return TRUE;
@@ -877,13 +879,16 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar int ReloadFont(WPARAM wParam, LPARAM lParam) {
- DeleteObject(hFont);
+ if(hFont) DeleteObject(hFont);
LOGFONT log_font;
CallService(MS_FONT_GET, (WPARAM)&font_id, (LPARAM)&log_font);
hFont = CreateFontIndirect(&log_font);
SendMessage(list_hwnd, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE);
+ bk_col = CallService(MS_COLOUR_GET, (WPARAM)&bk_col_id, 0);
+ RefreshWindow(0, 0);
+
return 0;
}
@@ -1027,19 +1032,24 @@ void InitList() { if(ServiceExists(MS_FONT_REGISTER)) {
font_id.cbSize = sizeof(FontID);
- strncpy(font_id.group, "Frames", sizeof(font_id.group));
- strncpy(font_id.name, "Ping", sizeof(font_id.name));
+ strncpy(font_id.group, "Ping", sizeof(font_id.group));
+ strncpy(font_id.name, "List", sizeof(font_id.name));
strncpy(font_id.dbSettingsGroup, "PING", sizeof(font_id.dbSettingsGroup));
strncpy(font_id.prefix, "Font", sizeof(font_id.prefix));
font_id.order = 0;
CallService(MS_FONT_REGISTER, (WPARAM)&font_id, 0);
- LOGFONT log_font;
- CallService(MS_FONT_GET, (WPARAM)&font_id, (LPARAM)&log_font);
- hFont = CreateFontIndirect(&log_font);
- SendMessage(list_hwnd, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE);
-
+
+ bk_col_id.cbSize = sizeof(ColourID);
+ strncpy(bk_col_id.group, "Ping", sizeof(bk_col_id.group));
+ strncpy(bk_col_id.name, "Background", sizeof(bk_col_id.name));
+ strncpy(bk_col_id.dbSettingsGroup, "PING", sizeof(bk_col_id.dbSettingsGroup));
+ strncpy(bk_col_id.setting, "BgColor", sizeof(bk_col_id.setting));
+ CallService(MS_COLOUR_REGISTER, (WPARAM)&bk_col_id, 0);
+
HookEvent(ME_FONT_RELOAD, ReloadFont);
+
+ ReloadFont(0, 0);
}
start_ping_thread();
|