diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2012-03-11 13:56:16 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2012-03-11 13:56:16 +0000 |
commit | 30a53274d012fbef8f8129e87ed441d28ade8630 (patch) | |
tree | 508effe55663fbc533b8b9beb4595d31e74372d6 /tipper/popwin.cpp | |
parent | 3209a5fc38088077300a7048a8ad3679ca3d41b8 (diff) |
Fixes for unicode
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@599 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'tipper/popwin.cpp')
-rw-r--r-- | tipper/popwin.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/tipper/popwin.cpp b/tipper/popwin.cpp index 79f6f17..1aac665 100644 --- a/tipper/popwin.cpp +++ b/tipper/popwin.cpp @@ -84,14 +84,13 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
WORD status = CallProtoService(pwd->clcit.proto, PS_GETSTATUS, 0, 0);
- char *strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)status, (LPARAM)0);
- if(strptr) {
- TCHAR *swzText = a2t(strptr);
-
+ TCHAR *strptr = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, status, GSMDF_TCHAR);
+ if (strptr)
+ {
pwd->rows = (RowData *) realloc(pwd->rows, sizeof(RowData) * (pwd->row_count + 1));
pwd->rows[pwd->row_count].swzLabel = _tcsdup(TranslateT("Status:"));
- pwd->rows[pwd->row_count].swzValue = swzText;
+ pwd->rows[pwd->row_count].swzValue = strptr;
pwd->rows[pwd->row_count].value_newline = false;
pwd->rows[pwd->row_count].line_above = false;
pwd->row_count++;
@@ -255,15 +254,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa else _tcscpy(pwd->swzTitle, TranslateT("(Unknown)"));
//get avatar if possible
- char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)pwd->hContact, 0);
- if(proto) {
- char svc[256];
- mir_snprintf(svc, 256, "%s%s", proto, PS_GETAVATARINFO);
- PROTO_AVATAR_INFORMATION AI = {0};
- AI.cbSize = sizeof(AI);
- AI.hContact = pwd->hContact;
- CallService(svc, 0, (LPARAM)&AI);
- }
+ PROTO_AVATAR_INFORMATION AI = { sizeof(AI), pwd->hContact };
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)pwd->hContact, 0);
+ CallProtoService(szProto, PS_GETAVATARINFO, GAIF_FORCE, (LPARAM)&AI);
SendMessage(hwnd, PUM_REFRESH_VALUES, 0, 0);
}
}
@@ -316,9 +309,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa GetClientRect(hwnd, &r);
// bg
- if(options.bg_fn[0]) {
+ if (options.bg_fn[0])
+ {
BITMAP bm;
- HBITMAP hBg = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)options.bg_fn, (LPARAM)IMGL_WCHAR);
+ HBITMAP hBg = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)options.bg_fn, IMGL_TCHAR);
if(hBg) {
HDC hdcMem = CreateCompatibleDC(hdc);
HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, hBg);
|