diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-14 16:22:13 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-14 16:22:13 +0000 |
commit | d5d023f683b23fe26ddea93738cb721d532804f0 (patch) | |
tree | 21e7398686c7a5d1604d58bfb71ca4329c84be66 /plugins/SRMM/msgdialog.c | |
parent | e58823d961a630eb62e60d2ccb443761ba5f1704 (diff) |
another portion of "#ifsef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@411 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SRMM/msgdialog.c')
-rw-r--r-- | plugins/SRMM/msgdialog.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/plugins/SRMM/msgdialog.c b/plugins/SRMM/msgdialog.c index 1a90a861c6..c5fce0f782 100644 --- a/plugins/SRMM/msgdialog.c +++ b/plugins/SRMM/msgdialog.c @@ -57,7 +57,6 @@ static void NotifyLocalWinEvent(HANDLE hContact, HWND hwnd, unsigned int type) { static char *MsgServiceName(HANDLE hContact)
{
-#ifdef _UNICODE
char szServiceName[100];
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (szProto == NULL)
@@ -66,7 +65,6 @@ static char *MsgServiceName(HANDLE hContact) mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%sW", szProto, PSS_MESSAGE);
if (ServiceExists(szServiceName))
return PSS_MESSAGE "W";
-#endif
return PSS_MESSAGE;
}
@@ -124,7 +122,7 @@ HANDLE SendMessageDirect(const TCHAR *szMsg, HANDLE hContact, char *szProto) return NULL;
}
bufSize = (int)strlen(sendBuffer) + 1;
-#ifdef _UNICODE
+
{
size_t bufSizeT = (_tcslen(szMsg) + 1) * sizeof(TCHAR) ;
@@ -132,7 +130,7 @@ HANDLE SendMessageDirect(const TCHAR *szMsg, HANDLE hContact, char *szProto) memcpy((TCHAR*)&sendBuffer[bufSize], szMsg, bufSizeT);
bufSize += (int)bufSizeT;
}
-#endif
+
}
if (hContact == NULL)
@@ -772,11 +770,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (newData->szInitialText)
{
int len;
-#ifdef _UNICODE
+
if(newData->isWchar)
SetDlgItemText(hwndDlg, IDC_MESSAGE, (TCHAR *)newData->szInitialText);
else
-#endif
+
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
PostMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len);
@@ -1133,11 +1131,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP hData = GlobalAlloc(GMEM_MOVEABLE, _tcslen(buf) * sizeof(TCHAR) + 1);
_tcscpy(GlobalLock(hData), buf);
GlobalUnlock(hData);
-#ifdef _UNICODE
SetClipboardData(CF_UNICODETEXT, hData);
-#else
- SetClipboardData(CF_TEXT, hData);
-#endif
CloseClipboard();
}
}
@@ -1298,17 +1292,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
char* blob = ( char* )alloca(1000);
-#if defined( _UNICODE )
int ansiLen = WideCharToMultiByte(CP_ACP, 0, buffer, -1, blob, 1000, 0, 0);
memcpy( blob+ansiLen, buffer, sizeof(TCHAR)*(iLen+1));
dbei.cbBlob = ansiLen + sizeof(TCHAR)*(iLen+1);
-#else
- int wLen = MultiByteToWideChar(CP_ACP, 0, buffer, -1, NULL, 0 );
- memcpy( blob, buffer, iLen+1 );
- MultiByteToWideChar(CP_ACP, 0, buffer, -1, (WCHAR*)&blob[iLen+1], wLen+1 );
- dbei.cbBlob = iLen+1 + sizeof(WCHAR)*wLen;
-#endif
-
dbei.cbSize = sizeof(dbei);
dbei.pBlob = (PBYTE) blob;
dbei.eventType = EVENTTYPE_STATUSCHANGE;
@@ -1936,11 +1922,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP hData = GlobalAlloc(GMEM_MOVEABLE, (_tcslen(tr.lpstrText) + 1) * sizeof(TCHAR));
_tcscpy(GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
-#ifdef _UNICODE
SetClipboardData(CF_UNICODETEXT, hData);
-#else
- SetClipboardData(CF_TEXT, hData);
-#endif
CloseClipboard();
}
break;
|