Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/10/2014 in all areas

  1. AutoIt Portable Workstation AIP allows you to carry a light AutoIt script editor and compiler with you to use on the fly. This program can run x86 and x64 scripts or compile them to EXE. When the program is launched, it will create a temp work folder in the script directory. Once the program is closed this folder will be automatically deleted. When you compile a script it will output in the the script directory in a folder named "compiled". Current version: 0.0.2 Version 0.0.2 updates: Added more options to the comiler Planned Updates: Script editor font appearance. Automaticly color coded tags in editor Built In Includes: APIComConstants.au3 APIConstants.au3 APIDiagConstants.au3 APIDlgConstants.au3 APIErrorsConstants.au3 APIFilesConstants.au3 APIGdiConstants.au3 APILocaleConstants.au3 APIMiscConstants.au3 APIProcConstants.au3 APIRegConstants.au3 APIResConstants.au3 APIShellExConstants.au3 APIShPathConstants.au3 APISysConstants.au3 APIThemeConstants.au3 Array.au3 AutoItConstants.au3 AVIConstants.au3 BorderConstants.au3 ButtonConstants.au3 Clipboard.au3 Color.au3 ColorConstants.au3 ComboConstants.au3 Constants.au3 Crypt.au3 Date.au3 DateTimeConstants.au3 Debug.au3 DirConstants.au3 EditConstants.au3 EventLog.au3 Excel.au3 ExcelConstants.au3 File.au3 FileConstants.au3 FontConstants.au3 FrameConstants.au3 FTPEx.au3 GDIPlus.au3 GDIPlusConstants.au3 GuiAVI.au3 GuiButton.au3 GuiComboBox.au3 GuiComboBoxEx.au3 GUIConstants.au3 GUIConstantsEx.au3 GuiDateTimePicker.au3 GuiEdit.au3 GuiHeader.au3 GuiImageList.au3 GuiIPAddress.au3 GuiListBox.au3 GuiListView.au3 GuiMenu.au3 GuiMonthCal.au3 GuiReBar.au3 GuiRichEdit.au3 GuiScrollBars.au3 GuiSlider.au3 GuiStatusBar.au3 GuiTab.au3 GuiToolbar.au3 GuiToolTip.au3 GuiTreeView.au3 HeaderConstants.au3 IE.au3 ImageListConstants.au3 Inet.au3 InetConstants.au3 IPAddressConstants.au3 ListBoxConstants.au3 ListViewConstants.au3 Math.au3 Memory.au3 MemoryConstants.au3 MenuConstants.au3 Misc.au3 MsgBoxConstants.au3 NamedPipes.au3 NetShare.au3 NTSTATUSConstants.au3 Process.au3 ProcessConstants.au3 ProgressConstants.au3 RebarConstants.au3 RichEditConstants.au3 ScreenCapture.au3 ScrollBarConstants.au3 ScrollBarsConstants.au3 Security.au3 SecurityConstants.au3 SendMessage.au3 SliderConstants.au3 Sound.au3 SQLite.au3 SQLite.dll.au3 StaticConstants.au3 StatusBarConstants.au3 String.au3 StringConstants.au3 StructureConstants.au3 TabConstants.au3 Timers.au3 ToolbarConstants.au3 ToolTipConstants.au3 TrayConstants.au3 TreeViewConstants.au3 UDFGlobalID.au3 UpDownConstants.au3 Visa.au3 WinAPI.au3 WinAPICom.au3 WinAPIConstants.au3 WinAPIDiag.au3 WinAPIDlg.au3 WinAPIError.au3 WinAPIEx.au3 WinAPIFiles.au3 WinAPIGdi.au3 WinAPIInternals.au3 WinAPIlangConstants.au3 WinAPILocale.au3 WinAPIMisc.au3 WinAPIProc.au3 WinAPIReg.au3 WinAPIRes.au3 WinAPIShellEx.au3 WinAPIShPath.au3 WinAPISys.au3 WinAPIsysinfoConstants.au3 WinAPITheme.au3 WinAPIvkeysConstants.au3 WindowsConstants.au3 WinNet.au3 Word.au3 WordConstants.au3 Source Code: #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\AIP\Icon.ico #AutoIt3Wrapper_Res_Description=Compile your AutoIt scripts on the fly! #AutoIt3Wrapper_Res_Fileversion=0.0.2.0 #AutoIt3Wrapper_Res_LegalCopyright=Copyright 2014 zelles #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <File.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region Begin Startup Settings _Singleton("AutoItPortableByzelles") Opt("GUIOnEventMode", 1) Opt("TrayMenuMode", 3) #EndRegion End Startup Settings #Region Begin Startup Globals Global $DIR_complier_output = @ScriptDir & "\compiled" Global $DIR_TEMP = @ScriptDir & "\temp_appdata" Global $DIR_includes = $DIR_TEMP & "\includes" Global $FILE_icon = $DIR_TEMP & "\Icon.ico" Global $FILE_TEMP = $DIR_includes & "\aip_temp.au3" Global $FILE_TEMP_EXE = $DIR_TEMP & "\aip_temp.exe" Global $IMG_Splash = $DIR_TEMP & "\splash.gif" Global $Last_Opened = "AIPScript.au3" #EndRegion End Startup Globals #Region Begin Startup Functions GUI_Splash() Create_Temp_Workstation() GUIDelete($GUI_Splash) GUI_Workstation() #EndRegion End Startup Functions #Region Begin Idle Loop To Keep Program Alive While 1 Sleep(100) WEnd #EndRegion End Idle Loop To Keep Program Alive #Region Begin Splash GUI Creation Func GUI_Splash() If Not FileExists($DIR_TEMP) Then DirCreate($DIR_TEMP) FileInstall("C:\AIP\splash.gif", $DIR_TEMP & "\splash.gif", 0) Global $GUI_Splash = GUICreate("Starting AutoIt Portable", 401, 257, 192, 124) GUISetBkColor(0xFFFFFF) Global $splash_image = GUICtrlCreatePic($IMG_Splash, 0, 0, 400, 250) GUISetOnEvent($GUI_EVENT_MINIMIZE, "Close_Spash", $GUI_Splash) GUISetOnEvent($GUI_EVENT_CLOSE, "Close_Spash", $GUI_Splash) GUISetState(@SW_SHOW) EndFunc #EndRegion End Splash GUI Creation #Region Begin Workstation GUI Creation Func GUI_Workstation() Global $GUI_Workstation = GUICreate("AutoIt Portable Workstation", 701, 431, 174, 115) Global $File_Menu_File = GUICtrlCreateMenu("&File") Global $File_Menu_New = GUICtrlCreateMenuItem("New File", $File_Menu_File) Global $File_Menu_Open = GUICtrlCreateMenuItem("Open File", $File_Menu_File) Global $File_Menu_Save = GUICtrlCreateMenuItem("Save File", $File_Menu_File) Global $File_Menu_Exit = GUICtrlCreateMenuItem("Exit", $File_Menu_File) Global $File_Menu_Options = GUICtrlCreateMenu("&Script Options") Global $File_Menu_Runx86 = GUICtrlCreateMenuItem("Run x86", $File_Menu_Options) Global $File_Menu_Runx64 = GUICtrlCreateMenuItem("Run x64", $File_Menu_Options) Global $File_Menu_Compiler = GUICtrlCreateMenuItem("Run Compiler", $File_Menu_Options) Global $File_Menu_Help = GUICtrlCreateMenu("&Help") Global $File_Menu_About = GUICtrlCreateMenuItem("About", $File_Menu_Help) Global $GUI_Workstation_WorkArea = GUICtrlCreateEdit('MsgBox(0, "Welcome Note:", "Thank you for using AutoIt Portable!")', 0, 0, 700, 409, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetOnEvent($File_Menu_New, "GUI_File_New") GUICtrlSetOnEvent($File_Menu_Open, "GUI_File_Open") GUICtrlSetOnEvent($File_Menu_Save, "GUI_File_Save") GUICtrlSetOnEvent($File_Menu_Exit, "Close_Workstation") GUICtrlSetOnEvent($File_Menu_Runx86, "GUI_Run_x86") GUICtrlSetOnEvent($File_Menu_Runx64, "GUI_Run_x64") GUICtrlSetOnEvent($File_Menu_Compiler, "GUI_Compiler") GUICtrlSetOnEvent($File_Menu_About, "GUI_About") GUISetOnEvent($GUI_EVENT_CLOSE, "Close_Workstation", $GUI_Workstation) GUISetState(@SW_SHOW, $GUI_Workstation) EndFunc #EndRegion End Workstation GUI Creation #Region Begin Compiler GUI Creation Func GUI_Compiler() Global $GUI_Compiler = GUICreate("AICompiler GUI", 234, 447, 325, 143) Local $GUI_Compiler_Label1 = GUICtrlCreateLabel("App Name:", 8, 11, 57, 17) Local $GUI_Compiler_Label2 = GUICtrlCreateLabel("App Icon:", 8, 35, 50, 17) Local $GUI_Compiler_Label3 = GUICtrlCreateLabel("Product Name:", 8, 59, 75, 17) Local $GUI_Compiler_Label4 = GUICtrlCreateLabel("Company Name:", 8, 83, 82, 17) Local $GUI_Compiler_Label5 = GUICtrlCreateLabel("Copyright:", 8, 107, 51, 17) Local $GUI_Compiler_Label6 = GUICtrlCreateLabel("Trademarks:", 8, 131, 63, 17) Local $GUI_Compiler_Label7 = GUICtrlCreateLabel("File Version:", 8, 155, 61, 17) Local $GUI_Compiler_Label8 = GUICtrlCreateLabel("Product Version:", 8, 179, 82, 17) Local $GUI_Compiler_Label9 = GUICtrlCreateLabel("Description:", 8, 203, 60, 17) Local $GUI_Compiler_Label10 = GUICtrlCreateLabel("Comment:", 8, 227, 51, 17) Local $GUI_Compiler_Label11 = GUICtrlCreateLabel("Ignore Directives:", 8, 251, 87, 17) Local $GUI_Compiler_Label12 = GUICtrlCreateLabel("Compile For:", 8, 275, 62, 17) Local $GUI_Compiler_Label13 = GUICtrlCreateLabel("Compression:", 8, 299, 67, 17) Local $GUI_Compiler_Label14 = GUICtrlCreateLabel("Comp. w/ UPX:", 8, 323, 78, 17) Local $GUI_Compiler_Label15 = GUICtrlCreateLabel("Execution Level:", 8, 347, 83, 17) Local $GUI_Compiler_Label16 = GUICtrlCreateLabel("Compatibility:", 8, 371, 65, 17) Local $GUI_Compiler_Label17 = GUICtrlCreateLabel("App Type:", 8, 395, 53, 17) Global $GUI_Compiler_OutputFile = GUICtrlCreateInput("My App", 72, 8, 153, 21) Global $GUI_Compiler_IconFile = GUICtrlCreateInput($FILE_icon, 72, 32, 105, 21) Global $GUI_Compiler_LoadIcon_Button = GUICtrlCreateButton("Load", 184, 32, 43, 21) Global $GUI_Compiler_ProductName = GUICtrlCreateInput("", 88, 56, 137, 21) Global $GUI_Compiler_CompanyName = GUICtrlCreateInput("", 88, 80, 137, 21) Global $GUI_Compiler_Copyright = GUICtrlCreateInput("", 72, 104, 153, 21) Global $GUI_Compiler_Trademarks = GUICtrlCreateInput("", 72, 128, 153, 21) Global $GUI_Compiler_FileVersion = GUICtrlCreateInput("", 88, 152, 137, 21) Global $GUI_Compiler_ProductVersion = GUICtrlCreateInput("", 88, 176, 137, 21) Global $GUI_Compiler_Description = GUICtrlCreateInput("", 72, 200, 153, 21) Global $GUI_Compiler_Comment = GUICtrlCreateInput("", 72, 224, 153, 21) Global $GUI_Compiler_IgnoreDirectives = GUICtrlCreateCheckbox("Ignore", 120, 248, 65, 17) Global $GUI_Compiler_x86 = GUICtrlCreateCheckbox("x86", 120, 273, 49, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global $GUI_Compiler_x64 = GUICtrlCreateCheckbox("x64", 176, 273, 49, 17) Global $GUI_Compiler_Compression = GUICtrlCreateCombo("None", 88, 296, 137, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($GUI_Compiler_Compression, "Low|Medium|High|Highest", "None") Global $GUI_Compiler_UPXCompression = GUICtrlCreateCombo("Dont Compress", 88, 320, 137, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($GUI_Compiler_UPXCompression, "Compress", "Dont Compress") Global $GUI_Compiler_ExecutionLevel = GUICtrlCreateCombo("None", 88, 344, 137, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($GUI_Compiler_ExecutionLevel, "AsInvoker|Highest Avail|Require Admin", "None") Global $GUI_Compiler_Compatibility = GUICtrlCreateCombo("All", 88, 368, 137, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($GUI_Compiler_Compatibility, "Windows Vista|Windows 7|Windows 8", "All") Global $GUI_Compiler_AppType = GUICtrlCreateCombo("Default", 88, 392, 137, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($GUI_Compiler_AppType, "GUI|Console", "Default") Global $GUI_Compiler_Compile_Button = GUICtrlCreateButton("Compile", 136, 416, 91, 25) GUICtrlSetOnEvent($GUI_Compiler_LoadIcon_Button, "Compiler") GUICtrlSetOnEvent($GUI_Compiler_Compile_Button, "Compiler") GUISetOnEvent($GUI_EVENT_CLOSE, "Close_Compiler", $GUI_Compiler) GUISetState(@SW_SHOW, $GUI_Compiler) EndFunc #EndRegion End Compiler GUI Creation #Region Begin Splash GUI Events Func Close_Spash() TrayTip("AIP Response", "Please wait for AIP to finish initializing", 6) EndFunc #EndRegion End Splash GUI Creation #Region Begin Workstation GUI Events Func GUI_File_New() GUICtrlSetData($GUI_Workstation_WorkArea, "") EndFunc Func GUI_File_Open() Local $f_open_script = FileOpenDialog("Open AutoIt Script", @ScriptDir, "au3 (*.au3)|All (*.*)", 1, $Last_Opened, $GUI_Workstation) $Last_Opened = StringTrimLeft($f_open_script, StringInStr($f_open_script, "\", $STR_NOCASESENSE, -1)) Local $f_open_script_Script = FileRead($f_open_script) GUICtrlSetData($GUI_Workstation_WorkArea, $f_open_script_Script) EndFunc Func GUI_File_Save() Local $f_save_script = FileSaveDialog("Save AutoIt Script", @ScriptDir, "au3 (*.au3)|All (*.*)", 0, $Last_Opened, $GUI_Workstation) $Last_Opened = StringTrimLeft($f_save_script, StringInStr($f_save_script, "\", $STR_NOCASESENSE, -1)) Local $f_script = GUICtrlRead($GUI_Workstation_WorkArea) If FileExists($f_save_script) Then FileDelete($f_save_script) _FileCreate($f_save_script) Local $f_save_script_Open = FileOpen($f_save_script, $FO_APPEND) FileWrite($f_save_script_Open, $f_script) FileClose($f_save_script_Open) EndFunc Func GUI_Run_x86() Local $f_script = GUICtrlRead($GUI_Workstation_WorkArea) If FileExists($FILE_TEMP_EXE) Then FileDelete($FILE_TEMP_EXE) If FileExists($FILE_TEMP) Then FileDelete($FILE_TEMP) _FileCreate($FILE_TEMP) Local $FILE_TEMP_Open = FileOpen($FILE_TEMP, $FO_APPEND) FileWrite($FILE_TEMP_Open, $f_script) FileClose($FILE_TEMP_Open) RunWait($DIR_TEMP & '/Aut2exe.exe /in "' & $FILE_TEMP & '" /out "' & $FILE_TEMP_EXE & '" /icon "' & $FILE_icon & '" /comp 0 /nopack /x86') FileDelete($FILE_TEMP) Run($FILE_TEMP_EXE) EndFunc Func GUI_Run_x64() Local $f_script = GUICtrlRead($GUI_Workstation_WorkArea) If FileExists($FILE_TEMP_EXE) Then FileDelete($FILE_TEMP_EXE) If FileExists($FILE_TEMP) Then FileDelete($FILE_TEMP) _FileCreate($FILE_TEMP) Local $FILE_TEMP_Open = FileOpen($FILE_TEMP, $FO_APPEND) FileWrite($FILE_TEMP_Open, $f_script) FileClose($FILE_TEMP_Open) RunWait($DIR_TEMP & '/Aut2exe.exe /in "' & $FILE_TEMP & '" /out "' & $FILE_TEMP_EXE & '" /icon "' & $FILE_icon & '" /comp 0 /nopack /x64') FileDelete($FILE_TEMP) Run($FILE_TEMP_EXE) EndFunc Func GUI_About() MsgBox(0, "About AIP", "AutoIt Portable was made by zelles to help people who need AutoIt on the fly." & @CRLF & "Currently running version: 0.0.1") EndFunc Func Close_Workstation() GUIDelete($GUI_Workstation) If FileExists($DIR_TEMP) Then DirRemove($DIR_TEMP, 1) Exit EndFunc #EndRegion End Workstation GUI Events #Region Begin Compiler GUI Events Func Compiler($f_data) ; Unintergrated commands: /ansi /unicode /originalfilename "" /internalname "" If Not FileExists($DIR_complier_output) Then DirCreate($DIR_complier_output) Local $f_script = GUICtrlRead($GUI_Workstation_WorkArea) If FileExists($FILE_TEMP) Then FileDelete($FILE_TEMP) _FileCreate($FILE_TEMP) Local $FILE_TEMP_Open = FileOpen($FILE_TEMP, $FO_APPEND) FileWrite($FILE_TEMP_Open, $f_script) FileClose($FILE_TEMP_Open) Local $Compiler_Script_x86 = $DIR_TEMP & '/Aut2exe.exe' Local $Compiler_Script_x64 = $DIR_TEMP & '/Aut2exe.exe' $Compiler_Script_x86 &= ' /in "' & $FILE_TEMP & '"' $Compiler_Script_x64 &= ' /in "' & $FILE_TEMP & '"' Local $f_OutputFile = GUICtrlRead($GUI_Compiler_OutputFile) $Compiler_Script_x86 &= ' /out "' & $DIR_complier_output & '\' & $f_OutputFile & ' x86.exe"' $Compiler_Script_x64 &= ' /out "' & $DIR_complier_output & '\' & $f_OutputFile & ' x64.exe"' Switch GUICtrlRead($GUI_Compiler_IconFile) Case "" $Compiler_Script_x86 &= ' /icon "' & $FILE_icon & '"' $Compiler_Script_x64 &= ' /icon "' & $FILE_icon & '"' Case Else If FileExists(GUICtrlRead($GUI_Compiler_IconFile)) Then $Compiler_Script_x86 &= ' /icon "' & GUICtrlRead($GUI_Compiler_IconFile) & '"' $Compiler_Script_x64 &= ' /icon "' & GUICtrlRead($GUI_Compiler_IconFile) & '"' Else $Compiler_Script_x86 &= ' /icon "' & $FILE_icon & '"' $Compiler_Script_x64 &= ' /icon "' & $FILE_icon & '"' EndIf EndSwitch $Compiler_Script_x86 &= ' /x86' $Compiler_Script_x64 &= ' /x64' Switch GUICtrlRead($GUI_Compiler_Compression) Case "None" $Compiler_Script_x86 &= ' /comp 0' $Compiler_Script_x64 &= ' /comp 0' Case "Low" $Compiler_Script_x86 &= ' /comp 1' $Compiler_Script_x64 &= ' /comp 1' Case "Medium" $Compiler_Script_x86 &= ' /comp 2' $Compiler_Script_x64 &= ' /comp 2' Case "High" $Compiler_Script_x86 &= ' /comp 3' $Compiler_Script_x64 &= ' /comp 3' Case "Highest" $Compiler_Script_x86 &= ' /comp 4' $Compiler_Script_x64 &= ' /comp 4' EndSwitch Switch GUICtrlRead($GUI_Compiler_IgnoreDirectives) Case $GUI_CHECKED $Compiler_Script_x86 &= ' /ignoredirectives' $Compiler_Script_x64 &= ' /ignoredirectives' EndSwitch Switch GUICtrlRead($GUI_Compiler_UPXCompression) Case "Dont Compress" $Compiler_Script_x86 &= ' /nopack' $Compiler_Script_x64 &= ' /nopack' Case "Compress" $Compiler_Script_x86 &= ' /pack' $Compiler_Script_x64 &= ' /pack' EndSwitch Switch GUICtrlRead($GUI_Compiler_AppType) Case "GUI" $Compiler_Script_x86 &= ' /gui' $Compiler_Script_x64 &= ' /gui' Case "Console" $Compiler_Script_x86 &= ' /console' $Compiler_Script_x64 &= ' /console' EndSwitch Switch GUICtrlRead($GUI_Compiler_ExecutionLevel) Case "None" $Compiler_Script_x86 &= ' /execlevel none' $Compiler_Script_x64 &= ' /execlevel none' Case "AsInvoker" $Compiler_Script_x86 &= ' /execlevel asinvoker' $Compiler_Script_x64 &= ' /execlevel asinvoker' Case "Highest Avail" $Compiler_Script_x86 &= ' /execlevel highestavailable' $Compiler_Script_x64 &= ' /execlevel highestavailable' Case "Require Admin" $Compiler_Script_x86 &= ' /execlevel requireadministrator' $Compiler_Script_x64 &= ' /execlevel requireadministrator' EndSwitch Switch GUICtrlRead($GUI_Compiler_Compatibility) Case "Windows Vista" $Compiler_Script_x86 &= ' /compatibility vista' $Compiler_Script_x64 &= ' /compatibility vista' Case "Windows 7" $Compiler_Script_x86 &= ' /compatibility win7' $Compiler_Script_x64 &= ' /compatibility win7' Case "Windows 8" $Compiler_Script_x86 &= ' /compatibility win8' $Compiler_Script_x64 &= ' /compatibility win8' EndSwitch Switch GUICtrlRead($GUI_Compiler_Comment) Case "" $Compiler_Script_x86 &= ' /comments "Compiled with AutoIt Portable by zelles."' $Compiler_Script_x64 &= ' /comments "Compiled with AutoIt Portable by zelles."' Case Else $Compiler_Script_x86 &= ' /comments "' & GUICtrlRead($GUI_Compiler_Comment) & '"' $Compiler_Script_x64 &= ' /comments "' & GUICtrlRead($GUI_Compiler_Comment) & '"' EndSwitch Switch GUICtrlRead($GUI_Compiler_CompanyName) Case "" $Compiler_Script_x86 &= ' /companyname "None"' $Compiler_Script_x64 &= ' /companyname "None"' Case Else $Compiler_Script_x86 &= ' /companyname "' & GUICtrlRead($GUI_Compiler_CompanyName) & '"' $Compiler_Script_x64 &= ' /companyname "' & GUICtrlRead($GUI_Compiler_CompanyName) & '"' EndSwitch Switch GUICtrlRead($GUI_Compiler_Description) Case "" $Compiler_Script_x86 &= ' /filedescription "None"' $Compiler_Script_x64 &= ' /filedescription "None"' Case Else $Compiler_Script_x86 &= ' /filedescription "' & GUICtrlRead($GUI_Compiler_Description) & '"' $Compiler_Script_x64 &= ' /filedescription "' & GUICtrlRead($GUI_Compiler_Description) & '"' EndSwitch Switch GUICtrlRead($GUI_Compiler_Copyright) Case "" $Compiler_Script_x86 &= ' /legalcopyright ' & @YEAR $Compiler_Script_x64 &= ' /legalcopyright ' & @YEAR Case Else $Compiler_Script_x86 &= ' /legalcopyright "' & GUICtrlRead($GUI_Compiler_Copyright) & '"' $Compiler_Script_x64 &= ' /legalcopyright "' & GUICtrlRead($GUI_Compiler_Copyright) & '"' EndSwitch Switch GUICtrlRead($GUI_Compiler_Trademarks) Case "" $nothing = 0 Case Else $Compiler_Script_x86 &= ' /legaltrademarks "' & GUICtrlRead($GUI_Compiler_Trademarks) & '"' $Compiler_Script_x64 &= ' /legaltrademarks "' & GUICtrlRead($GUI_Compiler_Trademarks) & '"' EndSwitch Switch GUICtrlRead($GUI_Compiler_ProductName) Case "" $nothing = 0 Case Else $Compiler_Script_x86 &= ' /productname "' & GUICtrlRead($GUI_Compiler_ProductName) & '"' $Compiler_Script_x64 &= ' /productname "' & GUICtrlRead($GUI_Compiler_ProductName) & '"' EndSwitch Switch GUICtrlRead($GUI_Compiler_FileVersion) Case "" $Compiler_Script_x86 &= ' /fileversion "0.0.0.1"' $Compiler_Script_x64 &= ' /fileversion "0.0.0.1"' Case Else $Compiler_Script_x86 &= ' /fileversion "' & GUICtrlRead($GUI_Compiler_FileVersion) & '"' $Compiler_Script_x64 &= ' /fileversion "' & GUICtrlRead($GUI_Compiler_FileVersion) & '"' EndSwitch Switch GUICtrlRead($GUI_Compiler_ProductVersion) Case "" $Compiler_Script_x86 &= ' /productversion "3.3.12.0"' $Compiler_Script_x64 &= ' /productversion "3.3.12.0"' Case Else $Compiler_Script_x86 &= ' /productversion "' & GUICtrlRead($GUI_Compiler_ProductVersion) & '"' $Compiler_Script_x64 &= ' /productversion "' & GUICtrlRead($GUI_Compiler_ProductVersion) & '"' EndSwitch If GUICtrlRead($GUI_Compiler_x86) = $GUI_CHECKED Then RunWait($Compiler_Script_x86) ;RunWait($DIR_TEMP & '/Aut2exe.exe /in "' & $FILE_TEMP & '" /out "' & $DIR_complier_output & '\' & $f_OutputFile & ' x86.exe" /icon "' & $FILE_icon & '"' & $f_Compression & $f_UPXCompression & ' /x86') ;RunWait($DIR_TEMP & '/Aut2exe.exe /in "' & $FILE_TEMP & '" /out "' & $DIR_complier_output & '\' & $f_OutputFile & ' x86.exe"' & $f_IconFile & $f_Compression & $f_IgnoreDirectives & $f_UPXCompression & ' /x86'`& $f_AppType & $f_ExecutionLevel & $f_Compatibility & $f_Comment & $f_CompanyName & $f_Description & $f_Copyright & $f_Trademarks & $f_ProductName & $f_FileVersion & $f_ProductVersion) EndIf If GUICtrlRead($GUI_Compiler_x64) = $GUI_CHECKED Then RunWait($Compiler_Script_x64) ;RunWait($DIR_TEMP & '/Aut2exe.exe /in "' & $FILE_TEMP & '" /out "' & $DIR_complier_output & '\' & $f_OutputFile & ' x64.exe"' & $f_IconFile & $f_Compression & $f_IgnoreDirectives & $f_UPXCompression & ' /x64'`& $f_AppType & $f_ExecutionLevel & $f_Compatibility & $f_Comment & $f_CompanyName & $f_Description & $f_Copyright & $f_Trademarks & $f_ProductName & $f_FileVersion & $f_ProductVersion) EndIf FileDelete($FILE_TEMP) GUIDelete($GUI_Compiler) MsgBox(0, "AIP Response", "The compiler is finished. Check script directory for files.") EndFunc Func Close_Compiler() GUIDelete($GUI_Compiler) EndFunc #EndRegion End Compiler GUI Events #Region Begin Temp Appdata Setup Func Create_Temp_Workstation() If Not FileExists($DIR_TEMP) Then DirCreate($DIR_TEMP) If Not FileExists($DIR_includes) Then DirCreate($DIR_includes) FileInstall("C:\AIP\Icon.ico", $DIR_TEMP & "\Icon.ico", 0) FileInstall("C:\AIP\Aut2exe.exe", $DIR_TEMP & "\Aut2exe.exe", 0) FileInstall("C:\AIP\upx.exe", $DIR_TEMP & "\upx.exe", 0) FileInstall("C:\AIP\includes\APIComConstants.au3", $DIR_includes & "\APIComConstants.au3", 0) FileInstall("C:\AIP\includes\APIConstants.au3", $DIR_includes & "\APIConstants.au3", 0) FileInstall("C:\AIP\includes\APIDiagConstants.au3", $DIR_includes & "\APIDiagConstants.au3", 0) FileInstall("C:\AIP\includes\APIDlgConstants.au3", $DIR_includes & "\APIDlgConstants.au3", 0) FileInstall("C:\AIP\includes\APIErrorsConstants.au3", $DIR_includes & "\APIErrorsConstants.au3", 0) FileInstall("C:\AIP\includes\APIFilesConstants.au3", $DIR_includes & "\APIFilesConstants.au3", 0) FileInstall("C:\AIP\includes\APIGdiConstants.au3", $DIR_includes & "\APIGdiConstants.au3", 0) FileInstall("C:\AIP\includes\APILocaleConstants.au3", $DIR_includes & "\APILocaleConstants.au3", 0) FileInstall("C:\AIP\includes\APIMiscConstants.au3", $DIR_includes & "\APIMiscConstants.au3", 0) FileInstall("C:\AIP\includes\APIProcConstants.au3", $DIR_includes & "\APIProcConstants.au3", 0) FileInstall("C:\AIP\includes\APIRegConstants.au3", $DIR_includes & "\APIRegConstants.au3", 0) FileInstall("C:\AIP\includes\APIResConstants.au3", $DIR_includes & "\APIResConstants.au3", 0) FileInstall("C:\AIP\includes\APIShellExConstants.au3", $DIR_includes & "\APIShellExConstants.au3", 0) FileInstall("C:\AIP\includes\APIShPathConstants.au3", $DIR_includes & "\APIShPathConstants.au3", 0) FileInstall("C:\AIP\includes\APISysConstants.au3", $DIR_includes & "\APISysConstants.au3", 0) FileInstall("C:\AIP\includes\APIThemeConstants.au3", $DIR_includes & "\APIThemeConstants.au3", 0) FileInstall("C:\AIP\includes\Array.au3", $DIR_includes & "\Array.au3", 0) FileInstall("C:\AIP\includes\AutoItConstants.au3", $DIR_includes & "\AutoItConstants.au3", 0) FileInstall("C:\AIP\includes\AVIConstants.au3", $DIR_includes & "\AVIConstants.au3", 0) FileInstall("C:\AIP\includes\BorderConstants.au3", $DIR_includes & "\BorderConstants.au3", 0) FileInstall("C:\AIP\includes\ButtonConstants.au3", $DIR_includes & "\ButtonConstants.au3", 0) FileInstall("C:\AIP\includes\Clipboard.au3", $DIR_includes & "\Clipboard.au3", 0) FileInstall("C:\AIP\includes\Color.au3", $DIR_includes & "\Color.au3", 0) FileInstall("C:\AIP\includes\ColorConstants.au3", $DIR_includes & "\ColorConstants.au3", 0) FileInstall("C:\AIP\includes\ComboConstants.au3", $DIR_includes & "\ComboConstants.au3", 0) FileInstall("C:\AIP\includes\Constants.au3", $DIR_includes & "\Constants.au3", 0) FileInstall("C:\AIP\includes\Crypt.au3", $DIR_includes & "\Crypt.au3", 0) FileInstall("C:\AIP\includes\Date.au3", $DIR_includes & "\Date.au3", 0) FileInstall("C:\AIP\includes\DateTimeConstants.au3", $DIR_includes & "\DateTimeConstants.au3", 0) FileInstall("C:\AIP\includes\Debug.au3", $DIR_includes & "\Debug.au3", 0) FileInstall("C:\AIP\includes\DirConstants.au3", $DIR_includes & "\DirConstants.au3", 0) FileInstall("C:\AIP\includes\EditConstants.au3", $DIR_includes & "\EditConstants.au3", 0) FileInstall("C:\AIP\includes\EventLog.au3", $DIR_includes & "\EventLog.au3", 0) FileInstall("C:\AIP\includes\Excel.au3", $DIR_includes & "\Excel.au3", 0) FileInstall("C:\AIP\includes\ExcelConstants.au3", $DIR_includes & "\ExcelConstants.au3", 0) FileInstall("C:\AIP\includes\File.au3", $DIR_includes & "\File.au3", 0) FileInstall("C:\AIP\includes\FileConstants.au3", $DIR_includes & "\FileConstants.au3", 0) FileInstall("C:\AIP\includes\FontConstants.au3", $DIR_includes & "\FontConstants.au3", 0) FileInstall("C:\AIP\includes\FrameConstants.au3", $DIR_includes & "\FrameConstants.au3", 0) FileInstall("C:\AIP\includes\FTPEx.au3", $DIR_includes & "\FTPEx.au3", 0) FileInstall("C:\AIP\includes\GDIPlus.au3", $DIR_includes & "\GDIPlus.au3", 0) FileInstall("C:\AIP\includes\GDIPlusConstants.au3", $DIR_includes & "\GDIPlusConstants.au3", 0) FileInstall("C:\AIP\includes\GuiAVI.au3", $DIR_includes & "\GuiAVI.au3", 0) FileInstall("C:\AIP\includes\GuiButton.au3", $DIR_includes & "\GuiButton.au3", 0) FileInstall("C:\AIP\includes\GuiComboBox.au3", $DIR_includes & "\GuiComboBox.au3", 0) FileInstall("C:\AIP\includes\GuiComboBoxEx.au3", $DIR_includes & "\GuiComboBoxEx.au3", 0) FileInstall("C:\AIP\includes\GUIConstants.au3", $DIR_includes & "\GUIConstants.au3", 0) FileInstall("C:\AIP\includes\GUIConstantsEx.au3", $DIR_includes & "\GUIConstantsEx.au3", 0) FileInstall("C:\AIP\includes\GuiDateTimePicker.au3", $DIR_includes & "\GuiDateTimePicker.au3", 0) FileInstall("C:\AIP\includes\GuiEdit.au3", $DIR_includes & "\GuiEdit.au3", 0) FileInstall("C:\AIP\includes\GuiHeader.au3", $DIR_includes & "\GuiHeader.au3", 0) FileInstall("C:\AIP\includes\GuiImageList.au3", $DIR_includes & "\GuiImageList.au3", 0) FileInstall("C:\AIP\includes\GuiIPAddress.au3", $DIR_includes & "\GuiIPAddress.au3", 0) FileInstall("C:\AIP\includes\GuiListBox.au3", $DIR_includes & "\GuiListBox.au3", 0) FileInstall("C:\AIP\includes\GuiListView.au3", $DIR_includes & "\GuiListView.au3", 0) FileInstall("C:\AIP\includes\GuiMenu.au3", $DIR_includes & "\GuiMenu.au3", 0) FileInstall("C:\AIP\includes\GuiMonthCal.au3", $DIR_includes & "\GuiMonthCal.au3", 0) FileInstall("C:\AIP\includes\GuiReBar.au3", $DIR_includes & "\GuiReBar.au3", 0) FileInstall("C:\AIP\includes\GuiRichEdit.au3", $DIR_includes & "\GuiRichEdit.au3", 0) FileInstall("C:\AIP\includes\GuiScrollBars.au3", $DIR_includes & "\GuiScrollBars.au3", 0) FileInstall("C:\AIP\includes\GuiSlider.au3", $DIR_includes & "\GuiSlider.au3", 0) FileInstall("C:\AIP\includes\GuiStatusBar.au3", $DIR_includes & "\GuiStatusBar.au3", 0) FileInstall("C:\AIP\includes\GuiTab.au3", $DIR_includes & "\GuiTab.au3", 0) FileInstall("C:\AIP\includes\GuiToolbar.au3", $DIR_includes & "\GuiToolbar.au3", 0) FileInstall("C:\AIP\includes\GuiToolTip.au3", $DIR_includes & "\GuiToolTip.au3", 0) FileInstall("C:\AIP\includes\GuiTreeView.au3", $DIR_includes & "\GuiTreeView.au3", 0) FileInstall("C:\AIP\includes\HeaderConstants.au3", $DIR_includes & "\HeaderConstants.au3", 0) FileInstall("C:\AIP\includes\IE.au3", $DIR_includes & "\IE.au3", 0) FileInstall("C:\AIP\includes\ImageListConstants.au3", $DIR_includes & "\ImageListConstants.au3", 0) FileInstall("C:\AIP\includes\Inet.au3", $DIR_includes & "\Inet.au3", 0) FileInstall("C:\AIP\includes\InetConstants.au3", $DIR_includes & "\InetConstants.au3", 0) FileInstall("C:\AIP\includes\IPAddressConstants.au3", $DIR_includes & "\IPAddressConstants.au3", 0) FileInstall("C:\AIP\includes\ListBoxConstants.au3", $DIR_includes & "\ListBoxConstants.au3", 0) FileInstall("C:\AIP\includes\ListViewConstants.au3", $DIR_includes & "\ListViewConstants.au3", 0) FileInstall("C:\AIP\includes\Math.au3", $DIR_includes & "\Math.au3", 0) FileInstall("C:\AIP\includes\Memory.au3", $DIR_includes & "\Memory.au3", 0) FileInstall("C:\AIP\includes\MemoryConstants.au3", $DIR_includes & "\MemoryConstants.au3", 0) FileInstall("C:\AIP\includes\MenuConstants.au3", $DIR_includes & "\MenuConstants.au3", 0) FileInstall("C:\AIP\includes\Misc.au3", $DIR_includes & "\Misc.au3", 0) FileInstall("C:\AIP\includes\MsgBoxConstants.au3", $DIR_includes & "\MsgBoxConstants.au3", 0) FileInstall("C:\AIP\includes\NamedPipes.au3", $DIR_includes & "\NamedPipes.au3", 0) FileInstall("C:\AIP\includes\NetShare.au3", $DIR_includes & "\NetShare.au3", 0) FileInstall("C:\AIP\includes\NTSTATUSConstants.au3", $DIR_includes & "\NTSTATUSConstants.au3", 0) FileInstall("C:\AIP\includes\Process.au3", $DIR_includes & "\Process.au3", 0) FileInstall("C:\AIP\includes\ProcessConstants.au3", $DIR_includes & "\ProcessConstants.au3", 0) FileInstall("C:\AIP\includes\ProgressConstants.au3", $DIR_includes & "\ProgressConstants.au3", 0) FileInstall("C:\AIP\includes\RebarConstants.au3", $DIR_includes & "\RebarConstants.au3", 0) FileInstall("C:\AIP\includes\RichEditConstants.au3", $DIR_includes & "\RichEditConstants.au3", 0) FileInstall("C:\AIP\includes\ScreenCapture.au3", $DIR_includes & "\ScreenCapture.au3", 0) FileInstall("C:\AIP\includes\ScrollBarConstants.au3", $DIR_includes & "\ScrollBarConstants.au3", 0) FileInstall("C:\AIP\includes\ScrollBarsConstants.au3", $DIR_includes & "\ScrollBarsConstants.au3", 0) FileInstall("C:\AIP\includes\Security.au3", $DIR_includes & "\Security.au3", 0) FileInstall("C:\AIP\includes\SecurityConstants.au3", $DIR_includes & "\SecurityConstants.au3", 0) FileInstall("C:\AIP\includes\SendMessage.au3", $DIR_includes & "\SendMessage.au3", 0) FileInstall("C:\AIP\includes\SliderConstants.au3", $DIR_includes & "\SendMessage.au3", 0) FileInstall("C:\AIP\includes\Sound.au3", $DIR_includes & "\Sound.au3", 0) FileInstall("C:\AIP\includes\SQLite.au3", $DIR_includes & "\SQLite.au3", 0) FileInstall("C:\AIP\includes\SQLite.dll.au3", $DIR_includes & "\SQLite.dll.au3", 0) FileInstall("C:\AIP\includes\StaticConstants.au3", $DIR_includes & "\StaticConstants.au3", 0) FileInstall("C:\AIP\includes\StatusBarConstants.au3", $DIR_includes & "\StatusBarConstants.au3", 0) FileInstall("C:\AIP\includes\String.au3", $DIR_includes & "\String.au3", 0) FileInstall("C:\AIP\includes\StringConstants.au3", $DIR_includes & "\StringConstants.au3", 0) FileInstall("C:\AIP\includes\StructureConstants.au3", $DIR_includes & "\StructureConstants.au3", 0) FileInstall("C:\AIP\includes\TabConstants.au3", $DIR_includes & "\TabConstants.au3", 0) FileInstall("C:\AIP\includes\Timers.au3", $DIR_includes & "\Timers.au3", 0) FileInstall("C:\AIP\includes\ToolbarConstants.au3", $DIR_includes & "\ToolbarConstants.au3", 0) FileInstall("C:\AIP\includes\ToolTipConstants.au3", $DIR_includes & "\ToolTipConstants.au3", 0) FileInstall("C:\AIP\includes\TrayConstants.au3", $DIR_includes & "\TrayConstants.au3", 0) FileInstall("C:\AIP\includes\TreeViewConstants.au3", $DIR_includes & "\TreeViewConstants.au3", 0) FileInstall("C:\AIP\includes\UDFGlobalID.au3", $DIR_includes & "\UDFGlobalID.au3", 0) FileInstall("C:\AIP\includes\UpDownConstants.au3", $DIR_includes & "\UpDownConstants.au3", 0) FileInstall("C:\AIP\includes\Visa.au3", $DIR_includes & "\Visa.au3", 0) FileInstall("C:\AIP\includes\WinAPI.au3", $DIR_includes & "\WinAPI.au3", 0) FileInstall("C:\AIP\includes\WinAPICom.au3", $DIR_includes & "\WinAPICom.au3", 0) FileInstall("C:\AIP\includes\WinAPIConstants.au3", $DIR_includes & "\WinAPIConstants.au3", 0) FileInstall("C:\AIP\includes\WinAPIDiag.au3", $DIR_includes & "\WinAPIDiag.au3", 0) FileInstall("C:\AIP\includes\WinAPIDlg.au3", $DIR_includes & "\WinAPIDlg.au3", 0) FileInstall("C:\AIP\includes\WinAPIError.au3", $DIR_includes & "\WinAPIError.au3", 0) FileInstall("C:\AIP\includes\WinAPIEx.au3", $DIR_includes & "\WinAPIEx.au3", 0) FileInstall("C:\AIP\includes\WinAPIFiles.au3", $DIR_includes & "\WinAPIFiles.au3", 0) FileInstall("C:\AIP\includes\WinAPIGdi.au3", $DIR_includes & "\WinAPIGdi.au3", 0) FileInstall("C:\AIP\includes\WinAPIInternals.au3", $DIR_includes & "\WinAPIInternals.au3", 0) FileInstall("C:\AIP\includes\WinAPIlangConstants.au3", $DIR_includes & "\WinAPIlangConstants.au3", 0) FileInstall("C:\AIP\includes\WinAPILocale.au3", $DIR_includes & "\WinAPILocale.au3", 0) FileInstall("C:\AIP\includes\WinAPIMisc.au3", $DIR_includes & "\WinAPIMisc.au3", 0) FileInstall("C:\AIP\includes\WinAPIProc.au3", $DIR_includes & "\WinAPIProc.au3", 0) FileInstall("C:\AIP\includes\WinAPIReg.au3", $DIR_includes & "\WinAPIReg.au3", 0) FileInstall("C:\AIP\includes\WinAPIRes.au3", $DIR_includes & "\WinAPIRes.au3", 0) FileInstall("C:\AIP\includes\WinAPIShellEx.au3", $DIR_includes & "\WinAPIShellEx.au3", 0) FileInstall("C:\AIP\includes\WinAPIShPath.au3", $DIR_includes & "\WinAPIShPath.au3", 0) FileInstall("C:\AIP\includes\WinAPISys.au3", $DIR_includes & "\WinAPISys.au3", 0) FileInstall("C:\AIP\includes\WinAPIsysinfoConstants.au3", $DIR_includes & "\WinAPIsysinfoConstants.au3", 0) FileInstall("C:\AIP\includes\WinAPITheme.au3", $DIR_includes & "\WinAPITheme.au3", 0) FileInstall("C:\AIP\includes\WinAPIvkeysConstants.au3", $DIR_includes & "\WinAPIvkeysConstants.au3", 0) FileInstall("C:\AIP\includes\WindowsConstants.au3", $DIR_includes & "\WindowsConstants.au3", 0) FileInstall("C:\AIP\includes\WinNet.au3", $DIR_includes & "\WinNet.au3", 0) FileInstall("C:\AIP\includes\Word.au3", $DIR_includes & "\Word.au3", 0) FileInstall("C:\AIP\includes\WordConstants.au3", $DIR_includes & "\WordConstants.au3", 0) EndFunc #EndRegion End Temp Appdata Setup Source Files: AutoIt Portable v 0.0.2 source.zip Windows Executable: AutoIt Portable v 0.0.2.zip Older Versions: Feedback is appreciated!
    1 point
  2. Sounds like your quotes are off or else it wouldn't cut off at the space.
    1 point
  3. example this will work coded like this $ffmpegRecorder = '"C:\Documents and Settings\settop\Desktop\ffmpeg.exe" -re -rtbufsize 100000k -i - -c:v "copy" -c:a "copy" -f "flv" testing44.flv' but if i try to put full path to say VLC or Yamdi or another FFMPEG or ffplay it will not play well if i put something like this it will work with full path to FFmpeg after the "|" $vlc = 'vlc.exe .....' $ffmpegRecorder = '"C:\Documents and Settings\settop\Desktop\ffmpeg.exe" -re -rtbufsize 100000k -i - -c:v "copy" -c:a "copy" -f "flv" testing44.flv' Run(@ComSpec & " /K " & $vlc & "|" & $ffmpegRecorder, @ScriptDir, @SW_SHOW) BUT it will not let me put the full path to VLC or any other full path to ANY program before the "|" i just get this error
    1 point
  4. xbennY0, Somehow I knew you would ask that: Here is a short example which just looks for 2 files in the AutoIt Include folder and adds them to a single file: #include <File.au3> #include <Array.au3> ; Name of file to create $sFile = @ScriptDir & "\Master File.txt" ; Root path of the folders to seach for files - this gets the current Include folder $sPath = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", Default, -1)) & "Include\" ; You would need to adjust the path so that it returns all the files you want to add to the master file ; Here we are just looking for Process.au3 and ProcessConstants.au3 $aList = _FileListToArrayRec($sPath, "Process*.au3", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH) ; These are the files returned - you should have 2 _ArrayDisplay($aList, "", Default, 8) ; We now create the master file $hFile = FileOpen($sFile, 2) ; And loop through the fiel list adding the content with some delimiters so we know where one ends and the next one starts For $i = 1 To $aList[0] $VContent = FileRead($aList[$i]) FileWrite($hFile, $aList[$i] & @CRLF & "----------" & @CRLF & $vContent & @CRLF & "###############################################" & @CRLF & @CRLF) Next ; We close the file FileClose($hFile) ; And now open NotePad to display it ShellExecute($sFile) All clear? M23
    1 point
  5. Luigi

    arrary list help

    Something like this??? #include <File.au3> #include <Array.au3> Local $aDoc = _FileListToArray("c:\folder", "*.doc") For $ii = 1 To $aDoc[0] ShellExecuteWait("c:\folder\doc2pdf.vbs" , $aDoc[$ii]) Next
    1 point
  6. ludocus

    Webcam Udf

    Made a udf to rysiora's webcam example, Webcam.au3 (the udf) #include <WindowsConstants.au3> #include-once $WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START +100 $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_ABORT = $WM_CAP_START + 69 $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46 $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43 $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41 $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42 $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14 $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12 $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12 $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13 $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13 $WM_CAP_EDIT_COPY = $WM_CAP_START + 30 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22 $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21 $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21 $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23 $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23 $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25 $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20 $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20 $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24 $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36 $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1 $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67 $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67 $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65 $WM_CAP_GET_STATUS = $WM_CAP_START + 54 $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8 $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44 $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83 $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84 $WM_CAP_PAL_OPENA = $WM_CAP_START + 80 $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80 $WM_CAP_PAL_PASTE = $WM_CAP_START + 82 $WM_CAP_SEQUENCE = $WM_CAP_START + 62 $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63 $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35 $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85 $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2 $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2 $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5 $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3 $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3 $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6 $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7 $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4 $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66 $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WM_CAP_SET_SCROLL = $WM_CAP_START + 55 $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64 $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9 $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45 $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72 $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71 $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70 $WM_CAP_STOP = $WM_CAP_START + 68 #include <GUIConstants.au3> $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") ;=============================================================================== ; ; Description: Open's a webcam preview screen in your gui ; Syntax: _WebcamOpen($sHwnd, $sLeft, $sTop, $sWidth, $sHeight, $sPort=0) ; Parameter(s): $sHwnd - The handle of the gui ; $sLeft - Left coord. of the preview screen ; $sTop - Top coord. of the preview screen ; $sWidth - Width of the preview screen ; $sHeight - Height of the preview screen ; $sPort - Specify wich webcam port you want to use (for multiple webcams) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns id needed for other controls ; On Failure - Returns -1 ; Author(s): Ludocus ; Note(s): If a black/blank screen shows up, try using different $sPort's (0 to 3) ; ;=============================================================================== Func _WebcamOpen($sHwnd, $sLeft, $sTop, $sWidth, $sHeight, $sPort=0) $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", $sLeft, "int", $sTop, "int", $sWidth, "int", $sHeight, "hwnd", $sHwnd, "int", 1) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", $sPort, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0) if @error then return -1 return $cap[0] EndFunc ;=============================================================================== ; ; Description: Creates a Snapshot from a webcam ; Syntax: _WebcamSnap($sId, $sFile) ; Parameter(s): $sId - Id (returned from _WebcamOpen) ; $sFile - File to save the snapshot to (*.bmp) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; Author(s): Ludocus ; Note(s): None ; ;=============================================================================== Func _WebcamSnap($sId, $sFile) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_SET_CALLBACK_FRAME, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $sFile) if @error Then return 0 Else return 1 EndIf EndFunc ;=============================================================================== ; ; Description: Closes the preview screen created with _WebcamOpen ; Syntax: _WebcamClose($sId) ; Parameter(s): $sId - Id (returned from _WebcamOpen) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; Author(s): Ludocus ; Note(s): None ; ;=============================================================================== Func _WebcamClose($sId) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) DllClose($user) if @error Then return 0 Else return 1 EndIf EndFunc ;=============================================================================== ; ; Description: Starts recording the webcam to a file ; Syntax: _WebcamRecordStart($sFile, $sId) ; Parameter(s): $sId - Id (returned from _WebcamOpen) ; $sFile - File to save the movie to (*.avi) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; Author(s): Ludocus ; Note(s): Stop recording by: _WebcamRecordStop($Id) ; ;=============================================================================== Func _WebcamRecordStart($sFile, $sId) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_FILE_SET_CAPTURE_FILEA, "int", 0, "str", $sFile) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_SEQUENCE, "int", 0, "int", 0) if @error Then return 0 Else return 1 EndIf EndFunc ;=============================================================================== ; ; Description: Stops recording. ; Syntax: _WebcamRecordStop($sId) ; Parameter(s): $sId - Id (returned from _WebcamOpen) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; Author(s): Ludocus ; Note(s): None ; ;=============================================================================== Func _WebcamRecordStop($sId) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_STOP, "int", 0, "int", 0) if @error Then return 0 Else return 1 EndIf EndFunc thnx to rysiora with his great example!
    1 point
  7. Biatu

    GlyphDesigner v1.00

    Update: -Finished Undo/Reset Functions These links get updated as I compile new versions. 64Bit: Infintiy.GlyphDesigner.64 32Bit: Infinity.GlyphDesigner
    1 point
  8. In experiencing issues, it seems you are blaming what is not at fault. Piping seems to work fine. Using Chr(124) seems quite unnecessary. You may still need to escape certain characters passed to CMD under certain conditions. Like this example where a For loop does not like a pipe character unless it is escaped with a caret (^). ; Run cmd with /q = Echo off, /k Remain open. Pipe dir output to sort. Run("cmd /q /k for /f %A in ('dir /b ^| sort') do echo %A") . Piping FFMPEG to VLC can be done. An example that I tested as working on Windows 7 X64 with VLC X86 ver. 2.1.5 installed and with FFMPEG ver. N-52941-g13cb6ed static built on 2013-05-09 in a folder that is in %path%. I added some extra double quotes which do not cause any issue. ; Select a FLV media file. Option 1 = File must exist. $input_flv = FileOpenDialog('Select FLV media file', EnvGet('SystemDrive'), 'Flash media file (*.flv)', 1) If @error Then Exit ; Set full path to vlc.exe. $vlc_fullpath = EnvGet('ProgramFiles') & '\VideoLAN\VLC\vlc.exe' If Not FileExists($vlc_fullpath) And @OSArch <> 'X86' Then $vlc_fullpath = EnvGet('ProgramFiles(x86)') & '\VideoLAN\VLC\vlc.exe' EndIf ; Last attempt to find vlc.exe if not found already. If Not FileExists($vlc_fullpath) Then ; Select location to vlc.exe. Option 1 = File must exist. $vlc_fullpath = FileOpenDialog('Find vlc.exe', EnvGet('SystemDrive'), 'Executable file (*.exe)', 1, 'vlc.exe') If @error Then Exit EndIf ; Run the command. The command expects ffmpeg to be in the path. $command = 'cmd /k ffmpeg -i "' & $input_flv & '" -c:v "copy" -c:a "copy" -f "flv" pipe:1 | "' & $vlc_fullpath & '" -' Run($command) If @error Then MsgBox(0x40030, @ScriptName, 'This command failed to run.' & @CRLF & @CRLF & $command) ; As for yamdi, I do not know why it does not like the pipe from ffmpeg. Perhaps a later build of ffmpeg may help. Perhaps yambi is stdin incompetent. Perhaps my lack of experience with yambi is failing me. I do not have the answer with ffmpeg | yambi though perhaps I have helped with what it is not.
    1 point
  9. Beege

    Scrolling Line Graph UDF

    Updated - 2/9/2010 - So there have been quite a few improvents since my last update 2 days ago. Added five new functions, User Calltips and Keywords, and also made changes to _SLG_UpdateGraph() and _SLG_CreateGraph() so be sure to look at the examples(and thumb) since they are new and show how too use the new functions. 5 new functions: _SLG_AddLine(), _SLG_SetLineValue(), _SLG_SetLineWidth(), _SLG_SetGridLineColor(), _SLG_EnableGridLines()-Thanks UEZ Updated 2/7/2010 - made negative value ranges possible. Here is a UDF I have been working on lately to help create scrolling line graphs. Like the ones you see for the CPU in Task Manager. Please let me know if you see or have any problems. I also want to thank and give some credit to monoceres for all his examples around the forums. I would have never made it this far without them. Example 1 #include "SLG.au3" Opt('GuiOnEventMode', 1) $GUI = GUICreate("GDI+ Scrolling Line Graph", 628, 297, -1, -1, -1, $WS_EX_TOPMOST) GUISetOnEvent(-3, '_Exit') GUISetState() $Increments = 100 $Graph1 = _SLG_CreateGraph($GUI, 18, 18, 596, 257, -100, 100, $Increments, -1,-1,-1,False) While 1 _SLG_SetLineValue($Graph1, Random(-100,100)) _SLG_UpdateGraph($Graph1) Sleep(30) WEnd Func _Exit() Exit EndFunc Example 2 #include <StaticConstants.au3> #include "SLG.au3" Opt('GuiOnEventMode', 1) Const $cBlue = 0xFF00ACFF, $cGreen = 0xFF00FF00, $cPink = 0xFFF004DE, $cYellow = 0xFFFFFF00 Const $cGray = 0xFFADADAD, $cRed = 0xFFFF0000, $cPurple = 0xFF8000FF, $cOrange = 0xFFFF8000 Const $Pi = ACos(-1), $4Pi = $Pi / 4 $GUI = GUICreate("GDI+ Scrolling Line Graph", 628, 297, -1, -1, -1, $WS_EX_TOPMOST) GUISetOnEvent(-3, '_Exit') $Label1 = GUICtrlCreateLabel("Graph 1", 66, 36, 192, 53, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Graph 2", 372, 36, 192, 53, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif") GUISetState() $Increments = 85 $Graph1 = _SLG_CreateGraph($GUI, 18, 114, 283, 157, -1.01, 1.01, $Increments, $cPink, 2, -1, False) $G1Line2 = _SLG_AddLine($Graph1, $cGreen) $G1Line3 = _SLG_AddLine($Graph1, $cBlue) $Graph2 = _SLG_CreateGraph($GUI, 324, 114, 283, 157, -1.01, 1.01, $Increments, $cBlue) _SLG_SetGridLineColor($Graph2, 0xFF5C5C5C) $G2Line2 = _SLG_AddLine($Graph2, $cGreen) $G2Line3 = _SLG_AddLine($Graph2, $cRed) While 1 For $i = 0 To (2 * $Pi) Step 0.1 _SLG_SetLineValue($Graph1, Sin($i)) _SLG_SetLineValue($Graph2, Sin($i)) For $Line = $G1Line2 To $G1Line3 $y = Sin($i + ($4Pi * ($Line - 1))) _SLG_SetLineValue($Graph1, $y, $Line) Next For $Line = $G2Line2 To $G2Line3 $y = Sin($i + ($4Pi * ($Line - 1))) _SLG_SetLineValue($Graph2, $y, $Line) Next _SLG_UpdateGraph($Graph1) _SLG_UpdateGraph($Graph2) Sleep(25) Next WEnd Func _Exit() Exit EndFunc ;==>_Exit UDF #Region Header ; #INDEX# ======================================================================================================================= ; Title .........: SLG ; AutoIt Version : 3.3.4.0 ; Language ......: English ; Description ...: Functions to assist in creating and updating Scrolling Line Graphs ; Author(s) .....: Beege ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_SLG_CreateGraph ;_SLG_UpdateGraph ;_SLG_ClearGraph ;_SLG_SetLineColor ;_SLG_SetYRange ;_SLG_SetBackGroundColor ;_SLG_AddLine ;_SLG_SetLineValue ;_SLG_SetLineWidth ;_SLG_EnableGridLines ;_SLG_SetGridLineColor ; =============================================================================================================================== #Region User KeyWords and CallTips #cs Keywords: au3.keywords.user.udfs= _slg_creategraph _slg_updategraph _slg_cleargraph \ _slg_setlinecolor _slg_setyrange _slg_setbackgroundcolor _slg_addline \ _slg_setlinevalue _slg_setlinewidth _slg_enablegridlines _slg_setgridlinecolor CallTips: _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrements, $Line_Color = 0xFF00FF00, $Line_Width = 2, $iBackGround = 0xFF000000, $bGridlines = True) _SLG_UpdateGraph($iIndex) _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 2) _SLG_ClearGraph($iIndex) _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) _SLG_SetLineColor($iIndex, $iARGB, $iLine = 1) _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) _SLG_SetGridLineColor($iIndex, $iARGB = Default) _SLG_EnableGridLines($iIndex, $bGridlines = True) #ce #EndRegion #include-once #include <GDIPlus.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() OnAutoItExitRegister('_SLG_Exit') #EndRegion Header #Region Global Variables and Constants Global Enum $g_hGraphic, $g_hBitmap, $g_hBuffer, $g_aPens, $g_iLeft, $g_iTop, $g_iWidth, $g_iHeight, $g_iIncrements, _ $g_iIncrement_Size, $g_iShift_Distance, $g_iY, $g_iY_Last, $g_iY_Min, $g_iY_Max, $g_iY_Range, $g_hDC, $g_hGUI, $g_iBackColor, _ $g_iX_counter, $g_iY_counter, $g_iX_counter_mem, $g_bGridlines, $g_iGridColor, $MAX Global $aGraphs[1][$MAX] $aGraphs[0][0] = 0 #cs $aGraphs[0][0] = List Count [0][1-17] = Nothing $aGraphs[$i][0] = $Graphic Object Handle [$i][$g_hBitmap] = Bitmap Object Handle [$i][$g_hBuffer] = Buffer Handle [$i][$g_iLeft] = Left [$i][$g_iTop] = Top [$i][$g_iWidth] = Width [$i][$g_iHeight] = Height [$i][$g_iIncrements] = Step Count [$i][$g_iIncrement_Size]= Step Size [$i][$g_iShift_Distance]= Shift Distance [$i][$g_iY_Min] = Y Min [$i][$g_iY_Max] = Y Max [$i][$g_iY_Range] = Y Range [$i][$g_hDC] = Display device context Handle [$i][$g_hGUI] = GUI Handle [$i][$g_iBackColor] = BackGround Color value [$i][$g_iY_Last] = Array containing Last Y Cordnate for each Line [$i][$g_iY] = Array containing Y Cordnate for each Line [$i][$g_aPens] = Array containing Pen Handles for each Line [$i][$g_bGridlines] = Draw GridLines flag [$i][$g_iGridColor] = GridLines Color Value [$i][$g_iX_counter] = Counter for X GridLines [$i][$g_iY_counter] = Counter for Y GridLines [$i][$g_iX_counter_mem] = Original Counter Value #ce #EndRegion Global Variables and Constants #Region Public Functions ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_CreateGraph ; Description ...: Creates a Scrolling Line Graph ; Syntax.........: _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrement_Total, $Line_Color = 0xFF00FF00, $iBackGround = 0xFF000000) ; Parameters ....: $hGUI - Handle to parent or owner window ; $iLeft - Left side of the graph ; $iTop - Top side of the graph ; $iWidth - Width of the graph ; $iHeight - Height of the graph ; $iY_Min - Minimum Y Value ; $iY_Max - Maximum Y Value ; $iIncrements - How many parts the Graph is divided up into. More Parts means more history.. ; $Line_Color - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Green ; $iLine_Width - Line Width. Default = 1 ; $iBackGround - BackGround Color. Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Black ; $bGridlines - Enable Gridlines. Default = True ; Return values .: Success - Graph Index ; Author ........: Beege ; Remarks .......: Line index of line created is 1. ; =============================================================================================================================== Func _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrements, $Line_Color = 0xFF00FF00, $iLine_Width = 2, $iBackGround = 0xFF000000, $bGridlines = True) ReDim $aGraphs[UBound($aGraphs) + 1][UBound($aGraphs, 2)] $aGraphs[0][0] += 1 If $Line_Color = -1 Or $Line_Color = Default Then $Line_Color = 0xFF00FF00 If $iBackGround = -1 Or $iBackGround = Default Then $iBackGround = 0xFF000000 If $iLine_Width = -1 Or $iLine_Width = Default Then $iLine_Width = 2 If $bGridlines = -1 Or $bGridlines = Default Then $bGridlines = True $aGraphs[$aGraphs[0][0]][$g_hGraphic] = _GDIPlus_GraphicsCreateFromHWND($hGUI) $aGraphs[$aGraphs[0][0]][$g_hBitmap] = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $aGraphs[$aGraphs[0][0]][$g_hGraphic]) $aGraphs[$aGraphs[0][0]][$g_hBuffer] = _GDIPlus_ImageGetGraphicsContext($aGraphs[$aGraphs[0][0]][$g_hBitmap]) $aGraphs[$aGraphs[0][0]][$g_iLeft] = $iLeft $aGraphs[$aGraphs[0][0]][$g_iTop] = $iTop $aGraphs[$aGraphs[0][0]][$g_iWidth] = $iWidth $aGraphs[$aGraphs[0][0]][$g_iHeight] = $iHeight $aGraphs[$aGraphs[0][0]][$g_iIncrements] = $iIncrements $aGraphs[$aGraphs[0][0]][$g_iIncrement_Size] = Int($iWidth / $iIncrements) $aGraphs[$aGraphs[0][0]][$g_iShift_Distance] = $iWidth - $aGraphs[$aGraphs[0][0]][$g_iIncrement_Size] _SLG_AddLine($aGraphs[0][0], $Line_Color, $iLine_Width) $aGraphs[$aGraphs[0][0]][$g_iY_Min] = $iY_Min $aGraphs[$aGraphs[0][0]][$g_iY_Max] = $iY_Max _SLG_SetYRange($aGraphs[0][0], $iY_Min, $iY_Max) $aGraphs[$aGraphs[0][0]][$g_hDC] = _WinAPI_GetDC($hGUI) $aGraphs[$aGraphs[0][0]][$g_hGUI] = $hGUI _SLG_SetBackGroundColor($aGraphs[0][0], BitOR($iBackGround, 0xFF000000)) $aGraphs[$aGraphs[0][0]][$g_bGridlines] = $bGridlines $aGraphs[$aGraphs[0][0]][$g_iX_counter] = 20;$iX_c $aGraphs[$aGraphs[0][0]][$g_iX_counter_mem] = 20;$iX_c $aGraphs[$aGraphs[0][0]][$g_iY_counter] = 20;$iY_c $aGraphs[$aGraphs[0][0]][$g_iGridColor] = Default _GDIPlus_GraphicsSetSmoothingMode($aGraphs[$aGraphs[0][0]][$g_hBuffer], 2) _GDIPlus_GraphicsClear($aGraphs[$aGraphs[0][0]][$g_hBuffer], $aGraphs[$aGraphs[0][0]][$g_iBackColor]); If $bGridlines Then _FullGridLines($aGraphs[0][0]) Return $aGraphs[0][0] EndFunc ;==>_SLG_CreateGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_UpdateGraph ; Description ...: Updates Line Graph with new values ; Syntax.........: _SLG_UpdateGraph($iIndex, $iValue) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All Lines of the graph must be updated before calling this function. ; =============================================================================================================================== Func _SLG_UpdateGraph($iIndex) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aLineY = $aGraphs[$iIndex][$g_iY] For $i = 1 To $aLineY[0] If Not $aLineY[$i] Then Return Next Local $hShift_Section = _GDIPlus_BitmapCloneArea($aGraphs[$iIndex][$g_hBitmap], $aGraphs[$iIndex][$g_iIncrement_Size], 0, $aGraphs[$iIndex][$g_iShift_Distance], $aGraphs[$iIndex][$g_iHeight]); _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); _GDIPlus_GraphicsDrawImageRect($aGraphs[$iIndex][$g_hBuffer], $hShift_Section, 0, 0, $aGraphs[$iIndex][$g_iShift_Distance], $aGraphs[$iIndex][$g_iHeight]) If $aGraphs[$iIndex][$g_bGridlines] Then _AddGridLines($iIndex) Local $aLineYLast = $aGraphs[$iIndex][$g_iY_Last] Local $aPens = $aGraphs[$iIndex][$g_aPens] For $i = 1 To $aLineYLast[0] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iShift_Distance] - 1, $aLineYLast[$i], $aGraphs[$iIndex][$g_iWidth] - 1, $aLineY[$i], $aPens[$i]) Next _WriteBuffer($iIndex) _GDIPlus_BitmapDispose($hShift_Section) For $i = 1 To $aLineY[0] $aLineYLast[$i] = $aLineY[$i] Next $aGraphs[$iIndex][$g_iY_Last] = $aLineYLast Return 1 EndFunc ;==>_SLG_UpdateGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineValue ; Description ...: Sets Line value ; Syntax.........: _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Value to add to graph ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $iValue > $aGraphs[$iIndex][$g_iY_Max] Then $iValue = $aGraphs[$iIndex][$g_iY_Max] ElseIf $iValue < $aGraphs[$iIndex][$g_iY_Min] Then $iValue = $aGraphs[$iIndex][$g_iY_Min] EndIf Local $Percent = Abs($iValue - $aGraphs[$iIndex][$g_iY_Min]) / $aGraphs[$iIndex][$g_iY_Range] If $Percent > .992 Then $Percent = .992 Local $iY = Int($aGraphs[$iIndex][$g_iHeight] - ($Percent * $aGraphs[$iIndex][$g_iHeight])) Local $aLineYLast = $aGraphs[$iIndex][$g_iY_Last] If Not $aLineYLast[$iLine] Then $aLineYLast[$iLine] = $iY $aGraphs[$iIndex][$g_iY_Last] = $aLineYLast Return 0 Else Local $aLineY = $aGraphs[$iIndex][$g_iY] $aLineY[$iLine] = $iY $aGraphs[$iIndex][$g_iY] = $aLineY Return 1 EndIf EndFunc ;==>_SLG_SetLineValue ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_AddLine ; Description ...: Adds additional lines to the graph ; Syntax.........: _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iLine_Color - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB) ; $Line_Width - Line Width ; Return values .: Success - Line Index ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: Every line must have its value set before you can call _SLG_UpdateGraph() ; =============================================================================================================================== Func _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 2) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $Line_Color = -1 Or $Line_Color = Default Then $Line_Color = 0xFF00FF00 If $Line_Width = -1 Or $Line_Width = Default Then $Line_Width = 1 Local $aLinesY = $aGraphs[$iIndex][$g_iY] Local $aLinesYLast = $aGraphs[$iIndex][$g_iY_Last] Local $aPens = $aGraphs[$iIndex][$g_aPens] If Not IsArray($aLinesYLast) Then Local $aLinesY[1] = [0] Local $aLinesYLast[1] = [0] Local $aPens[1] = [0] EndIf ReDim $aLinesYLast[UBound($aLinesYLast) + 1] ReDim $aLinesY[UBound($aLinesY) + 1] ReDim $aPens[UBound($aPens) + 1] $aLinesYLast[0] += 1 $aLinesY[0] += 1 $aPens[0] += 1 $aLinesYLast[$aLinesYLast[0]] = False $aLinesY[$aLinesY[0]] = False $aPens[$aPens[0]] = _GDIPlus_PenCreate($Line_Color, $Line_Width) $aGraphs[$iIndex][$g_iY_Last] = $aLinesYLast $aGraphs[$iIndex][$g_iY] = $aLinesY $aGraphs[$iIndex][$g_aPens] = $aPens Return $aLinesY[0] EndFunc ;==>_SLG_AddLine ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineColor ; Description ...: Sets Line Color of Graph ; Syntax.........: _SLG_SetLineColor($iIndex, $iARGB) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB) ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid iLine ; - 3 Error setting pen color ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineColor($iIndex, $iARGB, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] If $iLine > $aPens[0] Then Return SetError(2, @extended, 0) _GDIPlus_PenSetColor($aPens[$iLine], $iARGB) If @error Then Return SetError(3, @extended, 0) Return 1 EndFunc ;==>_SLG_SetLineColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineWidth ; Description ...: Sets Line Width ; Syntax.........: _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Width of Line ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid iLine index ; - 3 Error setting pen width ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] If $iLine > $aPens[0] Then Return SetError(2, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] _GDIPlus_PenSetWidth($aPens[$iLine], $iWidth) If @error Then Return SetError(3, @extended, 0) Return 1 EndFunc ;==>_SLG_SetLineWidth ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_ClearGraph ; Description ...: Clears all data from Graph ; Syntax.........: _SLG_ClearGraph($iIndex) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: none ; =============================================================================================================================== Func _SLG_ClearGraph($iIndex) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); If $aGraphs[$iIndex][$g_bGridlines] Then _FullGridLines($iIndex) _WriteBuffer($iIndex) Return 1 EndFunc ;==>_SLG_ClearGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetYRange ; Description ...: Sets the Minimum and Maximum Y Values ; Syntax.........: _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iY_Min - Minimum Y Value ; $iY_Max - Maximum Y Value ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: User should most likly want to ClearGraph after changing Y Range ; =============================================================================================================================== Func _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iY_Min] = $iY_Min $aGraphs[$iIndex][$g_iY_Max] = $iY_Max $aGraphs[$iIndex][$g_iY_Range] = Abs($iY_Max - $iY_Min) Return 1 EndFunc ;==>_SLG_SetYRange ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetBackGroundColor ; Description ...: Sets Graph BackGround Color ; Syntax.........: _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iARGB - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Black ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All previous data will be cleared ; =============================================================================================================================== Func _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iBackColor] = $iARGB _SLG_ClearGraph($iIndex) Return 1 EndFunc ;==>_SLG_SetBackGroundColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetGridLineColor($iIndex) ; Description ...: Sets Graph GridLines Color Value ; Syntax.........: _SLG_SetGridLineColor($iIndex, $iARGB = Default) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iARGB - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Invert of Background Color. ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All previous data will be cleared ; =============================================================================================================================== Func _SLG_SetGridLineColor($iIndex, $iARGB = Default) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iGridColor] = $iARGB _SLG_ClearGraph($iIndex) Return 1 EndFunc ;==>_SLG_SetGridLineColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_EnableGridLines ; Description ...: Enables or Disables Drawing of Gridlines for Graph ; Syntax.........: _SLG_EnableGridLines($iIndex, $bGridlines = True) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $bGridlines - GridLines flag: ; |True - GridLines will be drawn ; |False - GridLines will not be drawn ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid $bGridlines Value ; Author ........: Beege ; Remarks .......: none ; =============================================================================================================================== Func _SLG_EnableGridLines($iIndex, $bGridlines = True) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $bGridlines <> True And $bGridlines <> False Then SetError(2, @extended, 0) $aGraphs[$iIndex][$g_bGridlines] = $bGridlines Return 1 EndFunc ;==>_SLG_EnableGridLines #EndRegion Public Functions #Region Internel Functions ; #FUNCTION# ==================================================================================================================== ; Author ........: UEZ ; Modified ......: Beege ; =============================================================================================================================== Func _AddGridLines($iIndex) Local $iGridlineColor = $aGraphs[$iIndex][$g_iGridColor] If $iGridlineColor = Default Or $iGridlineColor = -1 Then $iGridlineColor = BitOR(0xFF000000, (0xFFFFFFFF - $aGraphs[$iIndex][$g_iBackColor]));Invert Background RGB Local $iY1, $hPen = _GDIPlus_PenCreate($iGridlineColor) For $iY1 = 0 To $aGraphs[$iIndex][$g_iHeight] Step $aGraphs[$iIndex][$g_iY_counter] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iShift_Distance] - 1, $iY1, $aGraphs[$iIndex][$g_iWidth], $iY1, $hPen) Next If $aGraphs[$iIndex][$g_iX_counter] <= 0 Then _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iWidth] - 1, 0, $aGraphs[$iIndex][$g_iWidth] - 1, $aGraphs[$iIndex][$g_iHeight], $hPen) $aGraphs[$iIndex][$g_iX_counter] = $aGraphs[$iIndex][$g_iX_counter_mem] EndIf $aGraphs[$iIndex][$g_iX_counter] -= $aGraphs[$iIndex][$g_iIncrement_Size] _GDIPlus_PenDispose($hPen) EndFunc ;==>_AddGridLines Func _FullGridLines($iIndex) Local $iGridlineColor = $aGraphs[$iIndex][$g_iGridColor] If $iGridlineColor = Default Or $iGridlineColor = -1 Then $iGridlineColor = BitOR(0xFF000000, (0xFFFFFFFF - $aGraphs[$iIndex][$g_iBackColor]));Invert Background RGB Local $iY1, $hPen = _GDIPlus_PenCreate($iGridlineColor) Local $hShift_Section = _GDIPlus_BitmapCloneArea($aGraphs[$iIndex][$g_hBitmap], 0, 0, $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight]); _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); _GDIPlus_GraphicsDrawImageRect($aGraphs[$iIndex][$g_hBuffer], $hShift_Section, 0, 0, $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight]) For $iY1 = 0 To $aGraphs[$iIndex][$g_iHeight] Step $aGraphs[$iIndex][$g_iY_counter] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], 0, $iY1, $aGraphs[$iIndex][$g_iWidth], $iY1, $hPen) Next For $iX = 0 To $aGraphs[$iIndex][$g_iWidth] Step $aGraphs[$iIndex][$g_iIncrement_Size] If $aGraphs[$iIndex][$g_iX_counter] <= 0 Then _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $iX, 0, $iX, $aGraphs[$iIndex][$g_iHeight], $hPen) $aGraphs[$iIndex][$g_iX_counter] = $aGraphs[$iIndex][$g_iX_counter_mem] EndIf $aGraphs[$iIndex][$g_iX_counter] -= $aGraphs[$iIndex][$g_iIncrement_Size] Next _WriteBuffer($iIndex) _GDIPlus_BitmapDispose($hShift_Section) _GDIPlus_PenDispose($hPen) EndFunc ;==>_FullGridLines Func _WriteBuffer($iIndex) Local $hGDI_HBitmap, $hDC $hGDI_HBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($aGraphs[$iIndex][$g_hBitmap]) $hDC = _WinAPI_CreateCompatibleDC($aGraphs[$iIndex][$g_hDC]) _WinAPI_SelectObject($hDC, $hGDI_HBitmap) _WinAPI_BitBlt($aGraphs[$iIndex][$g_hDC], $aGraphs[$iIndex][$g_iLeft], $aGraphs[$iIndex][$g_iTop], $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight], $hDC, 0, 0, $SRCCOPY) _WinAPI_DeleteObject($hGDI_HBitmap) _WinAPI_DeleteDC($hDC) EndFunc ;==>_WriteBuffer Func _SLG_Exit() Local $i, $j, $aPens If $aGraphs[0][0] Then For $i = 1 To $aGraphs[0][0] _GDIPlus_GraphicsDispose($aGraphs[$i][$g_hBuffer]) _GDIPlus_BitmapDispose($aGraphs[$i][$g_hBitmap]) _GDIPlus_GraphicsDispose($aGraphs[$i][$g_hGraphic]) $aPens = $aGraphs[$i][$g_aPens] For $j = 1 To $aPens[0] _GDIPlus_PenDispose($aPens[$j]) Next _WinAPI_ReleaseDC($aGraphs[$i][$g_hGUI], $aGraphs[$i][$g_hDC]) Next EndIf _GDIPlus_Shutdown() EndFunc ;==>_SLG_Exit #EndRegion Internel Functions SLG.au3 Previous DL = 55
    1 point
  10. rysiora

    WebCam example

    $WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START +100 $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_ABORT = $WM_CAP_START + 69 $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46 $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43 $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41 $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42 $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14 $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12 $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12 $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13 $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13 $WM_CAP_EDIT_COPY = $WM_CAP_START + 30 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22 $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21 $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21 $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23 $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23 $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25 $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20 $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20 $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24 $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36 $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1 $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67 $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67 $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65 $WM_CAP_GET_STATUS = $WM_CAP_START + 54 $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8 $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44 $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83 $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84 $WM_CAP_PAL_OPENA = $WM_CAP_START + 80 $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80 $WM_CAP_PAL_PASTE = $WM_CAP_START + 82 $WM_CAP_SEQUENCE = $WM_CAP_START + 62 $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63 $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35 $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85 $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2 $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2 $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5 $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3 $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3 $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6 $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7 $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4 $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66 $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WM_CAP_SET_SCROLL = $WM_CAP_START + 55 $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64 $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9 $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45 $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72 $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71 $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70 $WM_CAP_STOP = $WM_CAP_START + 68 #include <GUIConstants.au3> $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") $snapfile = @ScriptDir & "\scrshot.bmp" $Main = GUICreate("Camera",350,270) $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 15, "int", 15, "int", 320, "int", 240, "hwnd", $Main, "int", 1) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0) GUISetState(@SW_SHOW) HotKeySet("{INSERT}", "SnapShot"); Press 'Insert' to make a SnapShot ! While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ;DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_CALLBACK_FRAME, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) ;DllClose($avi) DllClose($user) Exit EndIf Sleep(1) Wend Func SnapShot() DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $snapfile) EndFunc Maybe someone would find it useful. Insert is the HotKey for making photos.
    1 point
×
×
  • Create New...