DJ VenGenCe Posted March 2, 2006 Share Posted March 2, 2006 (edited) Width the help of Lod3n, I have finally got it to work!Requires you to Download and Register VNCX.dll from this site:VNCXStart up a VNC Test Server (Tested with Real VNC) with no user authentication.To do: Authentication PromptsSuggestions ?expandcollapse popup#include <GUIConstants.au3> ;Example of Embedding VNCX Viewer into Auto It Script. ;Big thanks to lod3n for the Base Code. I added Zoom. And a Sleep of 2500 for the connection to work on my end. Added some new events. ;Coding comments to come. $VNCViewer1 = ObjCreate("VNCX.VNCViewer") $zoom_value = "100" Global $vncxScrollbarNone = 0; Global $vncxScrollbarHorizontal = 1; Global $vncxScrollbarVertical = 2; Global $vncxScrollbarBoth = 3; $vncxWarningHandshakeAuthCancelled = 0x2ff; ; Create Gui $handle = GUICreate ( "Embedded VNCX Control Test", 810, 768, (@DesktopWidth) / (@DesktopWidth), (@DesktopHeight) / (@DesktopHeight), $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $size = WinGetClientSize("") $GUIActiveX = GUICtrlCreateObj($VNCViewer1, 5, 20, 800,675);, ($size[0] - 50)) $GUI_Input = GUICtrlCreateInput ( "", 10, 700, 100, 20) $GUI_Button_Connect = GuiCtrlCreateButton ("Connect", 120, 700, 100, 20) $GUI_Checkbox_SendMouse = GUICtrlCreateCheckbox ("SendMouse", 230, 700, 100, 30) $GUI_Checkbox_SendKeys = GUICtrlCreateCheckbox ("SendKeys", 330, 700, 100, 30) $GUI_Button_Disconnect = GuiCtrlCreateButton ("Disonnect", 430, 700, 100, 20) $zoom_Drop = GUICtrlCreateCombo ("10", 550,700, 100, 20); create first item GUICtrlSetData(-1,"10|20|30|40|50|60|80|100|150|200","100"); add other item snd set a new default GUISetState () ;Show GUI While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $GUI_Button_Connect connect() case $msg = $GUI_Button_Disconnect disconnect() case $msg = $zoom_Drop zoom_onpropertychange() Case $msg = $GUI_EVENT_RESIZED zoom_onpropertychange() $arr = WinGetClientSize($handle); $arr[0] = $arr[0] - "100" $arr[1] = $arr[1] - "100" $result = GUICtrlSetPos($GUIActiveX, 5, 20, $arr[0], $arr[1]) EndSelect Wend GUIDelete () Exit func connect() $VNCViewer1.RelayKeys = guictrlread($GUI_Checkbox_SendKeys) $VNCViewer1.RelayMouse = guictrlread($GUI_Checkbox_SendMouse) $VNCViewer1.Alignment = 16 $VNCViewer1.Stretch = true $VNCViewer1.Display = 0 $VNCViewer1.Connect(guictrlread($GUI_Input), "","","") Start_Session() EndFunc Func Start_Session() SLEEP(2500) $VNCViewer1.Start; zoom_onpropertychange() EndFunc func disconnect() $VNCViewer1.Stop() EndFunc Func zoom_onpropertychange() $zoom = GUICtrlRead($zoom_Drop) $VNCViewer1.StretchX($zoom / 10, 10); $VNCViewer1.StretchY($zoom / 10, 10); EndFunc Edited September 8, 2006 by DJ VenGenCe Link to comment Share on other sites More sharing options...
lod3n Posted September 8, 2006 Share Posted September 8, 2006 (edited) Well, without getting my feet wet, why not just uncomment your first $oIE.Navigate, and make it go to "http://www.veridicus.com/tummy/programming/vncx/examples/html/vncx_ie.htm" Edited September 8, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
lod3n Posted September 8, 2006 Share Posted September 8, 2006 (edited) Okay, feet wet, but I don't have a VNC server to test this on:;commented out by request of original poster. Please see his modified code in the first post. Edited September 11, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
PWProphets Posted June 15, 2012 Share Posted June 15, 2012 Hello all! Sorry to bump this thread 6 years later I am currently creating a bot for a video game and am using VNC to accomplish this. I was wondering if there is an option to update the whole screen and I would also like to do 256 colors for speed Anyone been messing with this and figured out howto utilize these options? I checked the DLL it has a refresh function but when I call it, it just closes connection and I have to reconnect. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 15, 2012 Moderators Share Posted June 15, 2012 PWProphets,Welcome to the AutoIt forum. Obviously you did not bother to read the Forum Rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. You might also like to note that we take a very dim view of necro-posting because AutoIt has changed enormously over the years and it is very unlikely the problem and/or code are still relevant today. Make sure you read those rules before posting again. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts