summaryrefslogtreecommitdiff
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
parent1dad958015778d3486838bf3c93fff1793aa5406 (diff)
pre-XP headers cleaned
git-svn-id: http://svn.miranda-ng.org/main/trunk@6183 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--bin10/lib/mir_core.libbin53074 -> 53506 bytes
-rw-r--r--bin10/lib/mir_core64.libbin48536 -> 48940 bytes
-rw-r--r--bin10/mir_full.sln18
-rw-r--r--bin11/lib/mir_core.libbin53074 -> 53506 bytes
-rw-r--r--bin11/lib/mir_core64.libbin48536 -> 48940 bytes
-rw-r--r--include/m_core.h5
-rw-r--r--include/win2k.h23
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp12
-rw-r--r--plugins/Clist_mw/src/clui.cpp4
-rw-r--r--plugins/FavContacts/src/csocket.cpp3
-rwxr-xr-xplugins/New_GPG/src/messages.cpp2
-rw-r--r--plugins/New_GPG/src/metacontacts.cpp10
-rw-r--r--plugins/Ping/src/pingthread.cpp3
-rw-r--r--plugins/TabSRMM/src/container.cpp7
-rw-r--r--plugins/TabSRMM/src/mim.cpp2
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp8
-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
27 files changed, 83 insertions, 126 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib
index 136b554178..ead24d2190 100644
--- a/bin10/lib/mir_core.lib
+++ b/bin10/lib/mir_core.lib
Binary files differ
diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib
index 47736f92e4..2c7ced7bc6 100644
--- a/bin10/lib/mir_core64.lib
+++ b/bin10/lib/mir_core64.lib
Binary files differ
diff --git a/bin10/mir_full.sln b/bin10/mir_full.sln
index 8ca614eee2..2bd4be391d 100644
--- a/bin10/mir_full.sln
+++ b/bin10/mir_full.sln
@@ -353,7 +353,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicHistory", "..\plugins\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BASS_interface", "..\plugins\BASS_interface\Bass_interface_10.vcxproj", "{3933E789-D185-41DC-8169-9FF4365B6015}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_blind", "..\plugins\Clist_blind\Clist_blind_10.vcxproj", "{A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_blind", "..\plugins\Clist_blind\Clist_blind_10.vcxproj", "{2E15C462-A150-4A37-ACD6-FBAECF1724F5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartPosition", "..\plugins\StartPosition\StartPosition_10.vcxproj", "{046C5F80-ABE5-488F-BFC8-B024D4AACC8C}"
EndProject
@@ -1616,14 +1616,14 @@ Global
{3933E789-D185-41DC-8169-9FF4365B6015}.Release|Win32.Build.0 = Release|Win32
{3933E789-D185-41DC-8169-9FF4365B6015}.Release|x64.ActiveCfg = Release|x64
{3933E789-D185-41DC-8169-9FF4365B6015}.Release|x64.Build.0 = Release|x64
- {A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}.Debug|Win32.ActiveCfg = Debug|Win32
- {A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}.Debug|Win32.Build.0 = Debug|Win32
- {A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}.Debug|x64.ActiveCfg = Debug|x64
- {A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}.Debug|x64.Build.0 = Debug|x64
- {A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}.Release|Win32.ActiveCfg = Release|Win32
- {A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}.Release|Win32.Build.0 = Release|Win32
- {A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}.Release|x64.ActiveCfg = Release|x64
- {A6A38A40-56AD-48A0-8FB3-3B4B59FF4C5D}.Release|x64.Build.0 = Release|x64
+ {2E15C462-A150-4A37-ACD6-FBAECF1724F5}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2E15C462-A150-4A37-ACD6-FBAECF1724F5}.Debug|Win32.Build.0 = Debug|Win32
+ {2E15C462-A150-4A37-ACD6-FBAECF1724F5}.Debug|x64.ActiveCfg = Debug|x64
+ {2E15C462-A150-4A37-ACD6-FBAECF1724F5}.Debug|x64.Build.0 = Debug|x64
+ {2E15C462-A150-4A37-ACD6-FBAECF1724F5}.Release|Win32.ActiveCfg = Release|Win32
+ {2E15C462-A150-4A37-ACD6-FBAECF1724F5}.Release|Win32.Build.0 = Release|Win32
+ {2E15C462-A150-4A37-ACD6-FBAECF1724F5}.Release|x64.ActiveCfg = Release|x64
+ {2E15C462-A150-4A37-ACD6-FBAECF1724F5}.Release|x64.Build.0 = Release|x64
{046C5F80-ABE5-488F-BFC8-B024D4AACC8C}.Debug|Win32.ActiveCfg = Debug|Win32
{046C5F80-ABE5-488F-BFC8-B024D4AACC8C}.Debug|Win32.Build.0 = Debug|Win32
{046C5F80-ABE5-488F-BFC8-B024D4AACC8C}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/bin11/lib/mir_core.lib b/bin11/lib/mir_core.lib
index 32e383e0f3..879e20f9c0 100644
--- a/bin11/lib/mir_core.lib
+++ b/bin11/lib/mir_core.lib
Binary files differ
diff --git a/bin11/lib/mir_core64.lib b/bin11/lib/mir_core64.lib
index 96fa1391d9..fa4601ab41 100644
--- a/bin11/lib/mir_core64.lib
+++ b/bin11/lib/mir_core64.lib
Binary files differ
diff --git a/include/m_core.h b/include/m_core.h
index e7f7e4f919..93e97b1ba6 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -899,6 +899,11 @@ MIR_CORE_DLL(void) KillModuleSubclassing(HMODULE hInst);
///////////////////////////////////////////////////////////////////////////////
+MIR_CORE_DLL(BOOL) IsWinVerVistaPlus();
+MIR_CORE_DLL(BOOL) IsWinVer7Plus();
+
+///////////////////////////////////////////////////////////////////////////////
+
MIR_CORE_DLL(void) UnloadCoreModule(void);
#if defined(__cplusplus)
diff --git a/include/win2k.h b/include/win2k.h
index d65f4a86f5..00db8cbb09 100644
--- a/include/win2k.h
+++ b/include/win2k.h
@@ -32,34 +32,13 @@ To make myself clear, you are supposed to use the sdk, this is just a work aroun
All constants are normally declared in winuser.h
-File created by Christian Kästner, and tweaked a bit by Richard Hughes*/
+File created by Christian Kostner, and tweaked a bit by Richard Hughes*/
-//Windows versions in order of feature presence is:
-//95, NT4, 98, ME, 2000, XP
-//This is chronological order of release except for ME/2000. ME is barely an
-//improvement on 98.
-//These macros use the above order, not release order.
#define WinVerMajor() LOBYTE(LOWORD(GetVersion()))
#define WinVerMinor() HIBYTE(LOWORD(GetVersion()))
-#define IsWinVerNT() ((GetVersion()&0x80000000) == 0)
-// IsWinVerNT4Plus() is buggy, Windows 98 is 4.10.1998
-#define IsWinVerNT4Plus() (WinVerMajor()>=5 || WinVerMinor()>0 || IsWinVerNT())
-#define IsWinVer98Plus() (LOWORD(GetVersion()) != 4)
-#define IsWinVerMEPlus() (WinVerMajor()>=5 || WinVerMinor()>10)
-#define IsWinVer2000Plus() (WinVerMajor()>=5 && IsWinVerNT())
-#define IsWinVerXPPlus() (WinVerMajor()>=5 && LOWORD(GetVersion()) != 5)
-#define IsWinVerVistaPlus() (WinVerMajor()>=6)
-#define IsWinVer7Plus() (WinVerMajor()>6 || (WinVerMajor() == 6 && WinVerMinor()>=1))
// put stuff that's not apart of any SDKs but is used nonetheless
-#ifdef _WIN64
-#define MENUITEMINFO_V4_SIZE sizeof(MENUITEMINFO)
-#else
-//mii was extended for NT5/Win98, so need the old length for some stuff
-#define MENUITEMINFO_V4_SIZE (offsetof(MENUITEMINFO, cch)+sizeof((*((MENUITEMINFO*)0)).cch))
-#endif
-
#if _MSC_VER >= 1300
#define NOWIN2K
#endif
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 24b5588c44..8b3084e3aa 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -261,17 +261,15 @@ INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM wParam,LPARAM lParam)
return 0;
}
-
-
HRESULT CLUI::CreateCluiFrames()
{
g_hMenuMain = GetMenu(pcli->hwndContactList);
- MENUITEMINFO mii;
- ZeroMemory(&mii,sizeof(mii));
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
SetMenuItemInfo(g_hMenuMain, 0, TRUE,&mii);
+
mii.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
SetMenuItemInfo(g_hMenuMain,1,TRUE,&mii);
@@ -2059,9 +2057,7 @@ LRESULT CLUI::OnCreate(UINT msg, WPARAM wParam, LPARAM lParam)
DrawMenuBar(m_hWnd);
cliCluiProtocolStatusChanged(0, 0);
- MENUITEMINFO mii;
- ZeroMemory(&mii,sizeof(mii));
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_TYPE|MIIM_DATA;
mii.dwItemData = MENU_MIRANDAMENU;
mii.fType = MFT_OWNERDRAW;
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp
index 97903b621d..5476afd190 100644
--- a/plugins/Clist_mw/src/clui.cpp
+++ b/plugins/Clist_mw/src/clui.cpp
@@ -81,9 +81,7 @@ void RegisterProtoIconsForAllProtoIconLib();
static int CluiModulesLoaded(WPARAM wParam,LPARAM lParam)
{
- MENUITEMINFO mii;
- ZeroMemory(&mii,sizeof(mii));
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
SetMenuItemInfo(hMenuMain,0,TRUE,&mii);
diff --git a/plugins/FavContacts/src/csocket.cpp b/plugins/FavContacts/src/csocket.cpp
index c8a2b40503..b3d53d60f1 100644
--- a/plugins/FavContacts/src/csocket.cpp
+++ b/plugins/FavContacts/src/csocket.cpp
@@ -7,7 +7,8 @@ int CSocket::Recv(char *buf, int count)
int CSocket::Send(char *buf, int count)
{
- if (count < 0) count = strlen(buf);
+ if (count < 0)
+ count = (int)strlen(buf);
return send(m_socket, buf, count, 0);
}
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index add6cd23ae..d8b4467215 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -956,7 +956,7 @@ int HookSendMsg(WPARAM w, LPARAM l)
str_event.insert(0, toUTF8(outopentag));
str_event.append(toUTF8(outclosetag));
dbei->pBlob = (PBYTE)mir_strdup(str_event.c_str());
- dbei->cbBlob = str_event.length() + 1;
+ dbei->cbBlob = (DWORD)str_event.length() + 1;
}
return 0;
diff --git a/plugins/New_GPG/src/metacontacts.cpp b/plugins/New_GPG/src/metacontacts.cpp
index ab3c60bce5..b466cc65f0 100644
--- a/plugins/New_GPG/src/metacontacts.cpp
+++ b/plugins/New_GPG/src/metacontacts.cpp
@@ -29,16 +29,13 @@ bool metaIsProtoMetaContacts(HANDLE hContact)
return false;
}
-
bool metaIsDefaultSubContact(HANDLE hContact)
{
-
if(bMetaContacts)
return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0)==hContact;
return false;
}
-
HANDLE metaGetContact(HANDLE hContact)
{
if(bMetaContacts)
@@ -46,14 +43,14 @@ HANDLE metaGetContact(HANDLE hContact)
return (HANDLE)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0);
return NULL;
}
+
bool metaIsSubcontact(HANDLE hContact)
{
if(bMetaContacts)
- return (HANDLE)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0);
+ return CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0) != 0;
return false;
}
-
HANDLE metaGetMostOnline(HANDLE hContact)
{
@@ -62,6 +59,7 @@ HANDLE metaGetMostOnline(HANDLE hContact)
return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact,0);
return NULL;
}
+
HANDLE metaGetDefault(HANDLE hContact)
{
@@ -71,13 +69,13 @@ HANDLE metaGetDefault(HANDLE hContact)
return NULL;
}
-
DWORD metaGetContactsNum(HANDLE hContact)
{
if(bMetaContacts)
return CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, 0);
return 0;
}
+
HANDLE metaGetSubcontact(HANDLE hContact, int num)
{
if(bMetaContacts)
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp
index badce66eef..242f7266bd 100644
--- a/plugins/Ping/src/pingthread.cpp
+++ b/plugins/Ping/src/pingthread.cpp
@@ -25,9 +25,6 @@ HFONT hFont = 0;
COLORREF bk_col = RGB(255, 255, 255);
////////////////
-#define WinVerMajor() LOBYTE(LOWORD(GetVersion()))
-#define WinVerMinor() HIBYTE(LOWORD(GetVersion()))
-
static HMODULE hUserDll;
BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags);
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index e40271ac87..877b1d3804 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -1646,13 +1646,10 @@ panel_found:
sBarHeight = (UINT)M.GetByte((bSkinned ? "S_sbarheight" : "sbarheight"), 0);
if (LOBYTE(LOWORD(GetVersion())) >= 5) {
- BOOL fTransAllowed = !bSkinned || PluginConfig.m_WinVerMajor >= 6;
- DWORD exold;
+ BOOL fTransAllowed = !bSkinned || PluginConfig.m_WinVerMajor >= 6;
ex = exold = GetWindowLongPtr(hwndDlg, GWL_EXSTYLE);
- ex = (pContainer->dwFlags & CNT_TRANSPARENCY && (!CSkin::m_skinEnabled || fTransAllowed)) ? ex | WS_EX_LAYERED : ex & ~(WS_EX_LAYERED);
- //if (bAero && !pContainer->bSkinned && IsWinVerVistaPlus())
- // ex = ex | (WS_EX_COMPOSITED);//|WS_EX_LAYERED); // | WS_EX_COMPOSITED); // faster/smoother redrawing on Vista+, especially with skins
+ ex = (pContainer->dwFlags & CNT_TRANSPARENCY && (!CSkin::m_skinEnabled || fTransAllowed)) ? ex | WS_EX_LAYERED : ex & ~(WS_EX_LAYERED);
SetWindowLongPtr(hwndDlg, GWL_EXSTYLE, ex);
if (pContainer->dwFlags & CNT_TRANSPARENCY && fTransAllowed) {
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 8738e681e4..18242609b0 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -288,7 +288,7 @@ bool CMimAPI::getAeroState()
m_isAero = (CSkin::m_skinEnabled == false) && GetByte("useAero", 1) && CSkin::m_fAeroSkinsValid && m_DwmActive;
}
- m_isVsThemed = IsThemeActive();
+ m_isVsThemed = IsThemeActive() != 0;
return m_isAero;
}
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp
index 892d812b3a..bc306c1a4b 100644
--- a/plugins/YAMN/src/browser/mailbrowser.cpp
+++ b/plugins/YAMN/src/browser/mailbrowser.cpp
@@ -555,10 +555,10 @@ int AddNewMailsToListView(HWND hListView,HACCOUNT ActualAccount,struct CMailNumb
Extracted=TRUE;
if ((UnicodeHeader.From != NULL) && (UnicodeHeader.FromNick != NULL)) {
- int size = wcslen(UnicodeHeader.From) + wcslen(UnicodeHeader.FromNick) + 4;
- FromStr=new WCHAR[size];
+ size_t size = wcslen(UnicodeHeader.From) + wcslen(UnicodeHeader.FromNick) + 4;
+ FromStr = new WCHAR[size];
mir_sntprintf(FromStr, size, L"%s <%s>", UnicodeHeader.FromNick, UnicodeHeader.From);
- FromStrNew=TRUE;
+ FromStrNew = TRUE;
}
else if (UnicodeHeader.From != NULL)
FromStr=UnicodeHeader.From;
@@ -1476,7 +1476,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
ShowWindow(GetDlgItem(hDlg, IDC_SPLITTER),(MailParam->mail->Flags & YAMN_MSG_BODYRECEIVED)?SW_SHOW:SW_HIDE);
ShowWindow(hEdit,(MailParam->mail->Flags & YAMN_MSG_BODYRECEIVED)?SW_SHOW:SW_HIDE);
WCHAR *title=0;
- int size = (From ? wcslen(From) : 0) + (Subj ? wcslen(Subj) : 0) + 4;
+ size_t size = (From ? wcslen(From) : 0) + (Subj ? wcslen(Subj) : 0) + 4;
title = new WCHAR[size];
if (From&&Subj)
mir_sntprintf(title, size, L"%s (%s)", Subj, From);
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) {