SilverScreen Solid Modeler

Menu Text on Status Line

Menu Text on Status Line

Previous topic Next topic  

Menu Text on Status Line

Previous topic Next topic JavaScript is required for the print function  

SilverPlusEllipse

 

How to make menu text appear in the status line

 


In a normal Windows application, the text associated with a menu item is displayed on the status line. In a DLL, if you have put up your own menu, the link between the menu and the status line is broken. The solution is to intercept the WM_MENUSELECT message in your subclassed window function. The wParam parameter specifies the command ID desired. Fetch the appropriate text for that command ID, and display it on the status line by using qmessage.

 

 

 


Here is a typical interception of WM_MENUSELECT, where load_text_string is a function that supplies the DLL resource handle to LoadString, and extracts the status message portion of the message:

 

C / C++ Code

 

. . .

 

LRESULT CommonHookWndProc(WNDPROC oldWndProc,

                         HWND    hWnd,

                         UINT    message,

                         WPARAM  wParam,

                         LPARAM  lParam )

  {

  . . .

 

  switch ( message )

     {

     . . .

 

     case WM_MENUSELECT:

 

           if ( ! (item = LOWORD(wParam)) )

                 break;

 

           if ( load_text_string( item, xxx ) )

              qmessage( xxx, 0, 0 );

 

           break;

     . . .

     }

 

  . . .

  }

 

 

 

 

 

For a complete example see the SilverPlus sample application MFDLL.