willichan

HyCam2

14 posts in this topic

HyCam2 (HyperCam v2) allows you to video record any or all of your screen to an AVI file.

This UDF allows you automate HyperCam through it's Automation Server interface.

There are still more features to be added, but the main ones are there.

Download it here.

Thanks to seangriffin for the introduction to the HyperCam utility.

2 people like this

Share this post


Link to post
Share on other sites



Nice.

btw:
Here you miss something ;)

 

Quote

; Name ..........: _HyCam2_Width
; Description ...:
; Syntax ........: _HyCam2_Width(Byref $oHyCam2[, $iWidth = Default])
; Parameters ....: $oHyCam2             - [in/out] an object.
;                  $iWidth              - [optional] an integer value. Default is Default.
; Return values .: None
; Author ........: Your Name

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
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 API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer 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 * Best coding practices * 

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) * 

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: 2017-06-04

Share this post


Link to post
Share on other sites
1 hour ago, mLipok said:

Nice.

btw:
Here you miss something ;)

 

 

Thanks.  Nice catch.

Share this post


Link to post
Share on other sites

I install HyperCam and try to use your UDF,  with no success.

So I change this:

Func _HyCam2_Open($sFileName)
    Local $oHyCam2 = ObjCreate("HyCam2.Application")
    If IsObj($oHyCam2) Then
        _HyCam2_Filename($oHyCam2, $sFileName)
        __HyCam2_Defaults($oHyCam2)
        Return $oHyCam2
    Else
        ;needs to be registered?
        __HyCam2_Register()
        ;try again
        $oHyCam2 = ObjCreate("HyCam2.Application")
        If @error Then Return SetError(@error, @extended, False) ; no good. fail out.
        If IsObj($oHyCam2) Then
            _HyCam2_Filename($oHyCam2, $sFileName)
            __HyCam2_Defaults($oHyCam2)
            Return $oHyCam2
        EndIf
    EndIf
EndFunc   ;==>_HyCam2_Open

And use this modified example:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.2
 Author:         willichan

 Script Function:
    Example use of HyCam2

#ce ----------------------------------------------------------------------------

#include "HyCam2.au3"

Local $oHyCam2 = _HyCam2_Open(@TempDir & "\HyCam2Demo.avi")
If Not IsObj($oHyCam2) Then
    MsgBox(0, 'ERROR', 'Can not create object.')
    Exit
EndIf

_HyCam2_Record($oHyCam2)
Sleep(20000)
_HyCam2_Stop($oHyCam2)

_HyCam2_Close($oHyCam2)
ShellExecute(@TempDir & "\HyCam2Demo.avi")

MsgBox(0,"HyCam2","Click OK to delete AVI file and close")
FileDelete(@TempDir & "\HyCam2Demo.avi")

So I get MsgBox dialog: "Can not create object." 
I have some problem with registering object .

Solution: Run this once as Admin to register ActiveX control.

 

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
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 API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer 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 * Best coding practices * 

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) * 

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: 2017-06-04

Share this post


Link to post
Share on other sites

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
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 API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer 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 * Best coding practices * 

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) * 

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: 2017-06-04

Share this post


Link to post
Share on other sites

Version 1.0.2 is updated in the downloads area.  This is a minor tweak, as recommended by mLipok.

Share this post


Link to post
Share on other sites

Also here you forgot to declare scope for this variable:
 

Func __HyCam2_Register()
    Local $sExePath = __HyCam2_ExePath()


Modified example:
 

#cs ----------------------------------------------------------------------------
    AutoIt Version: 3.3.14.2
    Author:         mLipok

    Script Function:
    Example use of HyCam2
#ce ----------------------------------------------------------------------------

#include "HyCam2.au3"
#include <MsgBoxConstants.au3>
#include <Misc.au3>

_Example()

Func _Example()

    ; create object
    Local $oHyCam2 = _HyCam2_Open(@ScriptDir & "\HyCam2Demo.avi")
    If Not IsObj($oHyCam2) Then
        MsgBox($MB_ICONWARNING, 'ERROR', 'Can not create object.')
        Exit
    EndIf

    ; start recording
    _HyCam2_Record($oHyCam2)

    ; wait for user end recording - press Pause Key to exit loop >> in order to end recording
    Local $hDLL = DllOpen("user32.dll")
    Do
    Until _IsPressed('13', $hDLL)
    DllClose($hDLL)

    ; stop recording and close object
    _HyCam2_Close($oHyCam2)

    ; show results
    ShellExecute(@ScriptDir & "\HyCam2Demo.avi")

    ; finalizing - CleanUp ?
    If $IDYES = MsgBox($MB_YESNO, "HyCam2", "Click [YES] to delete AVI file and close") Then
        FileDelete(@ScriptDir & "\HyCam2Demo.avi")
    EndIf
