SilverScreen Solid Modeler



Previous topic Next topic  


Previous topic Next topic JavaScript is required for the print function  




BOOL on_sdc_menu_command(UINT CommandID);


UINT CommandID;   // An unsigned-integer





#include "silver.h"


The on_sdc_menu_command function is used to pass a command message to SilverEngine for handling if it has a menu active, for instance a pop-up menu while picking.




CommandID is a Win32 command identifier, for instance WM_COMMAND



Return Value

on_sdc_menu_command returns TRUE if the command was handled by SilverEngine and FALSE otherwise.




on_sdc_menu_command operates similarly to the MFC function PreTranslateMessage. It will only handle the command when there is an interactive menu active, in which case it should be ignored by your application. It is likely that the command ids being sent from a SilverEngine menu would interfere with, or be ignored by, your application otherwise.



See Also





The following code shows the typical usage of on_sdc_menu_command in an MFC application; for a complete example see the SilverEngine, EngineShell sample:


C / C++ Code for MFC


BOOL CMainFrame::OnCmdMsg(UINT nID,

                         int  nCode,

                         void* pExtra,

                         AFX_CMDHANDLERINFO* pHandlerInfo)


  if ( ! pHandlerInfo )


     switch ( short(LOWORD(nCode)) )


        case CN_COMMAND:


           // If an engine menu is active, then let it handle the command.


           if ( on_sdc_menu_command(nID) )

              return TRUE;



        case CN_UPDATE_COMMAND_UI:


           // If an engine menu is active, then let it handle the

           // ui command.


           if ( on_update_sdc_menu_command_ui((CCmdUI *)pExtra) )

              return TRUE;






  // Call the base-class command-routing mechanism


  return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);