summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-22 15:07:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-22 15:07:00 +0000
commit83e9c1e2acab87c30807ede38f022e71a697f9e5 (patch)
tree228c81fd196751b7c614063dec81ee1ec4807fc6 /src
parent1dad958015778d3486838bf3c93fff1793aa5406 (diff)
pre-XP headers cleaned
git-svn-id: http://svn.miranda-ng.org/main/trunk@6183 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/langpack.cpp9
-rw-r--r--src/mir_core/mir_core_10.vcxproj1
-rw-r--r--src/mir_core/mir_core_10.vcxproj.filters3
-rw-r--r--src/mir_core/mir_core_11.vcxproj1
-rw-r--r--src/mir_core/mir_core_11.vcxproj.filters3
-rw-r--r--src/mir_core/miranda.cpp5
-rw-r--r--src/modules/clist/clistmenus.cpp35
-rw-r--r--src/modules/clist/clisttray.cpp3
-rw-r--r--src/modules/clist/clui.cpp7
-rw-r--r--src/modules/clist/genmenu.cpp41
-rw-r--r--src/modules/clist/groups.cpp4
11 files changed, 49 insertions, 63 deletions
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp
index c3644f8a28..9c14f3cba6 100644
--- a/src/mir_core/langpack.cpp
+++ b/src/mir_core/langpack.cpp
@@ -455,8 +455,7 @@ MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int hLangpack)
{
MUUID *uuid = Langpack_LookupUuid(hLangpack);
- MENUITEMINFO mii;
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
for (int i = GetMenuItemCount(hMenu)-1; i >= 0; i--) {
TCHAR str[256];
mii.fMask = MIIM_TYPE|MIIM_SUBMENU;
@@ -470,9 +469,11 @@ MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int hLangpack)
mii.dwTypeData = result;
mii.fMask = MIIM_TYPE;
SetMenuItemInfo(hMenu, i, TRUE, &mii);
- } }
+ }
+ }
- if (mii.hSubMenu != NULL) TranslateMenu_LP(mii.hSubMenu, hLangpack);
+ if (mii.hSubMenu != NULL)
+ TranslateMenu_LP(mii.hSubMenu, hLangpack);
}
}
diff --git a/src/mir_core/mir_core_10.vcxproj b/src/mir_core/mir_core_10.vcxproj
index cc805973b3..e253fd9a91 100644
--- a/src/mir_core/mir_core_10.vcxproj
+++ b/src/mir_core/mir_core_10.vcxproj
@@ -117,6 +117,7 @@
<ClCompile Include="threads.cpp" />
<ClCompile Include="utf.cpp" />
<ClCompile Include="utils.cpp" />
+ <ClCompile Include="winver.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>mir_core</ProjectName>
diff --git a/src/mir_core/mir_core_10.vcxproj.filters b/src/mir_core/mir_core_10.vcxproj.filters
index b4fe537533..6d507a6724 100644
--- a/src/mir_core/mir_core_10.vcxproj.filters
+++ b/src/mir_core/mir_core_10.vcxproj.filters
@@ -103,6 +103,9 @@
<ClCompile Include="mstring.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="winver.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="commonheaders.h">
diff --git a/src/mir_core/mir_core_11.vcxproj b/src/mir_core/mir_core_11.vcxproj
index 42572f7442..b92519ea8a 100644
--- a/src/mir_core/mir_core_11.vcxproj
+++ b/src/mir_core/mir_core_11.vcxproj
@@ -112,6 +112,7 @@
<ClCompile Include="threads.cpp" />
<ClCompile Include="utf.cpp" />
<ClCompile Include="utils.cpp" />
+ <ClCompile Include="winver.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>mir_core</ProjectName>
diff --git a/src/mir_core/mir_core_11.vcxproj.filters b/src/mir_core/mir_core_11.vcxproj.filters
index 0b660b44ed..e0db98f859 100644
--- a/src/mir_core/mir_core_11.vcxproj.filters
+++ b/src/mir_core/mir_core_11.vcxproj.filters
@@ -100,6 +100,9 @@
<ClCompile Include="mstring.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="winver.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="commonheaders.h">
diff --git a/src/mir_core/miranda.cpp b/src/mir_core/miranda.cpp
index 103801995b..9ee5ed2b1a 100644
--- a/src/mir_core/miranda.cpp
+++ b/src/mir_core/miranda.cpp
@@ -33,6 +33,8 @@ void CheckLogs();
void InitLogs();
void UninitLogs();
+void InitWinver();
+
int hLangpack = 0;
HINSTANCE hInst = 0;
@@ -67,7 +69,7 @@ static void LoadCoreModule(void)
icce.dwICC = ICC_WIN95_CLASSES | ICC_USEREX_CLASSES;
InitCommonControlsEx(&icce);
- hAPCWindow=CreateWindowEx(0, _T("ComboLBox"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
+ hAPCWindow = CreateWindowEx(0, _T("ComboLBox"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
SetClassLongPtr(hAPCWindow, GCL_STYLE, GetClassLongPtr(hAPCWindow, GCL_STYLE) | CS_DROPSHADOW);
DestroyWindow(hAPCWindow);
hAPCWindow = NULL;
@@ -85,6 +87,7 @@ static void LoadCoreModule(void)
#endif
RecalculateTime = (void (*)()) GetProcAddress(mirInst, "RecalculateTime");
+ InitWinver();
InitPathUtils();
InitLogs();
InitialiseModularEngine();
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 3540aee387..1ae87be532 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -406,8 +406,7 @@ BOOL FindMenuHandleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itd
if ( !itdat)
return FALSE;
- MENUITEMINFO mii = {0};
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for (int i = GetMenuItemCount(hMenu)-1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
@@ -480,24 +479,16 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
TCHAR d[100];
GetMenuString(it.OwnerMenu, it.position, d, SIZEOF(d), MF_BYPOSITION);
- if ( !IsWinVer98Plus()) {
- mi.cbSize = MENUITEMINFO_V4_SIZE;
- mi.fMask = MIIM_TYPE | MIIM_STATE;
- mi.fType = MFT_STRING;
- }
- else {
- mi.cbSize = sizeof(mi);
- mi.fMask = MIIM_STRING | MIIM_STATE;
- if (timi->iconId != -1) {
- mi.fMask |= MIIM_BITMAP;
- if (IsWinVerVistaPlus() && IsThemeActive()) {
- if (timi->hBmp == NULL)
- timi->hBmp = ConvertIconToBitmap(NULL, timi->parent->m_hMenuIcons, timi->iconId);
- mi.hbmpItem = timi->hBmp;
- }
- else
- mi.hbmpItem = HBMMENU_CALLBACK;
+ mi.cbSize = sizeof(mi);
+ mi.fMask = MIIM_STRING | MIIM_STATE;
+ if (timi->iconId != -1) {
+ mi.fMask |= MIIM_BITMAP;
+ if (IsWinVerVistaPlus() && IsThemeActive()) {
+ if (timi->hBmp == NULL)
+ timi->hBmp = ConvertIconToBitmap(NULL, timi->parent->m_hMenuIcons, timi->iconId);
+ mi.hbmpItem = timi->hBmp;
}
+ else mi.hbmpItem = HBMMENU_CALLBACK;
}
mi.fState |= (check && !reset ? MFS_CHECKED : MFS_UNCHECKED);
@@ -710,8 +701,7 @@ BOOL FindMenuHanleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itda
BOOL inSub = FALSE;
- MENUITEMINFO mii = {0};
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for (int i = GetMenuItemCount(hMenu)-1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
@@ -1395,8 +1385,7 @@ void InitCustomMenus(void)
cli.currentStatusMenuItem = ID_STATUS_OFFLINE;
cli.currentDesiredStatusMode = ID_STATUS_OFFLINE;
- if (IsWinVer98Plus())
- HookEvent(ME_SKIN_ICONSCHANGED, MenuIconsChanged);
+ HookEvent(ME_SKIN_ICONSCHANGED, MenuIconsChanged);
}
void UninitCustomMenus(void)
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp
index 9d337f33ab..518580d531 100644
--- a/src/modules/clist/clisttray.cpp
+++ b/src/modules/clist/clisttray.cpp
@@ -737,8 +737,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
HMENU hMenu = GetSubMenu(hMainMenu, 0);
TranslateMenu(hMenu);
- MENUITEMINFO mi = { 0 };
- mi.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mi = { sizeof(mi) };
mi.fMask = MIIM_SUBMENU | MIIM_TYPE;
mi.fType = MFT_STRING;
mi.hSubMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp
index af5b739943..cb277cbeed 100644
--- a/src/modules/clist/clui.cpp
+++ b/src/modules/clist/clui.cpp
@@ -58,8 +58,7 @@ void fnLoadCluiGlobalOpts()
static int CluiModulesLoaded(WPARAM, LPARAM)
{
if (cli.hMenuMain) {
- MENUITEMINFO mii = { 0 };
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
SetMenuItemInfo(cli.hMenuMain, 0, TRUE, &mii);
@@ -449,7 +448,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
switch (msg) {
case WM_NCCREATE:
{
- MENUITEMINFO mii = { MENUITEMINFO_V4_SIZE };
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_TYPE | MIIM_DATA;
mii.dwItemData = MENU_MIRANDAMENU;
mii.fType = MFT_OWNERDRAW;
@@ -931,7 +930,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
POINT pt;
GetCursorPos(&pt);
if ((pos == 0 || pos == 1) && (HIWORD(wParam) & MF_POPUP) && ( !(HIWORD(wParam) & MF_MOUSESELECT) || MenuItemFromPoint(hwnd, cli.hMenuMain, pt) != -1)) {
- MENUITEMINFO mii = { MENUITEMINFO_V4_SIZE };
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (HMENU)CallService((pos == 0) ? MS_CLIST_MENUGETMAIN : MS_CLIST_MENUGETSTATUS, 0, 0);
SetMenuItemInfo(cli.hMenuMain, pos, TRUE, &mii);
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index 333624777a..b6d3af6cec 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -740,8 +740,7 @@ PMO_IntMenuItem MO_AddOldNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi)
static int WhereToPlace(HMENU hMenu, PMO_MenuItem mi)
{
- MENUITEMINFO mii = { 0 };
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for (int i = GetMenuItemCount(hMenu)-1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
@@ -760,8 +759,7 @@ static int WhereToPlace(HMENU hMenu, PMO_MenuItem mi)
static DWORD GetMenuItemType(HMENU hMenu, int uItem)
{
- MENUITEMINFO mii = { 0 };
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_TYPE;
GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
return mii.fType;
@@ -769,8 +767,7 @@ static DWORD GetMenuItemType(HMENU hMenu, int uItem)
static UINT GetMenuItemTypeData(HMENU hMenu, int uItem, PMO_IntMenuItem& p)
{
- MENUITEMINFO mii = { 0 };
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA | MIIM_TYPE;
GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
p = MO_GetIntMenuItem((HGENMENU)mii.dwItemData);
@@ -779,8 +776,7 @@ static UINT GetMenuItemTypeData(HMENU hMenu, int uItem, PMO_IntMenuItem& p)
static void InsertSeparator(HMENU hMenu, int uItem)
{
- MENUITEMINFO mii;
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_TYPE;
mii.fType = MFT_SEPARATOR;
InsertMenuItem(hMenu, uItem, TRUE, &mii);
@@ -944,28 +940,19 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para
if (rootlevel != (int)pmi->mi.root)
continue;
- MENUITEMINFO mii = { 0 };
- mii.dwItemData = (LPARAM)pmi;
-
int i = WhereToPlace(hMenu, mi);
- if ( !IsWinVer98Plus()) {
- mii.cbSize = MENUITEMINFO_V4_SIZE;
- mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID;
- mii.fType = MFT_STRING;
- }
- else {
- mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_DATA | MIIM_ID | MIIM_STRING;
- if (pmi->iconId != -1) {
- mii.fMask |= MIIM_BITMAP;
- if (IsWinVerVistaPlus() && IsThemeActive()) {
- if (pmi->hBmp == NULL)
- pmi->hBmp = ConvertIconToBitmap(NULL, pmi->parent->m_hMenuIcons, pmi->iconId);
- mii.hbmpItem = pmi->hBmp;
- }
- else mii.hbmpItem = HBMMENU_CALLBACK;
+ MENUITEMINFO mii = { sizeof(mii) };
+ mii.dwItemData = (LPARAM)pmi;
+ mii.fMask = MIIM_DATA | MIIM_ID | MIIM_STRING;
+ if (pmi->iconId != -1) {
+ mii.fMask |= MIIM_BITMAP;
+ if (IsWinVerVistaPlus() && IsThemeActive()) {
+ if (pmi->hBmp == NULL)
+ pmi->hBmp = ConvertIconToBitmap(NULL, pmi->parent->m_hMenuIcons, pmi->iconId);
+ mii.hbmpItem = pmi->hBmp;
}
+ else mii.hbmpItem = HBMMENU_CALLBACK;
}
mii.fMask |= MIIM_STATE;
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp
index d01e485dd2..73aba22dab 100644
--- a/src/modules/clist/groups.cpp
+++ b/src/modules/clist/groups.cpp
@@ -470,7 +470,6 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
int nextMenuId = 100;
TCHAR *pBackslash, *pNextField, szThisField[128], szThisMenuItem[128];
int menuId, compareResult, menuItemCount;
- MENUITEMINFO mii = { 0 };
if (db_get_utf(NULL, "CListGroups", "0", &dbv))
return (INT_PTR) (HMENU) NULL;
@@ -483,7 +482,8 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM)
pNextField = dbv.ptszVal + 1;
hThisMenu = hRootMenu;
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+
+ MENUITEMINFO mii = { sizeof(mii) };
do {
pBackslash = _tcschr(pNextField, '\\');
if (pBackslash == NULL) {