Jump to content

HyCam2


willichan
 Share

Recommended Posts

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.

Link to comment
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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor 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 * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

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 * SciTE - Lexer for console pane

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 * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

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 TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

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 *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"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: 2023-04-24

Link to comment
Share on other sites

Link to comment
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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor 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 * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

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 * SciTE - Lexer for console pane

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 * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

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 TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

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 *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"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: 2023-04-24

Link to comment
Share on other sites

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor 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 * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

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 * SciTE - Lexer for console pane

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 * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

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 TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

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 *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"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: 2023-04-24

Link to comment
Share on other sites

Link to comment
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:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor 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 * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

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 * SciTE - Lexer for console pane

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 * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

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 TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

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 *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"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: 2023-04-24

Link to comment
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!

Link to comment
Share on other sites

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

?

Do you mean HyCam preinstalled?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor 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 * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

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 * SciTE - Lexer for console pane

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 * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

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 TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

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 *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"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: 2023-04-24

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 1 year later...

Willichan, please update your source code. There are many errors.

Func _HyCam2_LeftClickStarColor(ByRef $oHyCam2, $iRed = Default, $iGreen = Default, $iBlue = Default)
    If ($iRed <> Default) Or ($iGreen <> Default) Or ($iBlue <> Default) Then
.......
    Return __HyCam2_ColorFix($oHyCam2.LeftClickStarColor)
EndIf<==== !!!!
Func _HyCam2_RightClickStarColor(ByRef $oHyCam2, $iRed = Default, $iGreen = Default, $iBlue = Default)
    If ($iRed <> Default) Or ($iGreen <> Default) Or ($iBlue <> Default) Then
....
    Return __HyCam2_ColorFix($oHyCam2.RightClickStarColor)
EndIf<====!!!!!

And

_HyCam2_StarburstFrames($oHyCam2, 3) not working

"C:\Program Files (x86)\AutoIt3\Include\HyCam2.au3" (605) : ==> The requested action with this object has failed.:
Return $oHyCam2.StarburstFrames
Return $oHyCam2^ ERROR

 

Link to comment
Share on other sites

On 11/17/2017 at 7:24 AM, duzers said:
Func _HyCam2_LeftClickStarColor(ByRef $oHyCam2, $iRed = Default, $iGreen = Default, $iBlue = Default)
    If ($iRed <> Default) Or ($iGreen <> Default) Or ($iBlue <> Default) Then
.......
    Return __HyCam2_ColorFix($oHyCam2.LeftClickStarColor)
EndIf<==== !!!!
Func _HyCam2_RightClickStarColor(ByRef $oHyCam2, $iRed = Default, $iGreen = Default, $iBlue = Default)
    If ($iRed <> Default) Or ($iGreen <> Default) Or ($iBlue <> Default) Then
....
    Return __HyCam2_ColorFix($oHyCam2.RightClickStarColor)
EndIf<====!!!!!

And

_HyCam2_StarburstFrames($oHyCam2, 3) not working

 

Wow.  Now that is embarrassing.

I am not sure how the EndFunc got changed to EndIf before I uploaded the code, but that is just downright embarrassing.  I just fixed it, and will upload the patched version in a few minutes.

As far as StarburstFrames goes, I did not use that one myself.  I just added that function to complete the non-UI functions.  It appears it does not work as documented, so I have removed it.

 

 

Link to comment
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
 Share

×
×
  • Create New...