summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-04-11 23:15:23 +0200
committerMichael Stahl <mstahl@redhat.com>2016-04-12 15:17:03 +0200
commit6f047b5866ee7c3f707a4f12ef9f95e7dbdb6e93 (patch)
tree341a7c333dfaadf0e9e240330e158f67bb2a5203 /sfx2
parent3bbd98301ad95a9aff74bd2ae08c1e2e04a0f10b (diff)
WNT: check result of PostMessage()
... so the next time something overflows the main thread's message queue it's easier to debug. Change-Id: I90a35e46f3b2cab190c7da5e53024ec549159ac6
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index ce37d3032b31..89117e4c9c14 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -305,8 +305,11 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
switch( lParam )
{
case WM_LBUTTONDBLCLK:
- PostMessage( aExecuterWindow, WM_COMMAND, IDM_TEMPLATE, (LPARAM)hWnd );
+ {
+ BOOL const ret = PostMessage(aExecuterWindow, WM_COMMAND, IDM_TEMPLATE, (LPARAM)hWnd);
+ SAL_WARN_IF(0 == ret, "sfx.appl", "ERROR: PostMessage() failed!");
break;
+ }
case WM_RBUTTONDOWN:
{
@@ -322,7 +325,8 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
EnableMenuItem( popupMenu, IDM_TEMPLATE, MF_BYCOMMAND | (ShutdownIcon::bModalMode ? MF_GRAYED : MF_ENABLED) );
int m = TrackPopupMenuEx( popupMenu, TPM_RETURNCMD|TPM_LEFTALIGN|TPM_RIGHTBUTTON,
pt.x, pt.y, hWnd, NULL );
- PostMessage( hWnd, 0, 0, 0 );
+ BOOL const ret = PostMessage( hWnd, 0, 0, 0 );
+ SAL_WARN_IF(0 == ret, "sfx.appl", "ERROR: PostMessage() failed!");
switch( m )
{
case IDM_OPEN:
@@ -347,7 +351,8 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
break;
}
- PostMessage( aExecuterWindow, WM_COMMAND, m, (LPARAM)hWnd );
+ BOOL const ret2 = PostMessage(aExecuterWindow, WM_COMMAND, m, (LPARAM)hWnd);
+ SAL_WARN_IF(0 == ret2, "sfx.appl", "ERROR: PostMessage() failed!");
}
break;
}
@@ -372,7 +377,8 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
nid.uID = ID_QUICKSTART;
Shell_NotifyIconA(NIM_DELETE, &nid);
- PostMessage( aExecuterWindow, WM_COMMAND, IDM_EXIT, (LPARAM)hWnd );
+ BOOL const ret = PostMessage(aExecuterWindow, WM_COMMAND, IDM_EXIT, (LPARAM)hWnd);
+ SAL_WARN_IF(0 == ret, "sfx.appl", "ERROR: PostMessage() failed!");
}
else
return DefWindowProc(hWnd, uMsg, wParam, lParam);