Is there a way to change the menu text while running?
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-03
11:13 AM
- last edited on
‎2021-09-15
09:55 AM
by
Noemi Balogh
‎2020-08-03
11:13 AM
Hi.
I am trying to write a plugin which can update itself. Since there is no way to unload the apx while running, I make the apx to be a "shell" which can dynamic load dll. The dll ontains the implementation. However, I have no idea about RegisterInterface function because the function ACAPI_Register_Menu seems to have something to do with the runtime environment (maybe the stack or registers). I don't want to fix the menu in the "shell" but dynamicly load the related information from dll or txt. So I was wondering if I could change the menu text when ARCHICAD is running? Is there an API like ACAPI_Register_Menu?
Thanks in advance.
I am trying to write a plugin which can update itself. Since there is no way to unload the apx while running, I make the apx to be a "shell" which can dynamic load dll. The dll ontains the implementation. However, I have no idea about RegisterInterface function because the function ACAPI_Register_Menu seems to have something to do with the runtime environment (maybe the stack or registers). I don't want to fix the menu in the "shell" but dynamicly load the related information from dll or txt. So I was wondering if I could change the menu text when ARCHICAD is running? Is there an API like ACAPI_Register_Menu?
Thanks in advance.
Labels:
- Labels:
-
Add-On (C++)
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-10 11:52 AM
‎2020-08-10
11:52 AM
Hi,
Yes, you can use ACAPI_Interface (APIIo_SetMenuItemTextID, ...) function for this purpose.
Yes, you can use ACAPI_Interface (APIIo_SetMenuItemTextID, ...) function for this purpose.
API_MenuItemRef menuItemRef; GS::UniString menuItemStr = "New Text for Menu!!!"; BNZeroMemory (&menuItemRef, sizeof (API_MenuItemRef)); menuItemRef.menuResID = 32500; menuItemRef.itemIndex = 1; ACAPI_Interface (APIIo_SetMenuItemTextID, &menuItemRef, nullptr, menuItemStr);Note, you have to register your menu with ACAPI_Register_Menu in your RegisterInterface function and after that you can change the text of the menu anytime.