summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/shutdowniconw32.cxx
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
commit049e49785014db9751613ed876b4ee209fdbd3d3 (patch)
treecee5ff08127f98ad74fcbbf4d12729b3c61096c5 /sfx2/source/appl/shutdowniconw32.cxx
parent5dc0e22084c3ca0782f94e27de4a481822d2bad6 (diff)
nativea: #161787# More safe code to retrieve open icon from shell library
Diffstat (limited to 'sfx2/source/appl/shutdowniconw32.cxx')
-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 87c48034c6..e018d5e903 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,