neazoi

Autoit v 3.3.8.1 cannot find MsgBoxConstants

5 posts in this topic

Hi I have installed autoit v 3.3.8.1 (because I want my programs to run on win2k?) and when I try to compile my script to exe it popups a message saying that it cannot find #include <MsgBoxConstants.au3>

What is the problem?

Share this post


Link to post
Share on other sites



This include file has been implemented with a later version of AutoIt (3.3.12.0?).

Either use the magic numbers as described in the help file for 3.3.8.1 or copy the include file from a 3.3.12.0 installation or upgrade to 3.3.12.0 (in this case make sure to read the Script Breaking Changes section in the help file!).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Update

I have corrected it by copying msgboxconstants into the local script directory. For some reason it could not find it from the include folder

Share this post


Link to post
Share on other sites

They were added in v3.3.10.0 by Mat.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

They were added in v3.3.10.0 by Mat.

Hm... Now the program executes on win2k but it does not what it was intended to do...

my program code is below.

I do not know it it helps, but the data displayed in the window, when the endode button is pressed is only 36 chars long, the script does not continue. Maybe it has something to do with the Array.au3 which is included in the Zip.au3 ?

I would really appreciate some help or guiding lines of what is the problem in win2k

; ====================================================
; ============ DataText encoder/decoder ==============
; ====================================================
; Version: 1.0
; Language:       English
; Author:         "sv3ora"
; Website:        http://www.qrp.gr/datatext
;
; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------

#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ColorConstants.au3>
#include <String.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <Zip.au3>
#include <base32.au3>
#include <Crypt.au3>

_Main()


Func RestartScript()
      If @Compiled = 1 Then
         Run( FileGetShortName(@ScriptFullPath))
      Else
         Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
      EndIf
   Exit
EndFunc


Func _Main()
    ; Creates window
    $WinMain = GUICreate('DataText v1.0 by sv3ora', 570, 320)

    ; Creates main edit
    Local $idEditText = GUICtrlCreateEdit('', 5, 5, 560, 280)

    ; Create the buttons
    Local $idEncodeButton = GUICtrlCreateButton('Encode', 5, 290, 85, 25)
    Local $idDecodeButton = GUICtrlCreateButton('Decode', 96, 290, 85, 25)
    Local $idInfoButton = GUICtrlCreateButton('?', 545, 293, 20, 20)
    ; Creates the password box with blured and centered input
    Local $idInputPass = GUICtrlCreateInput('', 187, 290, 100, 24, BitOR($ES_CENTER, $ES_PASSWORD))
    ; Pass text label
    Local $idLabel = GUICtrlCreateLabel('     Password', 191, 294, 91, 17)
    ; Set the background color of the label Password.
    GUICtrlSetBkColor($idLabel, $COLOR_WHITE)
    ; Create the combo to select the crypting algorithm
    Local $idCombo = GUICtrlCreateCombo("", 291, 290, 88, 20, $CBS_DROPDOWNLIST)
    GUICtrlSetData($idCombo, "3DES|AES (128bit)|AES (192bit)|AES (256bit)|DES|RC2|RC4", "RC4")

    ; PROGRESS bar
    GUICtrlCreateProgress(453, 293, 85, 20)
    GUICtrlSetData(-1, 0)
    GUICtrlCreateLabel("Progress:", 387, 295)

    ; Shows window
    GUISetState()

    Local $iAlgorithm = $CALG_RC4
    Local $dEncrypted
    Local $dDecrypted
    Local $encodedDataZIP


    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop



            Case $idCombo ; Check when the combobox is selected and retrieve the correct algorithm.
                Switch GUICtrlRead($idCombo) ; Read the combobox selection.
                    Case "3DES"
                        $iAlgorithm = $CALG_3DES

                    Case "AES (128bit)"
                        $iAlgorithm = $CALG_AES_128

                    Case "AES (192bit)"
                        $iAlgorithm = $CALG_AES_192

                    Case "AES (256bit)"
                        $iAlgorithm = $CALG_AES_256

                    Case "DES"
                        $iAlgorithm = $CALG_DES

                    Case "RC2"
                        $iAlgorithm = $CALG_RC2

                    Case "RC4"
                        $iAlgorithm = $CALG_RC4

                EndSwitch












            Case $idEncodeButton
                ; When you press Encode

