Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Terminate/Close/Shutdown/Kill Server by code

Post Reply
Shine
Posts: 5
Joined: 2008-02-01 20:53

Terminate/Close/Shutdown/Kill Server by code

Post by Shine »

hi,

How do you gracefull shutdown the server (winvnc.exe) from an other application?

I would like to start/kill the server as an user-process from my own application.

Is there a way to kill the server by a special command/message (postmessage) or commandline argument?
YY
200
200
Posts: 996
Joined: 2006-11-13 15:11

Re: Terminate/Close/Shutdown/Kill Server by code

Post by YY »

You may use the DOS Cmd "Taskkill", like this:

Code: Select all

taskkill /F /IM winvnc.exe
Shine
Posts: 5
Joined: 2008-02-01 20:53

Re: Terminate/Close/Shutdown/Kill Server by code

Post by Shine »

hi,

thanks for your response.

if there is no way for a gracefull dead, then i use the pskill tool.
http://www.microsoft.com/germany/techne ... skill.mspx


taskkill is only available for XP and above (?).
Shine
Posts: 5
Joined: 2008-02-01 20:53

Re: Terminate/Close/Shutdown/Kill Server by code

Post by Shine »

hi,

i kill'em like this

Code: Select all

// try to kill softly
if (!postmessage (hWnd, WM_Close,0,0)) { 
  // try the big hammer
  hProcess = OpenProcess (processId, TERMINATE | SYNCHRONIZE));
  TerminateProcess (hProcess);
  CloseHandle (hProcess);
}
Works fine.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Terminate/Close/Shutdown/Kill Server by code

Post by Rudi De Vos »

winvnc.exe -kill


With the 104 RC , this work in application and service mode, at least when you are admin to run the winvnc.exe -kill.

Is it not working as you seems to look for another method ?
Shine
Posts: 5
Joined: 2008-02-01 20:53

Re: Terminate/Close/Shutdown/Kill Server by code

Post by Shine »

Hi,

if you execute "winvnc.exe -kill " you get this messagebox
---------------------------
WinVNC Usage
---------------------------
winvnc [-run] [-autoreconnect[ ID:????]] [-connect host[:display]] [-connect host[::port]]

---------------------------
OK
---------------------------

-kill is unknown!?

But i am using the VNC-Server from http://downloads.sourceforge.net/ultrav ... -Setup.exe

Is there any newer/older/special setup which contains a killable server?
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Terminate/Close/Shutdown/Kill Server by code

Post by Rudi De Vos »

You need some later version was added in RC10 or RC11.

Latest exe can be found in

http://sc.uvnc.com/dev
Shine
Posts: 5
Joined: 2008-02-01 20:53

Re: Terminate/Close/Shutdown/Kill Server by code

Post by Shine »

hi,

thanks a lot.

Works fine.
teacherwilli
8
8
Posts: 26
Joined: 2005-11-22 07:18

Re: Terminate/Close/Shutdown/Kill Server by code

Post by teacherwilli »

But the command -kill will cause a memory-read-error!!!
Why this?
Post Reply