============================================================================= Style_GetLexerIconId()
| 2926 | // Style_GetLexerIconId() |
| 2927 | // |
| 2928 | int 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 | //============================================================================= |
no outgoing calls
no test coverage detected