;;;;;;;;;;;;;; SELECT FILE TO ENCODE ;;;;;;;;;;;;;;;;
                ; Create a constant variable in Local scope of the message to display in FileOpenDialog.
               Local $sMessage = "Select file to encode."

               ; Display an open dialog to select a file.
               Local $sFileOpenDialog = FileOpenDialog($sMessage, @DesktopDir & "\", "Images (*.jpg;*.png;*.gif)|All files (*.*)", $FD_FILEMUSTEXIST + $FD_MULTISELECT)
               If @error Then
                  ; Display the error message.
                  MsgBox($MB_SYSTEMMODAL, "Error", "No file was selected!")
                  RestartScript()
                  ; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder.
                  FileChangeDir(@DesktopDir)
               Else
                  ; Change the working directory (@WorkingDir) back to the location of the script directory as FileOpenDialog sets it to the last accessed folder.
                  FileChangeDir(@DesktopDir)

                  ; Replace instances of "|" with @CRLF in the string returned by FileOpenDialog.
                  $sFileOpenDialog = StringReplace($sFileOpenDialog, "|", @CRLF)
               EndIf

;;;;;;;;;;;;;; COMPRESS SELECTED FILE ;;;;;;;;;;;;;;;;

               GUICtrlSetData($idEditText, "Wait for data processing. This may take a while...")

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 10)
               GUICtrlCreateLabel("Progress:", 387, 295)

               ;$sFileOpenDialog2 is the tmp.zip file and its path
               Local $sFileOpenDialog2 = @TempDir&"\tmp.zip"

               ;compress the file selected
               ;First check if tmp.zip file exists
                Local $iFileExists = FileExists($sFileOpenDialog2)
                Local $Zip
                ; Display a message of whether the file exists or not.
                If $iFileExists Then
                    _Zip_AddFile(@TempDir & "\tmp.zip", $sFileOpenDialog) ;add chosen file ($sFileOpenDialog) to the zip archive
                Else
                    $Zip = _Zip_Create(@TempDir & "\tmp.zip") ;Create The Zip File. Returns a Handle to the zip File
                    _Zip_AddFile(@TempDir & "\tmp.zip", $sFileOpenDialog) ;add chosen file ($sFileOpenDialog) to the zip archive
                 EndIf
                 ;Close the temporary tmp.zip file
                 FileClose($Zip)

                 ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 20)
               GUICtrlCreateLabel("Progress:", 387, 295)

;;;;;;;;;;;;;; READ COMPRESSED FILE ;;;;;;;;;;;;;;;;
                  ; Open the tmp.zip file for reading and store the handle to a variable.
                  Local $sFileOpen = FileOpen($sFileOpenDialog2, $FO_READ)
                     If $sFileOpen = -1 Then
                        MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
                        Return False
                     EndIf

                  ; Read the contents of the tmp.zip file using the handle returned by FileOpen.
                  Local $dataZIP = FileRead($sFileOpen)

                  ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 40)
               GUICtrlCreateLabel("Progress:", 387, 295)

                  ;Close the temporary tmp.zip file
                  FileClose($sFileOpen)

                  ; Delete the temporary tmp.zip file.
                  FileDelete($sFileOpenDialog2)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 60)
               GUICtrlCreateLabel("Progress:", 387, 295)


               ;If the password box is empty, do not use encryption
               If GuiCtrlRead($idInputPass) = "" Then
                  ;Encode the contents of the non encrypted variable to zbase32
                  $encodedDataZIP = _Base32_Encode($dataZIP)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 80)
               GUICtrlCreateLabel("Progress:", 387, 295)

               ;If password box is not empty then use encryption
               Else
                  ; Calls the encryption.
                $dEncrypted = _Crypt_EncryptData($dataZIP, GUICtrlRead($idInputPass), $iAlgorithm) ; Encrypt the text with the new cryptographic key.

                  ;Encode the contents of the encrypted variable to zbase32
                  $encodedDataZIP = _Base32_Encode($dEncrypted)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 80)
               GUICtrlCreateLabel("Progress:", 387, 295)
               EndIf

