Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » minimize/maximize/restore OnSysCommand not working with Office 2007 themes Collapse All
Subject Author Date
Martin Quaak Aug 8, 2007 - 2:42 PM

I want to minimize the application to the system tray. In version 2.80 this is not working any more. The OnSysCommand handler is not called when a Office 2007 theme is applied. It works for the win 2000/xp/office 2003 and vs2005 themes.

The application is a dialog based application.

The OnSysCommand handler is not called when pressing the minimize/restore or maximize buttons in the caption of the dialog. When pressing the close button the OnSysCommand function is called, also in with the Office 2007 themes applied.

Any idea to get this working again?

Technical Support Aug 9, 2007 - 11:34 AM

The WM_SYSCOMMAND messages are sent in the skinned mode and you can verify this by adding the following code into the main frame or dialog class of any sample application provided with Prof-UIS:

      virtual LRESULT WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
      {
            if( message == WM_SYSCOMMAND )
            {
                  CString s;
                  s.Format( _T("WM_SYSCOMMAND -> 0x%04X"), wParam );
                  ::AfxMessageBox( s );
            }
            return CExtNCW < CFrameWnd > :: WindowProc( message, wParam, lParam );
      }
But these messages are completely handled in the CExtNCW::WindowProc() method. That is why OnSysCommand() is not called. We cannot let these messages be delivered to the standard default window procedure because this would have made the skinned non-client window area over-painted with that of the standard window. So, you should handle these messages in the WindowProc() virtual method.