Is it possible to add ..
Wishman
Member Posts: 36
Hi all,
I want to add a new menu item to the Tools menu.Under the language over object designer..
Is it possible, if yes how?
Any info will be appreciated.
Thanks a lot.
I want to add a new menu item to the Tools menu.Under the language over object designer..
Is it possible, if yes how?
Any info will be appreciated.
Thanks a lot.
0
Comments
-
The top menu (File, Edit, View, Tools, etc.) cannot be modified using Navision C/AL Code. This menu is defined in the fin.stx file that resides in the Navision application folder, but only MBS can modify this file to add/change menu items.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
ehm, if you really badly want it and if youre a little handy writing ActiveX DLL's in visual basic and API programming, have a look at this code:
Public Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long Public Declare Function GetMenu Lib "user32" (ByVal hWnd&) As Long Public Declare Function InsertMenu Lib "user32" Alias "InsertMenuA" (ByVal hMenu&, ByVal nPosition&, ByVal wFlags&, ByVal wIDNewItem&, ByVal lpNewItem$) As Long Public Declare Function GetActiveWindow Lib "user32" () As Long Public Declare Function AppendMenu& Lib "user32" Alias "AppendMenuA" (ByVal hMenu&, ByVal wFlags&, ByVal wIDNewItem&, ByVal lpNewItem$) Public Declare Function CreatePopupMenu Lib "user32" () As Long Public Declare Function DrawMenuBar Lib "user32" (ByVal hWnd&) As Long Public Declare Function GetFocus Lib "user32" () As Long Public Declare Function GetForegroundWindow Lib "user32" () As Long ublic Const MF_BYCOMMAND& = &H0& Public Const MF_BYPOSITION& = &H400& Public Const MF_POPUP& = &H10& Public Const MF_STRING& = &H0& Public Const MF_CHECKED = &H8& Public Const MF_DISABLED = &H2& Public Const MF_MENUBARBREAK = &H20& Public Const MF_MENUBREAK = &H40& Public Const MF_SEPARATOR = &H800& Public Sub CreateNavMenu(ByVal Name As String, ByVal SubItems As String) ' get parent form hwnd Dim hWnd As Long Dim oldhwnd As Long hWnd = GetForegroundWindow While hWnd <> 0 oldhwnd = hWnd hWnd = GetParent(hWnd) Wend hWnd = oldhwnd ' set menu Dim hMenu As Long Dim appHMen As Long hMenu = CreatePopupMenu() Dim myitems() As String myitems = Split(SubItems, ",") Dim i As Integer For i = 0 To UBound(myitems) If myitems(i) <> "-" Then AppendMenu hMenu, MF_STRING, i, myitems(i) Else AppendMenu hMenu, MF_SEPARATOR, 0, "-" 'If you want to add saperator then unComment this line End If Next i appHMen = GetMenu(hWnd) InsertMenu appHMen, 5, MF_BYPOSITION Or MF_POPUP, hMenu, Name DrawMenuBar appHMen 'Draw Menu bar to visible menu End Sub
And this code only appends the menu, to know if the user clicked it you will need to subclass the menu. Then you can raise an trigger in C/AL and have C/AL code executed.
But, it all is a bit tricky and also keep in mind that Navision refreshes its menu regulary so your menu will disappear then. When navision refreshes its menu you need to refresh yours as well ..
Oh, and you asked how you could add a menu to an existing. This is also possible but don't have a code example ready but with this code youre close ..
Good luck
In a world without Borders or Fences, who needs Windows and Gates?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