;;;;;;;;;;;;;; DISPLAY ENCODED DATA ;;;;;;;;;;;;;;;;
                  ; Put encoded data to text box
                  GUICtrlSetData($idEditText, $encodedDataZIP)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 100)
               GUICtrlCreateLabel("Progress:", 387, 295)

                  ;wait a bit
                  Sleep(1000)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 0)
               GUICtrlCreateLabel("Progress:", 387, 295)
















            Case $idDecodeButton
                ; When you press Decode

               ; Saves the editbox for later
                $textTodecode = GUICtrlRead($idEditText)

               ; Friendly message to the text box
                GUICtrlSetData($idEditText, 'Wait for data processing. This may take a while...')

                ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 10)
               GUICtrlCreateLabel("Progress:", 387, 295)


               ;DECRYPT DECODED DATA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
               ;If the password box is empty, do not use encryption
               If GuiCtrlRead($idInputPass) = "" Then
                  ;Encode the contents of the non encrypted variable to zbase32
                  $decodedDataZIP = _Base32_Decode($textTodecode)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 20)
               GUICtrlCreateLabel("Progress:", 387, 295)

               ;If password box is not empty then use decryption
               Else

                  ;Decode the contents of the variable to zbase32
                  Local $decodedData = _Base32_Decode($textTodecode)

                  ; Calls the decryption.
                $decodedDataZIP = _Crypt_DecryptData($decodedData, GUICtrlRead($idInputPass), $iAlgorithm) ; Encrypt the text with the new cryptographic key.

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 20)
               GUICtrlCreateLabel("Progress:", 387, 295)
            EndIf

;;;;;;;;;;;;;; WRITE DECODED AND/OR DECRYPTED DATA TO ZIP FILE ;;;;;;;;;;;;;;;;

               ;$theTMPfile is the tmp zip file and its path
               Local $theTMPfile = @TempDir&"\tmp2.zip"

               ; Open the file for writing (append to the end of a file) and store the handle to a variable.
               Local $rFileOpen = FileOpen($theTMPfile, $FO_OVERWRITE)
                  If $rFileOpen = -1 Then
                     MsgBox($MB_SYSTEMMODAL, "", "An error occurred when writing to the file.")
                     Return False
                  EndIf

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 40)
               GUICtrlCreateLabel("Progress:", 387, 295)

               ; Write data to the file using the handle returned by FileOpen.
               FileWrite($rFileOpen, $decodedDataZIP)

               ; Close the handle returned by FileOpen.
               FileClose($rFileOpen)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 60)
               GUICtrlCreateLabel("Progress:", 387, 295)

;;;;;;;;;;;;;; UNZIP THE ZIP FILE ;;;;;;;;;;;;;;;;
               _Zip_UnzipAll($theTMPfile, @ScriptDir)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 80)
               GUICtrlCreateLabel("Progress:", 387, 295)

               ; Delete the temporary tmp.zip file.
                FileDelete($theTMPfile)

               ; Put initial encoded data to text box
               GUICtrlSetData($idEditText, $textTodecode)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 100)
               GUICtrlCreateLabel("Progress:", 387, 295)

               ;wait a bit
                  Sleep(1000)

               ; PROGRESS bar
               GUICtrlCreateProgress(453, 293, 85, 20)
               GUICtrlSetData(-1, 0)
               GUICtrlCreateLabel("Progress:", 387, 295)









            Case $idInfoButton
               ;When you press ?

               ; Info message to the text box
                GUICtrlSetData($idEditText, "DataText by sv3ora."&@crlf&"Conversion of file to text and text to file."&@crlf&@crlf&"This program can be used to transfer data"&@crlf&"through any radio amateur digital mode (including CW)"&@crlf&"that supports text-only transmission"&@crlf&@crlf&"To encode a file:"&@crlf&"1. Click 'Encode' to select the file to encode."&@crlf&"2. Select all encoded text (right click) and copy it."&@crlf&"3. Paste this text to your favorite sending program."&@crlf&"If you want to password protect your file, enter a password and select the"&@crlf&"encryption algorithm from the drop down list, prior to clicking the encode button."&@crlf&@crlf&"To decode a text:"&@crlf&"1. Copy the text to decode from your favorite receiving"&@crlf&"     program and paste it into this text box."&@crlf&"2. Click 'Decode' to decode this text."&@crlf&"3. The decoded file will be placed at the same directory"&@crlf&"     as the DataText program."&@crlf&"If the received data has been password protected, then you have to enter the"&@crlf&"password and select the encryption algorithm from the drop down list,"&@crlf&"prior to clicking the decode button."&@crlf&@crlf&"More info about DataText at:  http://www.qrp.gr/datatext"&@crlf&"Comments and suggestions at:  sv3ora@qrp.gr")

        EndSwitch
    WEnd
EndFunc   ;==>_Main
 

Edited by neazoi

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