Getting Navison in front while using Excel

compu-know
Member Posts: 21
Is there a possibility (Statement, program or so) to get the Navision-Application in front while using another application (Excel).
0
Comments
-
Hi,
it is possible to set a property ~"Visible" before starting Excel. Maybe also via ~"Userinteraction is allowed"
If you have further questions in this type of materia, you can also contact me via mail.
Best Regards from Stuttgart
Martin0 -
You mean that you want Navision to be the topmost window:
1. so navision is on top of excel
2. but excel has the focus
Thats possible when you write an automation DLL in VB6. You will have to use the API function "SetWindowPos". Little code example:Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long Declare Function GetForegroundWindow Lib "user32" () As Long Global Const HWND_TOPMOST = -1 Global Const HWND_NOTOPMOST = -2 Global Const SWP_NOMOVE = 2 Global Const SWP_NOSIZE = 1 Global Const flags = SWP_NOMOVE Or SWP_NOSIZE Public Sub SetTopMostWindow() SetWindowPos GetNavHwnd, HWND_TOPMOST, 0, 0, 0, 0, flags End Sub Public Sub UndoSetTopMostWindow() SetWindowPos GetNavHwnd, HWND_NOTOPMOST, 0, 0, 0, 0, flags End Sub Public Function GetNavHwnd as long Dim tmphwnd As Long tmphwnd = GetForegroundWindow Do GetNavHwnd = tmphwnd tmphwnd = GetParent(tmphwnd) Loop Until tmphwnd = 0 End Function
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
- 320 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