diff options
30 files changed, 109 insertions, 166 deletions
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index 9a4ff8ae2d..cf2e215e72 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -175,24 +175,22 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) TCHAR szFile[MAX_PATH];
GetModuleFileName(g_hInst, szFile, MAX_PATH);
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
- sid.flags = SIDF_ALL_TCHAR;
-
- sid.ptszSection = _T("Auth State");
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.flags = SIDF_PATH_TCHAR;
sid.ptszDefaultFile = szFile;
+ sid.pszSection = "Auth State";
- sid.ptszDescription = _T("Auth");
+ sid.pszDescription = LPGEN("Auth");
sid.pszName = "auth_icon";
sid.iDefaultIndex = -IDI_AUTH;
Skin_AddIcon(&sid);
- sid.ptszDescription = _T("Grant");
+ sid.pszDescription = LPGEN("Grant");
sid.pszName = "grant_icon";
sid.iDefaultIndex = -IDI_GRANT;
Skin_AddIcon(&sid);
- sid.ptszDescription = _T("Auth & Grant");
+ sid.pszDescription = LPGEN("Auth & Grant");
sid.pszName = "authgrant_icon";
sid.iDefaultIndex = -IDI_AUTHGRANT;
Skin_AddIcon(&sid);
diff --git a/plugins/AvatarHistory/src/icolib.cpp b/plugins/AvatarHistory/src/icolib.cpp index 508c683686..28a88494bb 100644 --- a/plugins/AvatarHistory/src/icolib.cpp +++ b/plugins/AvatarHistory/src/icolib.cpp @@ -61,22 +61,17 @@ int IcoLibIconsChanged(WPARAM wParam, LPARAM lParam) void SetupIcoLib()
{
- if (hHooks[4])
- {
- SKINICONDESC sid = {0};
+ if (hHooks[4]) {
TCHAR path[MAX_PATH];
+ GetModuleFileName(hInst, path, sizeof(path));
- GetModuleFileName(hInst, path, sizeof(path));
-
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.ptszSection = LPGENT("Avatar History");
sid.ptszDefaultFile = path;
sid.flags = SIDF_ALL_TCHAR;
- for (unsigned i = 0; i < MAX_REGS(iconList); i++)
- {
- if (!iconList[i].core)
- {
+ for (unsigned i = 0; i < MAX_REGS(iconList); i++) {
+ if (!iconList[i].core) {
sid.ptszDescription = iconList[i].szDescr;
sid.pszName = iconList[i].szName;
sid.iDefaultIndex = -iconList[i].defIconID;
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index 41e666436a..482641463e 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -196,60 +196,58 @@ void InitTaskMenuItems() void InitIcolib()
{
TCHAR stzFile[MAX_PATH];
+ GetModuleFileName(hInst, stzFile, MAX_PATH);
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.cx = sid.cy = 16;
sid.ptszDefaultFile = stzFile;
- sid.ptszSection = LPGENT("History");
- sid.flags = SIDF_ALL_TCHAR;
-
- GetModuleFileName(hInst, stzFile, MAX_PATH);
+ sid.pszSection = LPGEN("History");
+ sid.flags = SIDF_PATH_TCHAR;
iconsNum = 3;
hEventIcons = new HANDLE[iconsNum];
sid.pszName = "BasicHistory_in";
- sid.ptszDescription = LPGENT("Incoming message");
+ sid.pszDescription = LPGEN("Incoming message");
sid.iDefaultIndex = -IDI_INM;
hEventIcons[0] = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_out";
- sid.ptszDescription = LPGENT("Outgoing message");
+ sid.pszDescription = LPGEN("Outgoing message");
sid.iDefaultIndex = -IDI_OUTM;
hEventIcons[1] = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_status";
- sid.ptszDescription = LPGENT("Statuschange");
+ sid.pszDescription = LPGEN("Statuschange");
sid.iDefaultIndex = -IDI_STATUS;
hEventIcons[2] = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_show";
- sid.ptszDescription = LPGENT("Show Contacts");
+ sid.pszDescription = LPGEN("Show Contacts");
sid.iDefaultIndex = -IDI_SHOW;
hPlusIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_hide";
- sid.ptszDescription = LPGENT("Hide Contacts");
+ sid.pszDescription = LPGEN("Hide Contacts");
sid.iDefaultIndex = -IDI_HIDE;
hMinusIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_findnext";
- sid.ptszDescription = LPGENT("Find Next");
+ sid.pszDescription = LPGEN("Find Next");
sid.iDefaultIndex = -IDI_FINDNEXT;
hFindNextIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_findprev";
- sid.ptszDescription = LPGENT("Find Previous");
+ sid.pszDescription = LPGEN("Find Previous");
sid.iDefaultIndex = -IDI_FINDPREV;
hFindPrevIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_plusex";
- sid.ptszDescription = LPGENT("Plus in export");
+ sid.pszDescription = LPGEN("Plus in export");
sid.iDefaultIndex = -IDI_PLUSEX;
hPlusExIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_minusex";
- sid.ptszDescription = LPGENT("Minus in export");
+ sid.pszDescription = LPGEN("Minus in export");
sid.iDefaultIndex = -IDI_MINUSEX;
hMinusExIcon = Skin_AddIcon(&sid);
}
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index af22f743d6..69942d594c 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -679,9 +679,8 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) GetModuleFileName(hInst, szFile, MAX_PATH);
// IcoLib support
- SKINICONDESC sid = {0};
+ SKINICONDESC sid = { sizeof(sid) };
sid.ptszDefaultFile = szFile;
- sid.cbSize = sizeof(sid);
sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = LPGENT("BuddyExpectator");
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index 323e26ea85..69f5266a5b 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -109,21 +109,15 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) LPTSTR ptszCurrLayout;
LPSTR ptszTemp;
- SKINICONDESC sid = {0};
- TCHAR szFile[MAX_PATH];
-
-
//Заполняем конфигурационные строки из базы. Если их там нет - генерируем.
- for (i = 0; i < bLayNum; i++)
- {
+ for (i = 0; i < bLayNum; i++) {
ptszCurrLayout = GenerateLayoutString(hklLayouts[i]);
ptszTemp = GetNameOfLayout(hklLayouts[i]);
iRes = DBGetContactSettingTString(NULL, ModuleName, ptszTemp, &dbv);
if (iRes != 0)
ptszLayStrings[i] = ptszCurrLayout;
else
- if(_tcscmp((dbv.ptszVal), ptszEmptySting) == 0)
- {
+ if(_tcscmp((dbv.ptszVal), ptszEmptySting) == 0) {
ptszLayStrings[i] = ptszCurrLayout;
mir_free(dbv.ptszVal);
}
@@ -156,9 +150,11 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) hChangeTextLayout = CreateServiceFunction(MS_CKL_CHANGETEXTLAYOUT, APIChangeTextLayout);
// IcoLib support
+ TCHAR szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
+
+ SKINICONDESC sid = { sizeof(sid) };
sid.ptszDefaultFile = szFile;
- sid.cbSize = sizeof(sid);
sid.flags = SIDF_PATH_TCHAR;
sid.pszSection = Translate(ModuleName);
@@ -183,9 +179,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) int OnOptionsInitialise(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp = {0};
-
- odp.cbSize = sizeof(odp);
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAIN_OPTION_FORM);
odp.pszTitle = ModuleName;
@@ -203,8 +197,6 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM lParam) return 0;
}
-
-
LRESULT CALLBACK Keyboard_Hook(int code, WPARAM wParam, LPARAM lParam)
{
DWORD lcode;
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 054d69648d..598e781c43 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -83,10 +83,8 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) TCHAR szMyPath[MAX_PATH];
GetModuleFileName(g_hInst, szMyPath, SIZEOF(szMyPath));
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
- sid.cx = 16;
- sid.cy = 16;
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.cx = sid.cy = 16;
sid.ptszDefaultFile = szMyPath;
sid.flags = SIDF_PATH_TCHAR;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 6892cbf104..b9094b3a25 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -949,7 +949,6 @@ HICON CLUI_LoadIconFromExternalFile(char *filename,int i,BOOL UseLibrary,bool re char szPath[MAX_PATH],szMyPath[MAX_PATH], szFullPath[MAX_PATH],*str;
HICON hIcon = NULL;
BOOL has_proto_icon = FALSE;
- SKINICONDESC sid = {0};
if (needFree) *needFree = FALSE;
GetModuleFileNameA(GetModuleHandle(NULL), szPath, MAX_PATH);
GetModuleFileNameA(g_hInst, szMyPath, MAX_PATH);
@@ -977,9 +976,8 @@ HICON CLUI_LoadIconFromExternalFile(char *filename,int i,BOOL UseLibrary,bool re }
else {
if (registerit && IconName != NULL && SectName != NULL) {
- sid.cbSize = sizeof(sid);
- sid.cx = 16;
- sid.cy = 16;
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.cx = sid.cy = 16;
sid.hDefaultIcon = (has_proto_icon || !(UseLibrary&2))?NULL:(HICON)CallService(MS_SKIN_LOADPROTOICON,0,(LPARAM)(-internalidx));
sid.pszSection = SectName;
sid.pszName = IconName;
@@ -1672,11 +1670,10 @@ static BOOL FileExists(TCHAR * tszFilename) HANDLE RegisterIcolibIconHandle(char * szIcoID, char *szSectionName, char * szDescription, TCHAR * tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModuleInst, int iDefaultResource )
{
TCHAR fileFull[MAX_PATH] = {0};
- SKINICONDESC sid = {0};
HANDLE hIcolibItem = NULL;
- sid.cbSize = sizeof(sid);
- sid.cx = 16;
- sid.cy = 16;
+
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.cx = sid.cy = 16;
sid.pszSection = szSectionName;
sid.pszName = szIcoID;
sid.flags |= SIDF_PATH_TCHAR;
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp index 19abd6f0a4..aadd15cdbd 100644 --- a/plugins/Clist_mw/src/clui.cpp +++ b/plugins/Clist_mw/src/clui.cpp @@ -179,7 +179,6 @@ HICON LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,boolean r {
char szPath[MAX_PATH],szMyPath[MAX_PATH], szFullPath[MAX_PATH],*str;
HICON hIcon = NULL;
- SKINICONDESC sid = {0};
memset(szMyPath,0,SIZEOF(szMyPath));
memset(szFullPath,0,SIZEOF(szFullPath));
@@ -199,7 +198,7 @@ HICON LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,boolean r }
else {
if (registerit && IconName != NULL && SectName != NULL) {
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.pszSection = SectName;
sid.pszName = IconName;
sid.pszDescription = Description;
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 3d0da48591..74f0f731c4 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -127,8 +127,7 @@ static int OnTTBLoaded(WPARAM wParam,LPARAM lParam) TCHAR szModuleFileName[MAX_PATH];
GetModuleFileName(hInst, szModuleFileName, SIZEOF(szModuleFileName));
- SKINICONDESC sid = { 0 };
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.pszSection = "Console";
sid.ptszDefaultFile = szModuleFileName;
sid.flags = SIDF_PATH_TCHAR;
diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp index d2902fce20..145d14f036 100644 --- a/plugins/DbEditorPP/src/icons.cpp +++ b/plugins/DbEditorPP/src/icons.cpp @@ -4,9 +4,8 @@ HIMAGELIST himl; void addIcons(TCHAR* szModuleFileName)
{
- SKINICONDESC sid={0};
char name[32];
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.ptszSection = _T(modFullname);
sid.ptszDefaultFile = szModuleFileName;
sid.flags = SIDF_ALL_TCHAR;
diff --git a/plugins/Dbx_mmap_SA/src/dialogs.cpp b/plugins/Dbx_mmap_SA/src/dialogs.cpp index 6a53bcbf4b..a73745051f 100644 --- a/plugins/Dbx_mmap_SA/src/dialogs.cpp +++ b/plugins/Dbx_mmap_SA/src/dialogs.cpp @@ -87,8 +87,7 @@ int InitMenus(WPARAM, LPARAM) TCHAR szFile[MAX_PATH];
GetModuleFileName(g_hInst, szFile, MAX_PATH);
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.ptszDefaultFile = szFile;
sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = LPGENT("Database");
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 3ca4573d00..ce2a211cb3 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -90,12 +90,13 @@ static HANDLE hIconlibItem[ServerList::FTP_COUNT + SIZEOF(iconList)]; static void InitIcolib()
{
- TCHAR stzFile[MAX_PATH];
char szSettingName[100];
char szDesc[100];
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
+ TCHAR stzFile[MAX_PATH];
+ GetModuleFileName(hInst, stzFile, MAX_PATH);
+
+ SKINICONDESC sid = { sizeof(sid) };
sid.cx = sid.cy = 16;
sid.ptszDefaultFile = stzFile;
sid.pszSection = MODULE;
@@ -103,18 +104,14 @@ static void InitIcolib() sid.pszName = szSettingName;
sid.flags = SIDF_PATH_TCHAR;
- GetModuleFileName(hInst, stzFile, MAX_PATH);
-
- for (int i = 0; i < ServerList::FTP_COUNT; i++)
- {
+ for (int i = 0; i < ServerList::FTP_COUNT; i++) {
mir_snprintf(szDesc, sizeof(szDesc), Translate("FTP Server %d"), i + 1);
mir_snprintf(szSettingName, sizeof(szSettingName), "%s_ftp%d", MODULE, i);
sid.iDefaultIndex = -(IDI_FTP0 + i);
hIconlibItem[i] = Skin_AddIcon(&sid);
}
- for (int i = 0; i < SIZEOF(iconList); i++)
- {
+ for (int i = 0; i < SIZEOF(iconList); i++) {
mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", MODULE, iconList[i].szName);
sid.pszDescription = Translate(iconList[i].szDescr);
sid.iDefaultIndex = -(iconList[i].defIconID);
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index 767a870174..b80c961d96 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -323,8 +323,7 @@ extern "C" __declspec(dllexport) int Load(void) TCHAR buf[MAX_PATH];
GetModuleFileName(g_hInst, buf, SIZEOF(buf));
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.ptszSection = _T("Favourites");
sid.ptszDefaultFile = buf;
sid.cx = sid.cy = 16;
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index a9f4cb17d9..9a8cf990b4 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -204,14 +204,12 @@ DWORD CreateSetting(char *name, DWORD defvalue) int OnModulesLoaded(WPARAM wparam,LPARAM lparam)
{
int indx;
- SKINICONDESC sid;
char ModuleName[MAX_PATH];
-
- ZeroMemory(&sid, sizeof(sid));
- sid.cbSize = sizeof(sid);
- sid.pszSection = Translate("fileAsMessage");
GetModuleFileName(hInst, ModuleName, sizeof(ModuleName));
- for(indx = 0; indx < SIZEOF(hIcons); indx++)
+
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.pszSection = "fileAsMessage";
+ for(int indx = 0; indx < SIZEOF(hIcons); indx++)
{
//sid.pszSection = szIconGroup[indx];
sid.pszName = szIconId[indx];
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp index 95bb034f69..0a628b23bd 100644 --- a/plugins/FingerPrintModPlus/src/fingerprint.cpp +++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp @@ -75,8 +75,7 @@ void FASTCALL Prepare(KN_FP_MASK* mask, bool bEnable) if (SectName == NULL)
return;
- SKINICONDESC sid = { 0 };
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = SectName;
sid.pszName = mask->szIconName;
diff --git a/plugins/Gender/src/main.cpp b/plugins/Gender/src/main.cpp index 88f3b6d3a1..391a0d4722 100644 --- a/plugins/Gender/src/main.cpp +++ b/plugins/Gender/src/main.cpp @@ -213,23 +213,22 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) GetModuleFileName(g_hInst, szFile, MAX_PATH);
//IcoLib support
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
- sid.flags = SIDF_ALL_TCHAR;
- sid.ptszSection = LPGENT("Gender");
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.flags = SIDF_PATH_TCHAR;
+ sid.pszSection = LPGEN("Gender");
sid.ptszDefaultFile = szFile;
- sid.ptszDescription = LPGENT("Male");
+ sid.pszDescription = LPGEN("Male");
sid.pszName = "male_icon";
sid.iDefaultIndex = -IDI_MALE;
g_hIconMale = Skin_AddIcon(&sid);
- sid.ptszDescription = LPGENT("Female");
+ sid.pszDescription = LPGEN("Female");
sid.pszName = "female_icon";
sid.iDefaultIndex = -IDI_FEMALE;
g_hIconFemale = Skin_AddIcon(&sid);
- sid.ptszDescription = LPGENT("No info");
+ sid.pszDescription = LPGEN("No info");
sid.pszName = "menu_icon";
sid.iDefaultIndex = -IDI_UNDEF;
g_hIconMenu = Skin_AddIcon(&sid);
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index 743dfbe0e8..ec106a5ce4 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -100,14 +100,11 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) TCHAR szFile[MAX_PATH];
GetModuleFileName(g_hInst, szFile, MAX_PATH);
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
- sid.flags = SIDF_ALL_TCHAR;
-
- sid.ptszSection = _T("Mobile State");
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.flags = SIDF_PATH_TCHAR;
+ sid.pszSection = "Mobile State";
sid.ptszDefaultFile = szFile;
-
- sid.ptszDescription = _T("Mobile State");
+ sid.pszDescription = "Mobile State";
sid.pszName = "mobile_icon";
sid.iDefaultIndex = -IDI_MOBILE;
Skin_AddIcon(&sid);
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 23041dab04..0586311c5b 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -1075,17 +1075,16 @@ struct _tag_iconList }
static const iconList[] =
{
- { "Notification enabled", ICO_NOTIFICATION_OFF, IDI_NOTIFICATION_OFF },
- { "Notification disabled", ICO_NOTIFICATION_ON, IDI_NOTIFICATION_ON }
+ { "Notification enabled", ICO_NOTIFICATION_OFF, IDI_NOTIFICATION_OFF },
+ { "Notification disabled", ICO_NOTIFICATION_ON, IDI_NOTIFICATION_ON }
};
void InitIcolib()
{
char szFile[MAX_PATH];
char szSettingName[100];
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.cx = sid.cy = 16;
sid.pszDefaultFile = szFile;
sid.pszName = szSettingName;
diff --git a/plugins/NoHistory/src/icons.cpp b/plugins/NoHistory/src/icons.cpp index f3f606fb45..f0d0844aa5 100644 --- a/plugins/NoHistory/src/icons.cpp +++ b/plugins/NoHistory/src/icons.cpp @@ -15,13 +15,12 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam) { void InitIcons()
{
- SKINICONDESC sid = { sizeof(sid) };
+ TCHAR path[MAX_PATH];
+ GetModuleFileName(hInst,path,MAX_PATH);
+ SKINICONDESC sid = { sizeof(sid) };
sid.pszSection = MODULE;
sid.flags = SIDF_PATH_TCHAR;
-
- TCHAR path[MAX_PATH];
- GetModuleFileName(hInst,path,MAX_PATH);
sid.ptszDefaultFile = path;
sid.pszDescription = LPGEN("Disable");
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index 38fba5857b..2fb3a4c8ae 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -63,8 +63,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) mir_snprintf(szSettingName, sizeof( szSettingName ), "%s_%s", OPENFOLDER_MODULE_NAME, "open");
// icolib (0.7+)
- SKINICONDESC sid = { 0 };
- sid.cbSize = sizeof( SKINICONDESC );
+ SKINICONDESC sid = { sizeof(sid) };
sid.ptszDefaultFile = szFile;
sid.flags = SIDF_ALL_TCHAR;
sid.cx = sid.cy = 16;
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 6841316644..4a46f46c90 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -43,19 +43,16 @@ PackUpdaterIconList iconList[] = VOID IcoLibInit()
{
- SKINICONDESC sid;
TCHAR destfile[MAX_PATH];
-
GetModuleFileName(hInst, destfile, MAX_PATH);
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.flags = SIDF_ALL_TCHAR;
sid.cx = sid.cy = 16;
sid.ptszDefaultFile = destfile;
sid.ptszSection = MODULE;
- for (int i = 0; i < SIZEOF(iconList); i++)
- {
+ for (int i = 0; i < SIZEOF(iconList); i++) {
sid.pszName = iconList[i].szIconName;
sid.ptszDescription = iconList[i].tszDescr;
sid.iDefaultIndex = -iconList[i].IconID;
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index d74ed92621..aab0d15d68 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -367,16 +367,14 @@ INT_PTR ContactMenuService(WPARAM wParam, LPARAM lParam) void InitIcolib()
{
TCHAR stzFile[MAX_PATH];
+ GetModuleFileName(hInst, stzFile, MAX_PATH);
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.cx = sid.cy = 16;
sid.ptszDefaultFile = stzFile;
sid.ptszSection = LPGENT("Paste It");
sid.flags = SIDF_ALL_TCHAR;
- GetModuleFileName(hInst, stzFile, MAX_PATH);
-
sid.pszName = "PasteIt_main";
sid.ptszDescription = LPGENT("Paste It");
sid.iDefaultIndex = -IDI_MENU;
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index c94730da3b..f5a578c60f 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -45,8 +45,7 @@ void IcoLibInit() TCHAR destfile[MAX_PATH];
GetModuleFileName(hInst, destfile, MAX_PATH);
- SKINICONDESC sid = { 0 };
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.flags = SIDF_PATH_TCHAR;
sid.cx = sid.cy = 16;
sid.ptszDefaultFile = destfile;
diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index 7284a56113..c1c7af1d93 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -71,16 +71,16 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda struct
{
- TCHAR* szDescr;
+ char* szDescr;
char* szName;
int defIconID;
HANDLE hIconLibItem;
}
static iconList[] =
{
- { LPGENT( "Rate high" ), "rate_high", IDI_RATEHI },
- { LPGENT( "Rate medium" ), "rate_medium", IDI_RATEME },
- { LPGENT( "Rate low" ), "rate_low", IDI_RATELO },
+ { LPGEN("Rate high"), "rate_high", IDI_RATEHI },
+ { LPGEN("Rate medium"), "rate_medium", IDI_RATEME },
+ { LPGEN("Rate low"), "rate_low", IDI_RATELO },
};
static void init_icolib (void)
@@ -88,15 +88,14 @@ static void init_icolib (void) TCHAR szFile[MAX_PATH];
GetModuleFileName(g_hInst, szFile, MAX_PATH);
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
- sid.ptszSection = LPGENT("Contact Rate");
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.pszSection = LPGEN("Contact Rate");
sid.ptszDefaultFile = szFile;
sid.flags = SIDF_ALL_TCHAR;
for (int i = 0; i < SIZEOF(iconList); i++ ) {
sid.pszName = iconList[i].szName;
- sid.ptszDescription = iconList[i].szDescr;
+ sid.pszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
iconList[i].hIconLibItem = Skin_AddIcon(&sid);
}
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 86f737298a..ae5c15546b 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -508,8 +508,7 @@ static void iconsInit(void) TCHAR szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, SIZEOF(szFile));
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.flags = SIDF_PATH_UNICODE;
sid.pszSection = Translate(msLastUC_ShowListName);
sid.ptszDefaultFile = szFile;
diff --git a/plugins/SendScreenshotPlus/src/mir_icolib.cpp b/plugins/SendScreenshotPlus/src/mir_icolib.cpp index 59585c9ad3..4255e2e461 100644 --- a/plugins/SendScreenshotPlus/src/mir_icolib.cpp +++ b/plugins/SendScreenshotPlus/src/mir_icolib.cpp @@ -243,10 +243,7 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L if (!szIconID || !szDescription || !szSection)
return NULL;
- SKINICONDESC sid;
-
- ZeroMemory(&sid, sizeof(sid));
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.flags = SIDF_ALL_TCHAR;
sid.pszName = szIconID;
sid.ptszDescription = mir_a2t(szDescription);
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index adfa3e5149..3fd089a5d4 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -289,8 +289,7 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L HANDLE hIconHandle = NULL;
if (szIconID && szDescription && szSection) {
- SKINICONDESC sid = { 0 };
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.flags = SIDF_ALL_TCHAR;
sid.pszName = szIconID;
sid.ptszDescription = mir_a2t(szDescription);
diff --git a/plugins/Weather/src/weather_icons.cpp b/plugins/Weather/src/weather_icons.cpp index 321d758ca2..119d826859 100644 --- a/plugins/Weather/src/weather_icons.cpp +++ b/plugins/Weather/src/weather_icons.cpp @@ -24,24 +24,24 @@ HANDLE hIcoLibIconsChanged = NULL; struct _tag_iconList
{
- TCHAR* szDescr;
+ char* szDescr;
char* szName;
int defIconID;
HANDLE hIconLibItem;
}
static iconList[] =
{
- { LPGENT("Protocol icon"), "main", IDI_ICON },
- { LPGENT("Update Disabled"), "disabled", IDI_DISABLED },
- { LPGENT("View Log"), "log", IDI_LOG },
- { LPGENT("Update with Clear"), "update2", IDI_UPDATE2 },
- { LPGENT("View Brief"), "brief", IDI_S },
- { LPGENT("View Complete"), "read", IDI_READ },
- { LPGENT("Weather Update"), "update", IDI_UPDATE },
- { LPGENT("Weather Map"), "map", IDI_MAP },
- { LPGENT("Popup"), "popup", IDI_POPUP },
- { LPGENT("No Popup"), "nopopup", IDI_NOPOPUP },
- { LPGENT("Edit Settings"), "edit", IDI_EDIT },
+ { LPGEN("Protocol icon"), "main", IDI_ICON },
+ { LPGEN("Update Disabled"), "disabled", IDI_DISABLED },
+ { LPGEN("View Log"), "log", IDI_LOG },
+ { LPGEN("Update with Clear"), "update2", IDI_UPDATE2 },
+ { LPGEN("View Brief"), "brief", IDI_S },
+ { LPGEN("View Complete"), "read", IDI_READ },
+ { LPGEN("Weather Update"), "update", IDI_UPDATE },
+ { LPGEN("Weather Map"), "map", IDI_MAP },
+ { LPGEN("Popup"), "popup", IDI_POPUP },
+ { LPGEN("No Popup"), "nopopup", IDI_NOPOPUP },
+ { LPGEN("Edit Settings"), "edit", IDI_EDIT },
};
void InitIcons(void)
@@ -50,17 +50,16 @@ void InitIcons(void) TCHAR szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.ptszDefaultFile = szFile;
sid.pszName = szSettingName;
- sid.ptszSection = _T(WEATHERPROTONAME);
- sid.flags = SIDF_ALL_TCHAR;
+ sid.pszSection = WEATHERPROTONAME;
+ sid.flags = SIDF_PATH_TCHAR;
for (int i = 0; i < SIZEOF(iconList); i++) {
mir_snprintf(szSettingName, SIZEOF( szSettingName ), "%s_%s", WEATHERPROTONAME, iconList[i].szName);
- sid.ptszDescription = iconList[i].szDescr;
+ sid.pszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
iconList[i].hIconLibItem = Skin_AddIcon(&sid);
} }
diff --git a/protocols/IcqOscarJ/src/iconlib.cpp b/protocols/IcqOscarJ/src/iconlib.cpp index 1f08c42646..baf4793114 100644 --- a/protocols/IcqOscarJ/src/iconlib.cpp +++ b/protocols/IcqOscarJ/src/iconlib.cpp @@ -32,8 +32,7 @@ IcqIconHandle IconLibDefine(const char *desc, const char *section, const char *module, const char *ident, const TCHAR *def_file, int def_idx)
{
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
sid.pwszSection = make_unicode_string(section);
sid.pwszDescription = make_unicode_string(desc);
sid.flags = SIDF_ALL_TCHAR;
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index 02b7d141f1..141dab3e58 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -257,19 +257,18 @@ HICON LoadSkinProtoIcon(const char* szProto, int status, bool big) PROTOACCOUNT* pa = Proto_GetAccount(szProto);
if (pa) {
TCHAR szPath[MAX_PATH], szFullPath[MAX_PATH], *str;
- SKINICONDESC sid = { 0 };
+ GetModuleFileName(hInst, szPath, MAX_PATH);
//
// Queried protocol isn't in list, adding
//
TCHAR tszSection[MAX_PATH];
mir_sntprintf(tszSection, SIZEOF(tszSection), _T("%s%s"), _T(PROTOCOLS_PREFIX), pa->tszAccountName);
- sid.ptszSection = tszSection;
- sid.cbSize = sizeof(sid);
+ SKINICONDESC sid = { sizeof(sid) };
+ sid.ptszSection = tszSection;
sid.flags = SIDF_ALL_TCHAR;
- GetModuleFileName(hInst, szPath, MAX_PATH);
str = _tcsrchr(szPath, '\\');
if (str != NULL)
*str = 0;
@@ -394,10 +393,8 @@ static INT_PTR sttLoadSkinProtoIconBig(WPARAM wParam, LPARAM lParam) int LoadSkinIcons(void)
{
- SKINICONDESC sid;
int i, j = 0;
char iconName[MAX_PATH], moduleName[MAX_PATH];
- TCHAR modulePath[MAX_PATH];
DBVARIANT dbv;
//
@@ -442,9 +439,10 @@ int LoadSkinIcons(void) CreateServiceFunction(MS_SKIN_LOADPROTOICON, sttLoadSkinProtoIcon);
CreateServiceFunction(MS_SKIN_LOADPROTOICONBIG, sttLoadSkinProtoIconBig);
- ZeroMemory(&sid, sizeof(sid));
- sid.cbSize = sizeof(sid);
+ TCHAR modulePath[MAX_PATH];
GetModuleFileName(NULL, modulePath, SIZEOF(modulePath));
+
+ SKINICONDESC sid = { sizeof(sid) };
sid.ptszDefaultFile = modulePath;
sid.flags = SIDF_PATH_TCHAR;
sid.pszName = iconName;
|