MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / Style_GetLexerIconId

Function Style_GetLexerIconId

src/Styles.c:2928–2953  ·  view source on GitHub ↗

============================================================================= Style_GetLexerIconId()

Source from the content-addressed store, hash-verified

2926// Style_GetLexerIconId()
2927//
2928int Style_GetLexerIconId ( PEDITLEXER plex )
2929{
2930 WCHAR *p;
2931 WCHAR *pszExtensions;
2932 WCHAR *pszFile;
2933 SHFILEINFO shfi;
2934 if ( lstrlen ( plex->szExtensions ) ) {
2935 pszExtensions = plex->szExtensions;
2936 } else {
2937 pszExtensions = plex->pszDefExt;
2938 }
2939 pszFile = GlobalAlloc ( GPTR, sizeof ( WCHAR ) * ( lstrlen ( pszExtensions ) + CSTRLEN ( L"*.txt" ) + 16 ) );
2940 lstrcpy ( pszFile, L"*." );
2941 lstrcat ( pszFile, pszExtensions );
2942 if ( p = StrChr ( pszFile, L';' ) ) {
2943 *p = L'\0';
2944 }
2945 // check for ; at beginning
2946 if ( lstrlen ( pszFile ) < 3 ) {
2947 lstrcat ( pszFile, L"txt" );
2948 }
2949 SHGetFileInfo ( pszFile, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof ( SHFILEINFO ),
2950 SHGFI_SMALLICON | SHGFI_SYSICONINDEX | SHGFI_USEFILEATTRIBUTES );
2951 GlobalFree ( pszFile );
2952 return ( shfi.iIcon );
2953}
2954
2955
2956//=============================================================================

Callers 2

Style_AddLexerToTreeViewFunction · 0.85
Style_AddLexerToListViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected