summaryrefslogtreecommitdiff
path: root/plugins/AssocMgr
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AssocMgr')
-rw-r--r--plugins/AssocMgr/assoclist.cpp8
-rw-r--r--plugins/AssocMgr/dde.cpp8
-rw-r--r--plugins/AssocMgr/reg.cpp7
-rw-r--r--plugins/AssocMgr/utils.cpp14
-rw-r--r--plugins/AssocMgr/utils.h7
5 files changed, 16 insertions, 28 deletions
diff --git a/plugins/AssocMgr/assoclist.cpp b/plugins/AssocMgr/assoclist.cpp
index 780924968d..4cedcb519c 100644
--- a/plugins/AssocMgr/assoclist.cpp
+++ b/plugins/AssocMgr/assoclist.cpp
@@ -687,9 +687,9 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
TranslateDialogDefault(hwndDlg);
CoInitialize(NULL);
hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST);
-#if defined(_UNICODE)
+
ListView_SetUnicodeFormat(hwndList, TRUE);
-#endif
+
SendDlgItemMessage(hwndDlg, IDC_HEADERTEXT, WM_SETFONT, SendMessage(GetParent(hwndDlg), PSM_GETBOLDFONT, 0, 0), 0);
/* checkboxes won't show up on Win95 without IE3+ or 4.70 (plugin opts uses the same) */
ListView_SetExtendedListViewStyle(hwndList, LVS_EX_CHECKBOXES|LVS_EX_FULLROWSELECT|LVS_EX_LABELTIP);
@@ -838,11 +838,11 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara
/* enable apply */
PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
-#if defined(_UNICODE)
+
case WM_NOTIFYFORMAT:
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, NFR_UNICODE);
return TRUE;
-#endif
+
case WM_NOTIFY:
{ NMHDR *nmhdr = (NMHDR*)lParam;
switch(nmhdr->idFrom) {
diff --git a/plugins/AssocMgr/dde.cpp b/plugins/AssocMgr/dde.cpp
index dc03e7e0cc..a8328b4d34 100644
--- a/plugins/AssocMgr/dde.cpp
+++ b/plugins/AssocMgr/dde.cpp
@@ -109,10 +109,10 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
DDEACK ack;
ZeroMemory(&ack,sizeof(ack));
if(UnpackDDElParam(msg,lParam,NULL,(PUINT_PTR)&hCommand)) {
- #if defined(_UNICODE)
+
/* ANSI execute command can't happen for shell */
if(IsWindowUnicode((HWND)wParam)) {
- #endif
+
pszCommand = (TCHAR*)GlobalLock(hCommand);
if(pszCommand!=NULL) {
TCHAR *pszAction,*pszArg;
@@ -129,9 +129,9 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
}
GlobalUnlock(hCommand);
}
- #if defined(_UNICODE)
+
}
- #endif
+
lParam=ReuseDDElParam(lParam,msg,WM_DDE_ACK,*(PUINT)&ack,(UINT)hCommand);
if (!PostMessage((HWND)wParam,WM_DDE_ACK,(WPARAM)hwnd,lParam)) {
GlobalFree(hCommand);
diff --git a/plugins/AssocMgr/reg.cpp b/plugins/AssocMgr/reg.cpp
index 089d483c70..92451a52d3 100644
--- a/plugins/AssocMgr/reg.cpp
+++ b/plugins/AssocMgr/reg.cpp
@@ -419,12 +419,9 @@ static void BackupRegTree_Worker(HKEY hKey,const char *pszSubKey,struct BackupRe
ptszName=a2t(pszName);
if(ptszName!=NULL) {
if (!RegQueryValueEx(hKey,ptszName,NULL,&dwType,pData,&cbData)) {
- #ifdef _UNICODE
+
WriteDbBackupData(*param->ppszDbPrefix,dwType,pData,cbData);
- #else
- if (!(dwType&REGF_ANSI)) /* sanity check, never happens */
- WriteDbBackupData(*param->ppszDbPrefix,dwType&REGF_ANSI,pData,cbData);
- #endif
+
}
mir_free(ptszName);
}
diff --git a/plugins/AssocMgr/utils.cpp b/plugins/AssocMgr/utils.cpp
index 663484142a..e6414eeb02 100644
--- a/plugins/AssocMgr/utils.cpp
+++ b/plugins/AssocMgr/utils.cpp
@@ -76,25 +76,19 @@ char* u2a(const WCHAR *pszUnicode,BOOL fMirCp)
// mir_free() the return value
TCHAR* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp)
{
-#if defined(_UNICODE)
+
if(fUnicode) return mir_wstrdup((WCHAR*)pszStr);
return a2u((char*)pszStr,fMirCp);
-#else
- if(fUnicode) return u2a((WCHAR*)pszStr,fMirCp);
- return mir_strdup((char*)pszStr);
-#endif
+
}
// mir_free() the return value
void* t2s(const TCHAR *pszStr,DWORD fUnicode,BOOL fMirCp)
{
-#if defined(_UNICODE)
+
if (!fUnicode) return (void*)u2a(pszStr,fMirCp);
return (void*)mir_wstrdup(pszStr);
-#else
- if(fUnicode) return (void*)a2u(pszStr,fMirCp);
- return (void*)mir_strdup(pszStr);
-#endif
+
}
/************************* Database *******************************/
diff --git a/plugins/AssocMgr/utils.h b/plugins/AssocMgr/utils.h
index 0c2682c4a8..f65a29ebec 100644
--- a/plugins/AssocMgr/utils.h
+++ b/plugins/AssocMgr/utils.h
@@ -26,13 +26,10 @@ WCHAR* a2u(const char *pszAnsi,BOOL fMirCp);
char* u2a(const WCHAR *pszUnicode,BOOL fMirCp);
TCHAR* s2t(const void *pszStr,DWORD fUnicode,BOOL fMirCp);
void* t2s(const TCHAR *pszStr,DWORD fUnicode,BOOL fMirCp);
-#ifdef _UNICODE
+
#define t2a(s) u2a(s,FALSE)
#define a2t(s) a2u(s,FALSE)
-#else
- #define t2a(s) mir_strdup(s)
- #define a2t(s) mir_strdup(s)
-#endif
+
/* Database */
BOOL EnumDbPrefixSettings(const char *pszModule,const char *pszSettingPrefix,char ***pSettings,int *pnSettingsCount);