Jump to content
tatane

Problem with GuiCtrlCreateObj resizing

Recommended Posts

tatane

Hi,

I'm playing with an old activex dll for automation of vnc (http://www.abstractpath.com/downloads/VNCX_0.9.2.8.zip)

Look at the code below (change @ip, port and password to fit your vnc remote connection) :

#include <GUIConstants.au3>

; http://www.abstractpath.com/downloads/VNCX_0.9.2.8.zip

Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc")


$Form1 = GUICreate("Test VNCX", 1300, 800)
GUISetState(@SW_SHOW)


$ip_or_name = "aaaaaaaaaaa"
$port = "5900"
$password = "xxxxxxxxxxxxxx"


$VNCViewer1 = ObjCreate("VNCX.VNCViewer") ; "{EFAB8D1F-794A-4C47-B834-53653E05A441}"
$VNCViewerctrlobj1 = GUICtrlCreateObj($VNCViewer1, 5, 5, 50, 50)

; Event handler
$VNCViewerEventobj1 = ObjEvent($VNCViewer1, "IVNCViewer_")


$VNCViewer1.Connect($ip_or_name, $port, $password, "")
$VNCViewer1.Stretch = True
$VNCViewer1.Display = 0
$VNCViewer1.StretchX(1, 3)
$VNCViewer1.StretchY(1, 3)


Local $timeout = TimerInit()
Do
    Sleep(50)
    If TimerDiff($timeout) > 4000 Then
        MsgBox(0, "Error", "Timeout reached")
        Exit
    EndIf
Until $VNCViewer1.IsConnected = True


$VNCViewer1.Start
; let's resize the control to fit the distant desktop resolution divided by 3 (see .StretchX and .StretchY)
GUICtrlSetPos($VNCViewerctrlobj1, 5, 5, $VNCViewer1.ViewWidth, $VNCViewer1.ViewHeight)
$VNCViewer1.Refresh($VNCViewer1.ViewLeft, $VNCViewer1.ViewTop, $VNCViewer1.ViewWidth, $VNCViewer1.ViewHeight)



While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            $VNCViewer1.Stop
            $VNCViewer1.Disconnect
            Exit

    EndSwitch
WEnd


; Evènement : La connexion vient d'être établie
Func IVNCViewer_Connected($ServerName)
    ConsoleWrite("Connected to " & $ServerName & @CRLF)
EndFunc


Func IVNCViewer_BeforeMouseUp($VNCXButtonsEnum, $VNCXModifiersEnum, $X, $Y, $VNCXActionsEnum)
;~  GUICtrlSetPos($VNCViewerctrlobj1, 5, 5, $VNCViewer1.ViewWidth + 1, $VNCViewer1.ViewHeight + 1)
EndFunc


Func IVNCViewer_Error($VNCXErrorsNumber, $ErrorMessage, $VARIANT)
    ConsoleWrite("$VNCXErrorsNumber=" & $VNCXErrorsNumber & "   $ErrorMessage =" & $ErrorMessage & "   $VARIANT=" & $VARIANT & @CRLF)
EndFunc

Func IVNCViewer_Warning($VNCXWarningNumber, $WarningMessage, $VARIANT)
    ConsoleWrite("$VNCXWarningNumber=" & $VNCXWarningNumber & "   $WarningMessage =" & $WarningMessage & "   $VARIANT=" & $VARIANT & @CRLF)
EndFunc


; User's COM error function. Will be called if COM error occurs
Func _ErrFunc($oError)
    ; Do anything here.
    ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _
            @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _
            @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
            @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _
            @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _
            @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
            @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
            @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
            @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
            @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF)
EndFunc   ;==>_ErrFunc

 

When I click on the activex control object ($VNCViewerctrlobj1) this control get back to its original size which is 50x50 even if I resized it to the size of remote desktop / 3.

Do you think it's a autoit issue or dll issue ?

 

Thanks.

Share this post


Link to post
Share on other sites
mLipok

Do you have any current link to documentation for this activex object ?

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library
 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites
tatane

Unfortunatly I don't. The web site is down since 2007 and I can't find any documentation.

I suppose you already know that you can use OLE/COM Object Viewer to get all methods and properties of this activex object. But with no description :(

Share this post


Link to post
Share on other sites
tatane

No idea ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×