diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-03 13:18:14 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-03 13:18:14 +0000 |
commit | 4b89d658c16f73387acf84a3e1eb899eb4ea0fcb (patch) | |
tree | 98e50f89c10296c5d73be1179d3e1fead7297c33 /plugins/UserInfoEx/src/mir_icolib.cpp | |
parent | 5269daf337ff67b0a804e7c63909a800b335a8db (diff) |
more leaks
git-svn-id: http://svn.miranda-ng.org/main/trunk@5564 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/mir_icolib.cpp')
-rw-r--r-- | plugins/UserInfoEx/src/mir_icolib.cpp | 243 |
1 files changed, 105 insertions, 138 deletions
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 5ad36cfeba..e483aec7b2 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -35,93 +35,88 @@ HICON ghDefIcon = NULL; static ICODESC icoDesc[] =
{
// common
- { ICO_COMMON_IM, LPGEN("IM Naming"), SECT_COMMON, IDI_MIRANDA, 0 },
- { ICO_COMMON_PASSWORD, LPGEN("Password"), SECT_COMMON, IDI_PASSWORD, 0 },
- { ICO_COMMON_FEMALE, LPGEN("Female"), SECT_COMMON, IDI_FEMALE, 0 },
- { ICO_COMMON_MALE, LPGEN("Male"), SECT_COMMON, IDI_MALE, 0 },
- { ICO_COMMON_BIRTHDAY, LPGEN("Birthday"), SECT_COMMON, IDI_BIRTHDAY, 0 },
- { ICO_COMMON_CLOCK, LPGEN("Timezone"), SECT_COMMON, IDI_CLOCK, 1 },
- { ICO_COMMON_MARITAL, LPGEN("Marital status"), SECT_COMMON, IDI_MARITAL, 0 },
- { ICO_COMMON_ADDRESS, LPGEN("Address"), SECT_COMMON, IDI_TREE_ADDRESS, 0 },
- { ICO_COMMON_ANNIVERSARY,LPGEN("Anniversary"), SECT_COMMON, IDI_ANNIVERSARY, 0 },
-
- //zodiac
- { ICO_ZOD_AQUARIUS, LPGEN("Aquarius"), SECT_COMMON, IDI_ZOD_AQUARIUS, 128 },
- { ICO_ZOD_ARIES, LPGEN("Aries"), SECT_COMMON, IDI_ZOD_ARIES, 128 },
- { ICO_ZOD_CANCER, LPGEN("Cancer"), SECT_COMMON, IDI_ZOD_CANCER, 128 },
- { ICO_ZOD_CAPRICORN, LPGEN("Capricorn"), SECT_COMMON, IDI_ZOD_CAPRICORN, 128 },
- { ICO_ZOD_GEMINI, LPGEN("Gemini"), SECT_COMMON, IDI_ZOD_GEMINI, 128 },
- { ICO_ZOD_LEO, LPGEN("Leo"), SECT_COMMON, IDI_ZOD_LEO, 128 },
- { ICO_ZOD_LIBRA, LPGEN("Libra"), SECT_COMMON, IDI_ZOD_LIBRA, 128 },
- { ICO_ZOD_PISCES, LPGEN("Pisces"), SECT_COMMON, IDI_ZOD_PISCES, 128 },
- { ICO_ZOD_SAGITTARIUS, LPGEN("Sagittarius"), SECT_COMMON, IDI_ZOD_SAGITTARIUS, 128 },
- { ICO_ZOD_SCORPIO, LPGEN("Scorpio"), SECT_COMMON, IDI_ZOD_SCORPIO, 128 },
- { ICO_ZOD_TAURUS, LPGEN("Taurus"), SECT_COMMON, IDI_ZOD_TAURUS, 128 },
- { ICO_ZOD_VIRGO, LPGEN("Virgo"), SECT_COMMON, IDI_ZOD_VIRGO, 128 },
- // later with new icon pack version
- //{ ICO_ZOD_UNKNOWN, LPGEN("Unknown"), SECT_COMMON, IDI_ZOD_UNKNOWN, 128 },
-
- // lists
- { ICO_LST_MODULES, LPGEN("Export: Modules"), SECT_COMMON, IDI_LST_MODULES, 0 },
- { ICO_LST_FOLDER, LPGEN("Export: Folder"), SECT_COMMON, IDI_LST_FOLDER, 0 },
- { ICO_TREE_DEFAULT, LPGEN("Default"), SECT_TREE, IDI_LST_FOLDER, 0 },
-
- // dialogs
- { ICO_DLG_DETAILS, LPGEN("Details Infobar"), SECT_DLG, IDI_DLG_DETAILS, 48 },
- { ICO_DLG_PHONE, LPGEN("Phone Infobar"), SECT_DLG, IDI_DLG_PHONE, 1 },
- { ICO_DLG_EMAIL, LPGEN("E-Mail Infobar"), SECT_DLG, IDI_DLG_EMAIL, 1 },
- { ICO_DLG_EXPORT, LPGEN("Export VCard"), SECT_DLG, IDI_EXPORT, 1 },
- { ICO_DLG_IMPORT, LPGEN("Import VCard"), SECT_DLG, IDI_IMPORT, 1 },
- { ICO_DLG_ANNIVERSARY, LPGEN("Anniversary Infobar"), SECT_DLG, IDI_ANNIVERSARY, 1 },
-
- // button icons
- { ICO_BTN_UPDATE, LPGEN("Update"), SECT_BUTTONS, IDI_BTN_UPDATE, 0 },
- { ICO_BTN_IMPORT, LPGEN("Import"), SECT_BUTTONS, IDI_IMPORT, 0 },
- { ICO_BTN_EXPORT, LPGEN("Export"), SECT_BUTTONS, IDI_EXPORT, 0 },
- { ICO_BTN_OK, LPGEN("OK"), SECT_BUTTONS, IDI_BTN_OK, 0 },
- { ICO_BTN_CANCEL, LPGEN("Cancel"), SECT_BUTTONS, IDI_BTN_CLOSE, 0 },
- { ICO_BTN_APPLY, LPGEN("Apply"), SECT_BUTTONS, IDI_BTN_APPLY, 0 },
- { ICO_BTN_GOTO, LPGEN("Goto"), SECT_BUTTONS, IDI_BTN_GOTO, 0 },
- { ICO_BTN_PHONE, LPGEN("Phone"), SECT_BUTTONS, IDI_BTN_PHONE, 0 },
- { ICO_BTN_FAX, LPGEN("Fax"), SECT_BUTTONS, IDI_BTN_FAX, 0 },
- { ICO_BTN_CELLULAR, LPGEN("Cellular"), SECT_BUTTONS, IDI_BTN_CELLULAR, 0 },
- { ICO_BTN_CUSTOMPHONE, LPGEN("Custom Phone"), SECT_BUTTONS, IDI_BTN_CUSTOMPHONE, 0 },
- { ICO_BTN_EMAIL, LPGEN("e-mail"), SECT_BUTTONS, IDI_BTN_EMAIL, 0 },
- { ICO_BTN_DOWNARROW, LPGEN("Down arrow"), SECT_BUTTONS, IDI_BTN_DOWNARROW, 0 },
- { ICO_BTN_ADD, LPGEN("Add"), SECT_BUTTONS, IDI_BTN_ADD, 0 },
- { ICO_BTN_EDIT, LPGEN("Edit"), SECT_BUTTONS, IDI_BTN_EDIT, 0 },
- { ICO_BTN_DELETE, LPGEN("Delete"), SECT_BUTTONS, IDI_BTN_DELETE, 0 },
- { ICO_BTN_SEARCH, LPGEN("Search"), SECT_BUTTONS, IDI_SEARCH, 0 },
- { ICO_BTN_EXIMPORT, LPGEN("Ex-/Import"), SECT_BUTTONS, IDI_BTN_EXIMPORT, 0 },
- { ICO_BTN_BDAY_BACKUP, LPGEN("Backup Birthday"), SECT_BUTTONS, IDI_BTN_BIRTHDAY_BACKUP,0 },
- //{ ICO_BTN_YES, LPGEN("Yes"), SECT_BUTTONS, IDI_BTN_YES, 0 },
- //{ ICO_BTN_NO, LPGEN("No"), SECT_BUTTONS, IDI_BTN_NO, 0 },
- //{ ICO_BTN_IGNORE, LPGEN("Ignore"), SECT_BUTTONS, IDI_BTN_IGNORE, 0 },
-
- //birthday and anniversary
- { ICO_RMD_DTB0, LPGEN("Birthday today"), SECT_REMIND, IDI_RMD_DTB0, 0 },
- { ICO_RMD_DTB1, LPGEN("Birthday tomorrow"), SECT_REMIND, IDI_RMD_DTB1, 0 },
- { ICO_RMD_DTB2, LPGEN("Birthday in 2 days"), SECT_REMIND, IDI_RMD_DTB2, 0 },
- { ICO_RMD_DTB3, LPGEN("Birthday in 3 days"), SECT_REMIND, IDI_RMD_DTB3, 0 },
- { ICO_RMD_DTB4, LPGEN("Birthday in 4 days"), SECT_REMIND, IDI_RMD_DTB4, 0 },
- { ICO_RMD_DTB5, LPGEN("Birthday in 5 days"), SECT_REMIND, IDI_RMD_DTB5, 0 },
- { ICO_RMD_DTB6, LPGEN("Birthday in 6 days"), SECT_REMIND, IDI_RMD_DTB6, 0 },
- { ICO_RMD_DTB7, LPGEN("Birthday in 7 days"), SECT_REMIND, IDI_RMD_DTB7, 0 },
- { ICO_RMD_DTB8, LPGEN("Birthday in 8 days"), SECT_REMIND, IDI_RMD_DTB8, 0 },
- { ICO_RMD_DTB9, LPGEN("Birthday in 9 days"), SECT_REMIND, IDI_RMD_DTB9, 0 },
- { ICO_RMD_DTBX, LPGEN("Birthday later"), SECT_REMIND, IDI_RMD_DTBX, 0 },
-
- { ICO_RMD_DTA0, LPGEN("Anniversary today"), SECT_REMIND, IDI_RMD_DTA0, 0 },
- { ICO_RMD_DTA1, LPGEN("Anniversary tomorrow"), SECT_REMIND, IDI_RMD_DTA1, 0 },
- { ICO_RMD_DTA2, LPGEN("Anniversary in 2 days"), SECT_REMIND, IDI_RMD_DTA2, 0 },
- { ICO_RMD_DTA3, LPGEN("Anniversary in 3 days"), SECT_REMIND, IDI_RMD_DTA3, 0 },
- { ICO_RMD_DTA4, LPGEN("Anniversary in 4 days"), SECT_REMIND, IDI_RMD_DTA4, 0 },
- { ICO_RMD_DTA5, LPGEN("Anniversary in 5 days"), SECT_REMIND, IDI_RMD_DTA5, 0 },
- { ICO_RMD_DTA6, LPGEN("Anniversary in 6 days"), SECT_REMIND, IDI_RMD_DTA6, 0 },
- { ICO_RMD_DTA7, LPGEN("Anniversary in 7 days"), SECT_REMIND, IDI_RMD_DTA7, 0 },
- { ICO_RMD_DTA8, LPGEN("Anniversary in 8 days"), SECT_REMIND, IDI_RMD_DTA8, 0 },
- { ICO_RMD_DTA9, LPGEN("Anniversary in 9 days"), SECT_REMIND, IDI_RMD_DTA9, 0 },
- { ICO_RMD_DTAX, LPGEN("Anniversary later"), SECT_REMIND, IDI_RMD_DTAX, 0 },
+ { ICO_COMMON_IM, LPGEN("IM Naming"), SECT_COMMON, IDI_MIRANDA, 0 },
+ { ICO_COMMON_PASSWORD, LPGEN("Password"), SECT_COMMON, IDI_PASSWORD, 0 },
+ { ICO_COMMON_FEMALE, LPGEN("Female"), SECT_COMMON, IDI_FEMALE, 0 },
+ { ICO_COMMON_MALE, LPGEN("Male"), SECT_COMMON, IDI_MALE, 0 },
+ { ICO_COMMON_BIRTHDAY, LPGEN("Birthday"), SECT_COMMON, IDI_BIRTHDAY, 0 },
+ { ICO_COMMON_CLOCK, LPGEN("Timezone"), SECT_COMMON, IDI_CLOCK, 1 },
+ { ICO_COMMON_MARITAL, LPGEN("Marital status"), SECT_COMMON, IDI_MARITAL, 0 },
+ { ICO_COMMON_ADDRESS, LPGEN("Address"), SECT_COMMON, IDI_TREE_ADDRESS, 0 },
+ { ICO_COMMON_ANNIVERSARY,LPGEN("Anniversary"), SECT_COMMON, IDI_ANNIVERSARY, 0 },
+
+ //zodiac
+ { ICO_ZOD_AQUARIUS, LPGEN("Aquarius"), SECT_COMMON, IDI_ZOD_AQUARIUS, 128 },
+ { ICO_ZOD_ARIES, LPGEN("Aries"), SECT_COMMON, IDI_ZOD_ARIES, 128 },
+ { ICO_ZOD_CANCER, LPGEN("Cancer"), SECT_COMMON, IDI_ZOD_CANCER, 128 },
+ { ICO_ZOD_CAPRICORN, LPGEN("Capricorn"), SECT_COMMON, IDI_ZOD_CAPRICORN, 128 },
+ { ICO_ZOD_GEMINI, LPGEN("Gemini"), SECT_COMMON, IDI_ZOD_GEMINI, 128 },
+ { ICO_ZOD_LEO, LPGEN("Leo"), SECT_COMMON, IDI_ZOD_LEO, 128 },
+ { ICO_ZOD_LIBRA, LPGEN("Libra"), SECT_COMMON, IDI_ZOD_LIBRA, 128 },
+ { ICO_ZOD_PISCES, LPGEN("Pisces"), SECT_COMMON, IDI_ZOD_PISCES, 128 },
+ { ICO_ZOD_SAGITTARIUS, LPGEN("Sagittarius"), SECT_COMMON, IDI_ZOD_SAGITTARIUS, 128 },
+ { ICO_ZOD_SCORPIO, LPGEN("Scorpio"), SECT_COMMON, IDI_ZOD_SCORPIO, 128 },
+ { ICO_ZOD_TAURUS, LPGEN("Taurus"), SECT_COMMON, IDI_ZOD_TAURUS, 128 },
+ { ICO_ZOD_VIRGO, LPGEN("Virgo"), SECT_COMMON, IDI_ZOD_VIRGO, 128 },
+
+ // lists
+ { ICO_LST_MODULES, LPGEN("Export: Modules"), SECT_COMMON, IDI_LST_MODULES, 0 },
+ { ICO_LST_FOLDER, LPGEN("Export: Folder"), SECT_COMMON, IDI_LST_FOLDER, 0 },
+ { ICO_TREE_DEFAULT, LPGEN("Default"), SECT_TREE, IDI_LST_FOLDER, 0 },
+
+ // dialogs
+ { ICO_DLG_DETAILS, LPGEN("Details Infobar"), SECT_DLG, IDI_DLG_DETAILS, 48 },
+ { ICO_DLG_PHONE, LPGEN("Phone Infobar"), SECT_DLG, IDI_DLG_PHONE, 1 },
+ { ICO_DLG_EMAIL, LPGEN("E-Mail Infobar"), SECT_DLG, IDI_DLG_EMAIL, 1 },
+ { ICO_DLG_EXPORT, LPGEN("Export VCard"), SECT_DLG, IDI_EXPORT, 1 },
+ { ICO_DLG_IMPORT, LPGEN("Import VCard"), SECT_DLG, IDI_IMPORT, 1 },
+ { ICO_DLG_ANNIVERSARY, LPGEN("Anniversary Infobar"), SECT_DLG, IDI_ANNIVERSARY, 1 },
+
+ // button icons
+ { ICO_BTN_UPDATE, LPGEN("Update"), SECT_BUTTONS, IDI_BTN_UPDATE, 0 },
+ { ICO_BTN_IMPORT, LPGEN("Import"), SECT_BUTTONS, IDI_IMPORT, 0 },
+ { ICO_BTN_EXPORT, LPGEN("Export"), SECT_BUTTONS, IDI_EXPORT, 0 },
+ { ICO_BTN_OK, LPGEN("OK"), SECT_BUTTONS, IDI_BTN_OK, 0 },
+ { ICO_BTN_CANCEL, LPGEN("Cancel"), SECT_BUTTONS, IDI_BTN_CLOSE, 0 },
+ { ICO_BTN_APPLY, LPGEN("Apply"), SECT_BUTTONS, IDI_BTN_APPLY, 0 },
+ { ICO_BTN_GOTO, LPGEN("Goto"), SECT_BUTTONS, IDI_BTN_GOTO, 0 },
+ { ICO_BTN_PHONE, LPGEN("Phone"), SECT_BUTTONS, IDI_BTN_PHONE, 0 },
+ { ICO_BTN_FAX, LPGEN("Fax"), SECT_BUTTONS, IDI_BTN_FAX, 0 },
+ { ICO_BTN_CELLULAR, LPGEN("Cellular"), SECT_BUTTONS, IDI_BTN_CELLULAR, 0 },
+ { ICO_BTN_CUSTOMPHONE, LPGEN("Custom Phone"), SECT_BUTTONS, IDI_BTN_CUSTOMPHONE, 0 },
+ { ICO_BTN_EMAIL, LPGEN("e-mail"), SECT_BUTTONS, IDI_BTN_EMAIL, 0 },
+ { ICO_BTN_DOWNARROW, LPGEN("Down arrow"), SECT_BUTTONS, IDI_BTN_DOWNARROW, 0 },
+ { ICO_BTN_ADD, LPGEN("Add"), SECT_BUTTONS, IDI_BTN_ADD, 0 },
+ { ICO_BTN_EDIT, LPGEN("Edit"), SECT_BUTTONS, IDI_BTN_EDIT, 0 },
+ { ICO_BTN_DELETE, LPGEN("Delete"), SECT_BUTTONS, IDI_BTN_DELETE, 0 },
+ { ICO_BTN_SEARCH, LPGEN("Search"), SECT_BUTTONS, IDI_SEARCH, 0 },
+ { ICO_BTN_EXIMPORT, LPGEN("Ex-/Import"), SECT_BUTTONS, IDI_BTN_EXIMPORT, 0 },
+ { ICO_BTN_BDAY_BACKUP, LPGEN("Backup Birthday"), SECT_BUTTONS, IDI_BTN_BIRTHDAY_BACKUP, 0 },
+
+ //birthday and anniversary
+ { ICO_RMD_DTB0, LPGEN("Birthday today"), SECT_REMIND, IDI_RMD_DTB0, 0 },
+ { ICO_RMD_DTB1, LPGEN("Birthday tomorrow"), SECT_REMIND, IDI_RMD_DTB1, 0 },
+ { ICO_RMD_DTB2, LPGEN("Birthday in 2 days"), SECT_REMIND, IDI_RMD_DTB2, 0 },
+ { ICO_RMD_DTB3, LPGEN("Birthday in 3 days"), SECT_REMIND, IDI_RMD_DTB3, 0 },
+ { ICO_RMD_DTB4, LPGEN("Birthday in 4 days"), SECT_REMIND, IDI_RMD_DTB4, 0 },
+ { ICO_RMD_DTB5, LPGEN("Birthday in 5 days"), SECT_REMIND, IDI_RMD_DTB5, 0 },
+ { ICO_RMD_DTB6, LPGEN("Birthday in 6 days"), SECT_REMIND, IDI_RMD_DTB6, 0 },
+ { ICO_RMD_DTB7, LPGEN("Birthday in 7 days"), SECT_REMIND, IDI_RMD_DTB7, 0 },
+ { ICO_RMD_DTB8, LPGEN("Birthday in 8 days"), SECT_REMIND, IDI_RMD_DTB8, 0 },
+ { ICO_RMD_DTB9, LPGEN("Birthday in 9 days"), SECT_REMIND, IDI_RMD_DTB9, 0 },
+ { ICO_RMD_DTBX, LPGEN("Birthday later"), SECT_REMIND, IDI_RMD_DTBX, 0 },
+
+ { ICO_RMD_DTA0, LPGEN("Anniversary today"), SECT_REMIND, IDI_RMD_DTA0, 0 },
+ { ICO_RMD_DTA1, LPGEN("Anniversary tomorrow"), SECT_REMIND, IDI_RMD_DTA1, 0 },
+ { ICO_RMD_DTA2, LPGEN("Anniversary in 2 days"), SECT_REMIND, IDI_RMD_DTA2, 0 },
+ { ICO_RMD_DTA3, LPGEN("Anniversary in 3 days"), SECT_REMIND, IDI_RMD_DTA3, 0 },
+ { ICO_RMD_DTA4, LPGEN("Anniversary in 4 days"), SECT_REMIND, IDI_RMD_DTA4, 0 },
+ { ICO_RMD_DTA5, LPGEN("Anniversary in 5 days"), SECT_REMIND, IDI_RMD_DTA5, 0 },
+ { ICO_RMD_DTA6, LPGEN("Anniversary in 6 days"), SECT_REMIND, IDI_RMD_DTA6, 0 },
+ { ICO_RMD_DTA7, LPGEN("Anniversary in 7 days"), SECT_REMIND, IDI_RMD_DTA7, 0 },
+ { ICO_RMD_DTA8, LPGEN("Anniversary in 8 days"), SECT_REMIND, IDI_RMD_DTA8, 0 },
+ { ICO_RMD_DTA9, LPGEN("Anniversary in 9 days"), SECT_REMIND, IDI_RMD_DTA9, 0 },
+ { ICO_RMD_DTAX, LPGEN("Anniversary later"), SECT_REMIND, IDI_RMD_DTAX, 0 },
};
/**
@@ -160,16 +155,13 @@ LPTSTR IcoLib_GetDefaultIconFileName() **/
static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack)
{
- if (db_get_b(NULL, MODNAME, SET_ICONS_CHECKFILEVERSION, TRUE))
- {
- if (szIconPack)
- {
+ if (db_get_b(NULL, MODNAME, SET_ICONS_CHECKFILEVERSION, TRUE)) {
+ if (szIconPack) {
TCHAR szAbsolutePath[MAX_PATH];
PathToAbsoluteT(szIconPack, szAbsolutePath);
HMODULE hIconDll = LoadLibrary(szAbsolutePath);
- if (hIconDll)
- {
+ if (hIconDll) {
CHAR szFileVersion[64];
if (!LoadStringA(hIconDll, IDS_ICOPACKVERSION, szFileVersion, sizeof(szFileVersion)) ||
@@ -180,10 +172,7 @@ static void IcoLib_CheckIconPackVersion(LPTSTR szIconPack) FreeLibrary(hIconDll);
}
}
- else
- {
- MsgErr(NULL, LPGENT("Warning: No IconPack found in one of the following directories: 'customize\\icons', 'icons' or 'plugins'!"));
- }
+ else MsgErr(NULL, LPGENT("Warning: No IconPack found in one of the following directories: 'customize\\icons', 'icons' or 'plugins'!"));
}
}
@@ -200,18 +189,6 @@ HICON IcoLib_GetIcon(LPCSTR pszIcon) }
/**
- * Returns a icon, identified by a name
- *
- * @param hIconItem - this is the pointer to an IconItem structure in icolib.
- *
- * @return: HICON if the icon is loaded, NULL otherwise
- **/
-HICON IcoLib_GetIconByHandle(HANDLE hIconItem)
-{
- return Skin_GetIconByHandle(hIconItem);
-}
-
-/**
* Set the icon of each control in the list
*
* @param hDlg - handle to the dialog control, that owns the controls
@@ -222,33 +199,20 @@ HICON IcoLib_GetIconByHandle(HANDLE hIconItem) **/
void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL* pCtrl, BYTE numCtrls)
{
- HICON hIcon;
- BYTE i;
- HWND hCtrl;
-
- for (i = 0; i < numCtrls; i++)
- {
- hIcon = IcoLib_GetIcon(pCtrl[i].pszIcon);
- if (pCtrl[i].idCtrl)
- {
- hCtrl = GetDlgItem(hDlg, pCtrl[i].idCtrl);
- switch (pCtrl[i].Message)
- {
- case STM_SETICON:
- case STM_SETIMAGE:
- {
- ShowWindow(hCtrl, hIcon ? SW_SHOW : SW_HIDE);
- }
- case BM_SETIMAGE:
- {
- SendMessage(hCtrl, pCtrl[i].Message, IMAGE_ICON, (LPARAM) hIcon);
- }
+ for (int i = 0; i < numCtrls; i++) {
+ HICON hIcon = IcoLib_GetIcon(pCtrl[i].pszIcon);
+ if (pCtrl[i].idCtrl) {
+ HWND hCtrl = GetDlgItem(hDlg, pCtrl[i].idCtrl);
+ switch (pCtrl[i].Message) {
+ case STM_SETICON:
+ case STM_SETIMAGE:
+ ShowWindow(hCtrl, hIcon ? SW_SHOW : SW_HIDE);
+
+ case BM_SETIMAGE:
+ SendMessage(hCtrl, pCtrl[i].Message, IMAGE_ICON, (LPARAM) hIcon);
}
}
- else
- {
- SendMessage(hDlg, pCtrl[i].Message, ICON_BIG, (LPARAM) hIcon);
- }
+ else SendMessage(hDlg, pCtrl[i].Message, ICON_BIG, (LPARAM) hIcon);
}
}
@@ -353,7 +317,7 @@ HANDLE IcoLib_RegisterIconHandle(LPSTR szIconID, LPSTR szDescription, LPSTR szSe **/
HICON IcoLib_RegisterIcon(LPSTR szIconID, LPSTR szDescription, LPSTR szSection, int idIcon, int Size)
{
- return IcoLib_GetIconByHandle(IcoLib_RegisterIconHandle(szIconID, szDescription, szSection, idIcon, Size));
+ return Skin_GetIconByHandle(IcoLib_RegisterIconHandle(szIconID, szDescription, szSection, idIcon, Size));
}
/**
@@ -363,8 +327,13 @@ HICON IcoLib_RegisterIcon(LPSTR szIconID, LPSTR szDescription, LPSTR szSection, *
* @return nothing
**/
+
+static IconItem main = { LPGEN("Main"), ICO_COMMON_MAIN, IDI_MAIN };
+
void IcoLib_LoadModule()
{
+ Icon_Register(ghInst, SECT_COMMON, &main, 1);
+
LPTSTR szDefaultFile = IcoLib_GetDefaultIconFileName();
IcoLib_CheckIconPackVersion(szDefaultFile);
@@ -372,10 +341,8 @@ void IcoLib_LoadModule() ghDefIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_DEFAULT), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
- for (int i = 0; i < SIZEOF(icoDesc); i++) {
+ for (int i = 0; i < SIZEOF(icoDesc); i++)
IcoLib_RegisterIconHandleEx(
icoDesc[i].pszName, icoDesc[i].pszDesc, icoDesc[i].pszSection,
szDefaultFile, icoDesc[i].idResource, icoDesc[i].size, ghDefIcon);
- }
}
-
|