EndFunc   ;==>_Example

 


Remark:
I'm using Windows 10 and my Windows Media Player is not able to display this AVI files ( there is lack of  codecs ) .
Because of this I'm using VLC Media Player to view recorded AVI file.



Some reference:

http://www.hyperionics.com/hc2/faqs.asp

http://www.hyperionics.com/hc2/ScreenRecording.htm
 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
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 API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer 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 * Best coding practices * 

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) * 

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: 2017-06-04

Share this post


Link to post
Share on other sites

@mLipok

I found that variable scope issue here too.  I have not had a chance to upload the fix yet though.  I am writing new versions of _HyCam2_Open() and _HyCam2_Register() that will not require the software to be pre-installed.

Thank you for the help!

Share this post


Link to post
Share on other sites

that will not require the software to be pre-installed.

?

Do you mean HyCam preinstalled?


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
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 API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer 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 * Best coding practices * 

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) * 

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: 2017-06-04

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

That is correct (or will be after the modifications).

The UDF will first look to see if HyCam2 is installed on the PC, and will use that copy if it is there.  If it is not there, then it will register the application files in a HyCam2 folder under the @ScriptDir if present.  If not found in either location, then it will return an error.

I am debating whether it is desirable to have the option to specify a path.  I haven't decided yet.

I am also adding a Func to 'de-register' the HyCam2 automation server if desired.

Edited by willichan
clarification

Share this post


Link to post
Share on other sites

Version 1.1
Standardized parameter names
Modified __HyCam2_Register() to use a copy of HyCam2 in a local subdirectory if it exists, if HyCam2 is not installed on the current PC. Fixed variable scope declaration.
Added _HyCam2_AddClickStarbursts()
Added _HyCam2_IncrementFileName()
Added _HyCam2_LeftClickStarColor()
Added _HyCam2_RecordCursor()
Added _HyCam2_RightClickStarColor()
Added _HyCam2_StarburstFrames()
Added _HyCam2_StarburstSize()
Updated __HyCam2_Defaults() for new functions

Share this post


Link to post
Share on other sites

Thank you willichan! Great UDF!

I did run into one problem. Conditions were as follows:

  • Windows 10 64bit
  • An uninstalled 32bit copy of HyCam2 v.2.29.1.0
  • Running the example script and udf from the same directory as the HyCam2 binary.
  • After running "HyCam2 -regonly" from an Administrative command promt.

Problem: The location of the HyCam2.exe is not recorded in the registry in either of the places the script looks for it. I made the following work around that worked for me and should work on most machines but admittedly could be better:

Func __HyCam2_ExePath()
    Local $regquery = Run(@ComSpec & " /c " & 'REG QUERY HKLM\SOFTWARE /s /f "*\HyCam2.exe"', "", @SW_HIDE, $STDOUT_CHILD)
    ProcessWaitClose($regquery)
    Local $sOutput = StdoutRead($regquery)
    Local $place = ""
    $place = StringInStr($sOutput, "\HyCam2.exe")
    If $place Then
        $sOutput = StringTrimRight($sOutput, StringLen($sOutput) - ($place + 10))
        Local $tabPlace = ""
        $tabPlace = StringInStr($sOutput, "    ", 0, -1)
        If $tabPlace Then
            $sOutput = StringTrimLeft($sOutput, $tabPlace + 3)
            If FileExists($sOutput) Then
                ConsoleWrite(@CRLF & $regquery & " FILE EXISTS! SUCCESS")
                Return $sOutput
            EndIf
        EndIf
    EndIf
    Return False
EndFunc

Note: this does require a few seconds to run.

Main thing is, great UDF, it's going to help me out alot! Thank again!

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Did you try the latest version?

If you put the HyCam2 files into a subfolder under you script folder called HyCam2, it will register and use that copy if it doesn't find the registry entries for an "installed" HyCam2.

Glad you like the UDF.

Edited by willichan

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

  • Similar Content

    • willichan
      By willichan
      Automation for HyCam2 screen recording utility.