diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 18:41:21 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 18:41:21 +0000 |
commit | 28d2449a2207fa8c3f959c8037afe6e869300101 (patch) | |
tree | 33ff65f8113a99f94fc330d0ebd817db0229dedd /src/modules | |
parent | 96928d1553edc33b05a2dd00d5251fd00e258467 (diff) |
small cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6167 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/clist/clistmod.cpp | 7 | ||||
-rw-r--r-- | src/modules/clist/clisttray.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 11 | ||||
-rw-r--r-- | src/modules/options/options.cpp | 20 | ||||
-rw-r--r-- | src/modules/utils/hyperlink.cpp | 3 | ||||
-rw-r--r-- | src/modules/utils/timezones.cpp | 57 | ||||
-rw-r--r-- | src/modules/utils/utils.cpp | 9 |
7 files changed, 22 insertions, 89 deletions
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 7d5fb02e43..025f3dfff7 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -44,7 +44,6 @@ int InitClistHotKeys(void); HANDLE hContactDoubleClicked, hContactIconChangedEvent;
HIMAGELIST hCListImages;
-BOOL(WINAPI * MySetProcessWorkingSetSize) (HANDLE, SIZE_T, SIZE_T);
extern BYTE nameOrder[];
@@ -414,8 +413,8 @@ int fnShowHide(WPARAM, LPARAM) db_set_b(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
}
- if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
- MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
+ if (db_get_b(NULL, "CList", "DisableWorkingSet", 1))
+ SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
return 0;
}
@@ -511,8 +510,6 @@ int LoadContactListModule2(void) CreateServiceFunction(MS_CLIST_HOTKEYSPROCESSMESSAGE, HotkeysProcessMessageStub);
CreateServiceFunction(MS_CLIST_GETCONTACTICON, GetContactIcon);
- MySetProcessWorkingSetSize = (BOOL(WINAPI *) (HANDLE, SIZE_T, SIZE_T)) GetProcAddress(GetModuleHandleA("kernel32"), "SetProcessWorkingSetSize");
-
InitDisplayNameCache();
InitCListEvents();
InitGroupServices();
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 321ceb54d1..4c26df5b25 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TOOLTIP_TOLERANCE 5
extern HIMAGELIST hCListImages;
-extern BOOL(WINAPI * MySetProcessWorkingSetSize) (HANDLE, SIZE_T, SIZE_T);
int GetAverageMode(int* pNetProtoCount = NULL);
@@ -590,8 +589,7 @@ static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd, UINT, UINT_PTR idEvent, DW HWND hwndClui = cli.hwndContactList;
if (GetActiveWindow() != hwndClui) {
ShowWindow(hwndClui, SW_HIDE);
- if (MySetProcessWorkingSetSize != NULL)
- MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
+ SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
}
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index e03d2daf18..af5b739943 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TM_AUTOALPHA 1
#define MENU_MIRANDAMENU 0xFFFF1234
-extern BOOL(WINAPI * MySetProcessWorkingSetSize) (HANDLE, SIZE_T, SIZE_T);
extern HANDLE hEventExtraClick;
static HMODULE hUserDll;
@@ -546,8 +545,8 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
else db_set_b(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
- if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
- MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
+ if (db_get_b(NULL, "CList", "DisableWorkingSet", 1))
+ SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
// drop thru
case WM_MOVE:
@@ -639,7 +638,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
if (noRecurse)
break;
- if ( !db_get_b(NULL, "CLUI", "FadeInOut", 0) || !IsWinVer2000Plus())
+ if ( !db_get_b(NULL, "CLUI", "FadeInOut", 0))
break;
if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) {
DWORD thisTick, startTick;
@@ -696,8 +695,8 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ShowWindow(hwnd, SW_HIDE);
db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN);
- if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
- MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
+ if (db_get_b(NULL, "CList", "DisableWorkingSet", 1))
+ SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
return 0;
}
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 6f19035d1e..04daab9bb2 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -652,18 +652,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L TCHAR *lastPage = NULL, *lastGroup = NULL, *lastTab = NULL;
DBVARIANT dbv;
- typedef BOOL (STDAPICALLTYPE *pfnGetComboBoxInfo)(HWND, PCOMBOBOXINFO);
- pfnGetComboBoxInfo getComboBoxInfo = (pfnGetComboBoxInfo)GetProcAddress(GetModuleHandleA("user32"), "GetComboBoxInfo");
- if (getComboBoxInfo) {
- COMBOBOXINFO cbi;
- cbi.cbSize = sizeof(COMBOBOXINFO);
- getComboBoxInfo( GetDlgItem(hdlg, IDC_KEYWORD_FILTER), &cbi);
- mir_subclassWindow(cbi.hwndItem, OptionsFilterSubclassProc);
-
- if (IsAeroMode()) {
- mir_subclassWindow(cbi.hwndCombo, AeroPaintSubclassProc);
- mir_subclassWindow(cbi.hwndItem, AeroPaintSubclassProc);
- }
+ COMBOBOXINFO cbi;
+ cbi.cbSize = sizeof(COMBOBOXINFO);
+ GetComboBoxInfo( GetDlgItem(hdlg, IDC_KEYWORD_FILTER), &cbi);
+ mir_subclassWindow(cbi.hwndItem, OptionsFilterSubclassProc);
+
+ if (IsAeroMode()) {
+ mir_subclassWindow(cbi.hwndCombo, AeroPaintSubclassProc);
+ mir_subclassWindow(cbi.hwndItem, AeroPaintSubclassProc);
}
Utils_RestoreWindowPositionNoSize(hdlg, NULL, "Options", "");
diff --git a/src/modules/utils/hyperlink.cpp b/src/modules/utils/hyperlink.cpp index 1fd17b8130..23f7e151cb 100644 --- a/src/modules/utils/hyperlink.cpp +++ b/src/modules/utils/hyperlink.cpp @@ -260,8 +260,7 @@ int InitHyperlink(void) wcl.cbClsExtra = 0;
wcl.cbWndExtra = sizeof(struct HyperlinkWndData*);
wcl.hInstance = hInst;
- if (IsWinVer2000Plus()) wcl.hCursor = NULL;
- else wcl.hCursor = LoadCursor(wcl.hInstance, MAKEINTRESOURCE(IDC_HYPERLINKHAND));
+ wcl.hCursor = NULL;
wcl.lpszClassName = WNDCLASS_HYPERLINK;
wcl.hbrBackground = NULL;
wcl.hIcon = NULL;
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index f5f3c15291..6fb8571823 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -30,18 +30,6 @@ TIME_API tmi; typedef DWORD (WINAPI *pfnGetDynamicTimeZoneInformation_t)(DYNAMIC_TIME_ZONE_INFORMATION *pdtzi);
static pfnGetDynamicTimeZoneInformation_t pfnGetDynamicTimeZoneInformation;
-typedef HRESULT (WINAPI *pfnSHLoadIndirectString_t)(LPCWSTR pszSource, LPWSTR pszOutBuf, UINT cchOutBuf, void **ppvReserved);
-static pfnSHLoadIndirectString_t pfnSHLoadIndirectString;
-
-typedef LANGID (WINAPI *pfnGetUserDefaultUILanguage_t)(void);
-static pfnGetUserDefaultUILanguage_t pfnGetUserDefaultUILanguage;
-
-typedef LANGID (WINAPI *pfnGetSystemDefaultUILanguage_t)(void);
-static pfnGetSystemDefaultUILanguage_t pfnGetSystemDefaultUILanguage;
-
-typedef LPARAM (WINAPI *pfnSendMessageW_t)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
-static pfnSendMessageW_t pfnSendMessageW;
-
typedef struct _REG_TZI_FORMAT
{
LONG Bias;
@@ -74,7 +62,6 @@ typedef struct } TZ_INT_INFO;
static TZ_INT_INFO myInfo;
-bool muiInstalled;
static OBJLIST<MIM_TIMEZONE> g_timezones(55, NumericKeySortT);
static LIST<MIM_TIMEZONE> g_timezonesBias(55, MIM_TIMEZONE::compareBias);
@@ -411,11 +398,7 @@ static int timeapiPrepareList(HANDLE hContact, HWND hWnd, DWORD dwFlags) {
MIM_TIMEZONE *tz = g_timezonesBias[i];
- if (pfnSendMessageW)
- pfnSendMessageW(hWnd, lstMsg->addStr, 0, (LPARAM)tz->szDisplay);
- else
- SendMessage(hWnd, lstMsg->addStr, 0, (LPARAM)StrConvTu(tz->szDisplay));
-
+ SendMessage(hWnd, lstMsg->addStr, 0, (LPARAM)tz->szDisplay);
SendMessage(hWnd, lstMsg->setData, i + 1, (LPARAM)tz);
}
@@ -496,27 +479,9 @@ static INT_PTR TimestampToStringA(WPARAM wParam, LPARAM lParam) void GetLocalizedString(HKEY hSubKey, const TCHAR *szName, wchar_t *szBuf, DWORD cbLen)
{
- szBuf[0] = 0;
- if (muiInstalled)
- {
- TCHAR tszTempBuf[MIM_TZ_NAMELEN], tszName[30];
- mir_sntprintf(tszName, SIZEOF(tszName), _T("MUI_%s"), szName);
- DWORD dwLength = cbLen * sizeof(TCHAR);
- if (ERROR_SUCCESS == RegQueryValueEx(hSubKey, tszName, NULL, NULL, (unsigned char *)tszTempBuf, &dwLength))
- {
- tszTempBuf[min(dwLength / sizeof(TCHAR), cbLen - 1)] = 0;
- if (pfnSHLoadIndirectString)
- pfnSHLoadIndirectString(StrConvU(tszTempBuf), szBuf, cbLen, NULL);
- }
- }
- if (szBuf[0] == 0)
- {
- DWORD dwLength = cbLen * sizeof(wchar_t);
-
-
- RegQueryValueEx(hSubKey, szName, NULL, NULL, (unsigned char *)szBuf, &dwLength);
- szBuf[min(dwLength / sizeof(TCHAR), cbLen - 1)] = 0;
- }
+ DWORD dwLength = cbLen * sizeof(wchar_t);
+ RegQueryValueEx(hSubKey, szName, NULL, NULL, (unsigned char *)szBuf, &dwLength);
+ szBuf[min(dwLength / sizeof(TCHAR), cbLen - 1)] = 0;
}
extern "C" __declspec(dllexport) void RecalculateTime(void)
@@ -558,9 +523,7 @@ void InitTimeZones(void) REG_TZI_FORMAT tzi;
HKEY hKey;
- const TCHAR *tszKey = IsWinVerNT() ?
- _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones") :
- _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Time Zones");
+ const TCHAR *tszKey = _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones");
/*
* use GetDynamicTimeZoneInformation() on Vista+ - this will return a structure with
@@ -570,16 +533,6 @@ void InitTimeZones(void) if (IsWinVerVistaPlus())
pfnGetDynamicTimeZoneInformation = (pfnGetDynamicTimeZoneInformation_t)GetProcAddress(GetModuleHandle(_T("kernel32")), "GetDynamicTimeZoneInformation");
- if (IsWinVer2000Plus())
- {
- pfnSHLoadIndirectString = (pfnSHLoadIndirectString_t)GetProcAddress(GetModuleHandle(_T("shlwapi")), "SHLoadIndirectString");
- pfnGetSystemDefaultUILanguage = (pfnGetSystemDefaultUILanguage_t)GetProcAddress(GetModuleHandle(_T("kernel32")), "GetSystemDefaultUILanguage");
- pfnGetUserDefaultUILanguage = (pfnGetUserDefaultUILanguage_t)GetProcAddress(GetModuleHandle(_T("kernel32")), "GetUserDefaultUILanguage");
- muiInstalled = pfnSHLoadIndirectString && pfnGetSystemDefaultUILanguage() != pfnGetUserDefaultUILanguage();
- }
-
- pfnSendMessageW = (pfnSendMessageW_t)GetProcAddress(GetModuleHandle(_T("user32")), "SendMessageW");
-
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, tszKey, 0, KEY_ENUMERATE_SUB_KEYS, &hKey))
{
DWORD dwIndex = 0;
diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp index ddf2038da0..62322a9ec6 100644 --- a/src/modules/utils/utils.cpp +++ b/src/modules/utils/utils.cpp @@ -448,15 +448,6 @@ static INT_PTR GenerateRandom(WPARAM wParam, LPARAM lParam) pfnRtlGenRandom = NULL;
}
}
- if (pfnRtlGenRandom == NULL)
- {
- srand(GetTickCount());
- unsigned short* buf = (unsigned short*)lParam;
- for (; (long)(wParam-=2) >= 0;)
- *(buf++) = (unsigned short)rand();
- if (lParam < 0)
- *(char*)buf = (char)(rand() & 0xFF);
- }
return 0;
}
|