I have a function that changes the text of some MDI menu items, depending on app parameters.
The problem I have is that every time a window is opened/closed the menu reverts to default.
IIRC there was a message sent to a MDI on which I could call my function to change the text.
The problem is I can't remember (nor find) which is the correct message.
Anyone have a hint?
One way to do this is to trap SAM_Create and SAM_CreateComplete msgs. and do necessary processing in them:The problem I have is that every time a window is opened/closed the menu reverts to default. IIRC there was a message sent to a MDI on which I could call my function to change the text.
Code: Select all
On SAM_Create ! hide the window for the moment so any menu changes are not visible Call SalHideWindow( hWndForm ) ! ! change the newly-created window's menu(s) ! do whatever other one-time processing your code needs to do for this new form/dlg/table window On SAM_CreateComplete ! do whatever other one-time finish processing your code might need to do for this new form/dlg/table window ! ! done with any/all create changes, so display the window Call SalShowWindow( hWndForm )
The code did this one time for the MDI window, then each time an activity was opened. In your case it will be faster since you only have menu text items to change.
Palm Springs, California
TD info. & samples: http://www.jeffluther.net/TD/
the MDI menu changes (potentially) when a form-window or tableclass-window gets activated.
So we catch "On SAM_Activate" on every of these window and manipulate the mdi menu then.
[ frevel & fey ] Software-System GmbH
Who is online
Users browsing this forum: [Ccbot] and 1 guest