Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: 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://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

1SCDLL & AutoIt

Post Reply
piccaso
Posts: 4
Joined: 2007-03-29 19:52

1SCDLL & AutoIt

Post by piccaso »

Hi Everybody :)

Since i didn't find a existing example i translated the available Functions to Autoit and made a little example on how to use it:

Code: Select all

Global $hDll_1SCDLL = DllOpen("1SCDLL.dll")
If Not ($hDll_1SCDLL = -1) Then
	; Like: -connect localhost:64535 -passwd 8FE4C11451281C094A6578E6DDBF5EED
	If _Start_Server("", "", "localhost", 64535, "8FE4C11451281C094A6578E6DDBF5EED", False, "", True) Then
		ConsoleWrite("Call Succeded" & @LF)
	Else
		ConsoleWrite("Call Failed: " & @error & @LF)
	EndIf
Else
	MsgBox(0, "Error Title", "Error Text")
	Exit -1
EndIf

#cs
	1SCDLL.dll Helper Functions
	a Succesfull 'Global $hDll_1SCDLL = DllOpen("1SCDLL.dll")' is Required
	CallTips:
	_Stop_Server()
	_Start_Server($sID, $sRepeater, $sDirect, $iPort, $sPassword, $fProxy, $sClassname, $fHaveToWait)
	
	Return Values:
	True = Call Succeded
	False = Call Failed
	@error = 1 -> dll not Loaded
	@error = 2 -> Error calling export function
	
#ce
Func _Start_Server($sID, $sRepeater, $sDirect, $iPort, $sPassword, $fProxy, $sClassname, $fHaveToWait)
	If $hDll_1SCDLL > 0 Then
		DllCall($hDll_1SCDLL, "none:cdecl", "Start_server", _ 	; MY1SCDLL_API void Start_server(
				"str", $sID, _									; char *ID,
				"str", $sRepeater, _							; char *repeater,
				"str", $sDirect, _								; char *direct,
				"int", $iPort, _								; int port,
				"str", $sPassword, _							; char *passwd,
				"int", $fProxy, _								; bool proxy,
				"str", $sClassname, _							; char *classname,
				"int", $fHaveToWait) 							; bool have_to_wait);
		If Not @error Then Return True
	Else
		Return SetError(1, 0, False)
	EndIf
	Return SetError(2, 0, False)
EndFunc   ;==>_Start_Server

Func _Stop_Server()
	If $hDll_1SCDLL > 0 Then
		DllCall($hDll_1SCDLL, "none:cdecl", "Stop_server") 		; MY1SCDLL_API void Stop_server();
		If Not @error Then Return True
	Else
		Return SetError(1, 0, False)
	EndIf
	Return SetError(2, 0, False)
EndFunc   ;==>_Stop_Server
As i was working on this i realized that Start_server only accepts window classnames for communication.
Autoit does not have unique classnames so multiple running scripts would lead into trouble.
And my question is...
Is there any way to pass an window handle instead of the Classname?
Or something like this planned?
or do i have to find a solution for this problem on the AutoIt side (Like creating a window with a unique classname with api calls) ?

Thanks :D
piccaso
Posts: 4
Joined: 2007-03-29 19:52

Re: 1SCDLL & AutoIt

Post by piccaso »

The source above is a bit easier to understand with syntax highlighting
http://piccaso.pi.funpic.de/stuff/1scdau3.htm
beware of popups, its a free host :)
cicio
Posts: 5
Joined: 2007-01-22 11:50

Re: 1SCDLL & AutoIt

Post by cicio »

many thanks it works. I tried to do the same thing with 1SCVDLL.dll for the viewer but without luck. can you help me? there's an example to use it with delphi here [post=35628][/post]
piccaso
Posts: 4
Joined: 2007-03-29 19:52

Re: 1SCDLL & AutoIt

Post by piccaso »

cicio
Posts: 5
Joined: 2007-01-22 11:50

Re: 1SCDLL & AutoIt

Post by cicio »

works great. Thanks!! :-D
Last edited by cicio on 2007-05-08 20:13, edited 1 time in total.
mbkowns
8
8
Posts: 8
Joined: 2007-05-31 16:55

Re: 1SCDLL & AutoIt

Post by mbkowns »

What does this let you do?

Im confused 8)
-MBK (aim=illmbklli)
thor918
20
20
Posts: 43
Joined: 2007-08-19 15:34

Re: 1SCDLL & AutoIt

Post by thor918 »

@piccaso
Hi there!
what is the status of your wrapper?
is it fully functional?
did you get rid of the problem you describe in this forum topic?
Matts
20
20
Posts: 38
Joined: 2008-07-26 12:39

Re: 1SCDLL & AutoIt

Post by Matts »

It would be nice indeed to see a "working" version so we have a place to start from.

I'm able to place a icon in the taskbar that changes into a cross every time after 3 seconds and goes back to it's normal icon, I see something on my port with netstat, but I'm not satisfied it's usable :)
Matts
20
20
Posts: 38
Joined: 2008-07-26 12:39

Re: 1SCDLL & AutoIt

Post by Matts »

Was someone already able to use this ?
Post Reply