Results 1 to 6 of 6
Thread: Programically closing TS3 Client
-
01-02-2012, 12:09 #1
-= TeamSpeak User =-
- Join Date
- Feb 2012
- Posts
- 4
Programically closing TS3 Client
I am writing a program which uses TS3.
Launching TS3 is straightforward (using the 'tsserver:?IP/port=' etc command.)
Afrer the initial connection, moving the 'clientmove' command using the Query language.
But! I cannot programatically close the TS3 client program.
Of course, I can 'kill' the process, but that does only stops the program, it does not close down gracefully by disconnecting from any existing connections.
The most common way to close an app is the Windows function 'CloseMainWindow', but TS3 does not respond to that message.
Is there a way to safely programatically close the TS3 client app?
-
03-02-2012, 17:18 #2
-= TeamSpeak Addict =-
- Join Date
- Aug 2009
- Location
- Across the street
- Posts
- 222
Couldn't you just manually terminate the connections (I believe this can be done, check SDK) and then kill it?
Unless the devs add a graceful method to terminate the client/server, then I am afraid your choices are slim. Unless you send keys to the client.
Ctrl-D to disconnect (maybe loop until no longer connected?) client then Ctrl-Q to quit the client.
Maybe add this to the suggestion forum. It would be nice to programmatically close the client via plugin SDK.
-
01-03-2012, 12:26 #3
-= TeamSpeak User =-
- Join Date
- Feb 2012
- Posts
- 4
I am writing an external application which interfaces with the TS3 Client app.
It can start TS3, using the standard command (e.g. ts3server://x.x.x.x/?port=x&channel=1234). It also uses the ServerQuery to interrogate the TS3 client with simple commands (e.g.for whoami,get channel list, change channel).
But. My app requires the User is connected to a particular server.
I cannot find a way to gracefully disconnect the User from their existing server; or to create a new connection to the new server.
Even attempts to send Windows 'wm_close' commands to the TS3 Window does not close TS3.
What are my options for programming TS3 Client to do things like:
1) Close a connection (rather like pressing Control/D, except that this cannot be done if TS3 is minimised).
2) Exit TS3 without simply 'killing' the Windows Process.
Thank you.
--- Merged ---
As far as I can see, the SDK can only open and close Server connections it has made itself. And sadly, Ctrl-D types of commands are not possible when the TS3 Client app is minimised.
Thanks for your response. I shall now visit the 'suggestion forum'.Last edited by florian_fr40; 15-03-2012 at 15:25.
-
03-03-2012, 11:36 #4
-= TeamSpeak User =-
- Join Date
- Mar 2012
- Posts
- 1
Closing TS3 Remotely
Hi,
I am writing an app to control the TS3 client from a windows/.net. I can start TS with the ts3server:// string. I can close an open TS3 using Ctrl D, but I need to either disconnect from server or close the client even if minimised. Does any one know if there is a string command that will close or disconnect from server.
Any help would be appreciated.
John
-
13-03-2012, 17:13 #5
-= TeamSpeak User =-
- Join Date
- Mar 2012
- Posts
- 1
send Windows 'wm_close' command WORKS for me !
Code:[DllImport("user32.dll")] public static extern int FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")] public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam); public const int WM_COMMAND = 0x0112; public const int WM_CLOSE = 0xF060; int handle = FindWindow("QWidget", "TeamSpeak 3"); SendMessage(handle, WM_COMMAND, WM_CLOSE, 0);
But can someone tell me exactly how an external application can remote control the TS3 Client app, please ?
-
15-03-2012, 12:02 #6
-= TeamSpeak User =-
- Join Date
- Feb 2012
- Posts
- 4
Thanks for the example code. It may become very useful.
Some control is available by using creating a network connection to the Client, then using some of the ServerQuery commands.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Resolved] [BUG]Client tries to reconnect afer closing with red cross (program exit)
By Slater in forum Bug ReportsReplies: 3Last Post: 19-01-2011, 08:59 -
TS client crashed after closing a message window
By MasterDune in forum Bug ReportsReplies: 4Last Post: 23-07-2010, 10:02 -
People can reconnect to server after closing client
By THEEwhiteboy in forum Server SupportReplies: 15Last Post: 25-01-2010, 21:52 -
Keeps Closing On Opening
By kornbograt in forum [TeamSpeak 2] Server SupportReplies: 3Last Post: 24-12-2005, 21:15


Reply With Quote