Kill Navision from Inside

DontWorry
Member Posts: 4
Good Evening,
how can i kill a navision client from his code? for example, if a form timer arrives at 15 minutes, kill navision. is possible?
Thank you so much
how can i kill a navision client from his code? for example, if a form timer arrives at 15 minutes, kill navision. is possible?
Thank you so much
Cheers!!!
DontWorry
DontWorry
0
Comments
-
Hy,
why don´t you use the windows kill command:
For Example like this:
OnTimer()
SHELL(kill fin.exe);0 -
The problem with Windows kill is that it only kilss the session on the client, not on the server. For that, check with http://www.expandit.com
Regards,
Ole0 -
you can also try PsKill ! It works also for remote computers !
http://www.sysinternals.com/ntw2k/freeware/pskill.shtml
Navision code looks like:SHELL('pskill finsql.exe');
orSHELL('pskill fin.exe');
®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
Hi Robi,
does pskill actually kill the client's session on the server?
(P.S. Thanks for link yesterday)
Regards,
Ole0 -
I tried it only locally, but documentation on sysinternals site say it can,Usage: pskill [\\computer [-u username [-p password]]] <process Id or name>
-u Specifies optional user name for login to
remote computer.
-p Specifies optional password for user name. If you omit this
you will be prompted to enter a hidden password.®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
Hi Robi,
It seems to work - at least no sessions appear to be "hanging" on our sql server 8)
Regards,
Ole0 -
I think the best way to friendly close navision is to create a activex DLL and code as following (visual basic 6 example):
Option Explicit private Declare Function SendMessage Lib "user32" _ Alias "SendMessageA" (ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ lParam As Any) As Long Private Declare Function GetForegroundWindow Lib "user32" () As Long Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long private Const WM_CLOSE = &H10 Public sub CloseNavision() SendMessage getNavHwnd, WM_CLOSE, 0, 0 End Function Private Function GetNavHwnd() as long Dim tmphwnd As Long tmphwnd = GetForegroundWindow Do getNavHwnd = tmphwnd tmphwnd = GetParent(tmphwnd) Loop Until tmphwnd = 0 End Sub
Reference the DLL and call CloseNavision. It should work I think. Didn't test it but parts of the code i'm using in my code so i only brought a few modules together.
This won't work when you have any form open that has code that prevents that form from closing. In that way navision is prevented from closing. It won't work while messagboxes are still pending (neither will your timer trigger fire in that case).
EnjoyIn a world without Borders or Fences, who needs Windows and Gates?0 -
you can try this too.
http://www.autocloseidle.com/0 -
ooooh I just noticed it is $495.00
was $200.00 just a month ago - talk about inflation0 -
What version are you using? From 3.70 on SQL you can kill a session by deleting the record from the Session table provided it is not your own.
(This is available on both server platforms in 4.0).Dean McCrae - Senior Software Developer, NAV Server & Tools
This posting is provided "AS IS" with no warranties, and confers no rights.0 -
One problem with using kill or pskill is if the user runs two clients on his desktop and one of them reaches the timeout limit. Then any of them can be closed down.
When the user is in the middle of work, suddenly the client closes down...
Further on, kill cannot be used in Terminal Server or Citrix.
But if it was possible to find out the client's process ID, then the correct client could be closed down. Waterproof solution.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