void IcoLib_LoadModule() { LPTSTR szDefaultFile = _T("Plugins\\")_T(__FILENAME); // load default icon if required ghDefIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_DEFAULT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); 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); }
void IcoLib_LoadModule() { Icon_Register(ghInst, SECT_COMMON, &main, 1); LPTSTR szDefaultFile = IcoLib_GetDefaultIconFileName(); IcoLib_CheckIconPackVersion(szDefaultFile); // load default icon if required ghDefIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_DEFAULT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); for (int i = 0; i < _countof(icoDesc); i++) IcoLib_RegisterIconHandleEx( icoDesc[i].pszName, icoDesc[i].pszDesc, icoDesc[i].pszSection, szDefaultFile, icoDesc[i].idResource, icoDesc[i].size, ghDefIcon); }
/** * This function manually registers a single icon from the default icon library. * * @param szIconID - This is the uniquely identifying string for an icon. * This string is the setting name in the database and should * only use ASCII characters. * @param szDescription - This is the description displayed in the options dialog. * @param szSection - This is the subsection, where the icon is organized in the options dialog. * @param idIcon - This is the ResourceID of the icon in the default file * @param Size - This is the desired size of the icon to load. * 0: default size for small icons (16x16) * 1: default size for normal icons (32x32) * * @return This function returns the HANDLE of the icon item. **/ HANDLE IcoLib_RegisterIconHandle(LPSTR szIconID, LPSTR szDescription, LPSTR szSection, int idIcon, int Size) { return IcoLib_RegisterIconHandleEx(szIconID, szDescription, szSection, IcoLib_GetDefaultIconFileName(), idIcon, Size, ghDefIcon); }