summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCarsten Driesner <cd@openoffice.org>2010-04-01 09:50:13 +0200
committerCarsten Driesner <cd@openoffice.org>2010-04-01 09:50:13 +0200
commit0436f69e21da10550f3eb3af6a02800467a7bd42 (patch)
treeac53b3544ae97438cd9fc3733eaebae03ab678e4 /sfx2
parentb376139e57fd8099c4c4867509bff7aaca31c0c6 (diff)
nativea: #161787# More safe code to retrieve open icon from shell library
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index d5d52a02fda5..7dd043ad85f8 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,