diff options
author | Carsten Driesner <cd@openoffice.org> | 2010-04-01 09:50:13 +0200 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2010-04-01 09:50:13 +0200 |
commit | f98a6048cbdaa4fe436b9bf5c46be02666d2db88 (patch) | |
tree | f147f505a22d505e22db852b7bc83538725ef131 | |
parent | 18e38ea2f3144717acda76e1a384d621558e7c81 (diff) |
nativea: #161787# More safe code to retrieve open icon from shell library
-rw-r--r-- | sfx2/source/appl/shutdowniconw32.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 292aaac063..be71e2d2ca 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -747,10 +747,19 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis) HICON hIcon( 0 ); if ( pMyItem->module.getLength() > 0 ) - hIcon = (HICON) LoadImageA( GetModuleHandleW( reinterpret_cast<LPCWSTR>( pMyItem->module.getStr() )), + { + LPCWSTR pModuleName = reinterpret_cast<LPCWSTR>( pMyItem->module.getStr() ); + HMODULE hModule = GetModuleHandleW( pModuleName ); + if ( hModule == NULL ) + { + LoadLibraryW( pModuleName ); + hModule = GetModuleHandleW( pModuleName ); + } + hIcon = (HICON) LoadImageA( hModule, MAKEINTRESOURCE( pMyItem->iconId ), IMAGE_ICON, cx, cy, LR_DEFAULTCOLOR | LR_SHARED ); + } else hIcon = (HICON) LoadImageA( GetModuleHandle( NULL ), MAKEINTRESOURCE( pMyItem->iconId ), IMAGE_ICON, cx, cy, |