From 6db050eb2d23035c71971cc88219211bbacca23d Mon Sep 17 00:00:00 2001 From: sje Date: Thu, 23 Nov 2006 03:22:18 +0000 Subject: use ansi font services if unicode unavailable bigfixes to allow pure ansi build git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@56 4f64403b-2f21-0410-a795-97e2b3489a10 --- tipper/message_pump.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'tipper/message_pump.cpp') diff --git a/tipper/message_pump.cpp b/tipper/message_pump.cpp index d891a33..ae679c0 100644 --- a/tipper/message_pump.cpp +++ b/tipper/message_pump.cpp @@ -2,6 +2,7 @@ #include "message_pump.h" #include "popwin.h" #include "options.h" +#include "str_utils.h" HMODULE hUserDll; BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD) = 0; @@ -122,12 +123,7 @@ int ShowTip(WPARAM wParam, LPARAM lParam) { clcit2->text = 0; if(wParam) { // wParam is char pointer containing text - e.g. status bar tooltip - int size = MultiByteToWideChar(code_page, 0, (char *)wParam, -1, 0, 0); - if(size) { - clcit2->text = (wchar_t *)malloc(size * sizeof(wchar_t)); - MultiByteToWideChar(code_page, 0, (char *)wParam, -1, clcit2->text, size); - GetCursorPos(&clcit2->ptCursor); // cursor pos broken? - } + clcit2->text = a2t((char *)wParam); } PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)clcit2); @@ -164,12 +160,23 @@ int ProtoAck(WPARAM wParam, LPARAM lParam) { ACKDATA *ack = (ACKDATA *)lParam; char *szMsg = (char *)ack->lParam; if(ack->type == ACKTYPE_AWAYMSG && ack->result == ACKRESULT_SUCCESS && szMsg) { + /* int size = MultiByteToWideChar(code_page, 0, szMsg, -1, 0, 0); if(size > 1) { wchar_t *msg = (wchar_t *)malloc(size * sizeof(wchar_t)); MultiByteToWideChar(code_page, 0, (char *) szMsg, -1, msg, size); PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)msg); } + */ + /* + int size = MultiByteToWideChar(CP_UTF8, 0, szMsg, -1, 0, 0); + if(size > 1) { + wchar_t *msg = (wchar_t *)malloc(size * sizeof(wchar_t)); + MultiByteToWideChar(CP_UTF8, 0, (char *) szMsg, -1, msg, size); + PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)msg); + } + */ + PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)u2t(szMsg)); } return 0; } -- cgit v1.2.3