Jump to content

Search the Community

Showing results for tags 'Resource'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 8 results

  1. Function Reference _GUIResourcePic.au3 Functions related to the image control in the GUI. Sintax: _GUICtrlPic_Create( FileName, Left, Top [, Width [, Height [, Style [, ExStyle ]]]]]] ) _GUICtrlPic_SetImage( controlID, FileName [, FixSize ]]) _GUICtrlPic_Delete( controlID ) _GUICtrlPic_Release( controlID ) _GUICtrlPic_SetState( controlID, state ) _GUICtrlPic_GetInfo( FileName or Control ID ) Supports: ; Images in the format: .bmp, .jpg, .png, .gif {animated} and other formats of files for resources (.exe, .dll, .ocx, .cpl...). ; For the "resources", use the "FileName" in this format: "MyFile.ext|RessourceName|ResourceType". ; It can be a URL path as well! Download: Version: 1.8.2012.2600b _GUIResourcePic_(RedirectLink).html 17.0k (Previous downloads: 140) Example_Include_HD_GIF_(RedirectLink).html 36.08k (Previous downloads: 135) Note: Added new function! I've made significant changes in the code, including the syntax of some functions! Now uses GDI+ to render the images. Example of use is included! Sample: CPU in 0,60%. http://www.youtube.com/watch?v=NZZB-G9C1Kg Direct download: _GUIResourcePic.mp4 Fixes: $GUI_GIFSTART ; If image is GIF animated, start/resume animation! $GUI_GIFSTOP ; If image is GIF animated, stop/pause animation! ;----> Style (GIS = Gif Image Styles) $GIS_ASPECTRATIOFIX ; Fix the image size based on aspect ratio. $GIS_HALFTRANSPARENCY ; The images are rendered with the window background color. This Style is default. $GIS_FULLTRANSPARENCY ; The frames are rendered in full transparency independent of the background color of the window! Note: This Style consumes more CPU because the exstyle $WS_EX_TRANSPARENT is added to each frame in real time! Not valid if the image does not have transparency! ;----> Default Style to _GUICtrlPic_Create()! $GIS_SS_DEFAULT_PIC = BitOR($GIS_HALFTRANSPARENCY, $SS_NOTIFY) ;----> ExStyle (GIS_EX = Gif Image Extended Styles) $GIS_EX_DEFAULTRENDER ; To use _GUIImageList_Draw in rendering of images, use less CPU. This ExStyle is default! $GIS_EX_CTRLSNDRENDER ; The frames is render using GUICtrlSendMsg, but consumes much more CPU!!! Note: If you use this ExStyle, only $GRP_FULLTRANSPARENCY is used for rendering images! 1.02b 09/05/2012 -> After updating the code, the images with transparency were not being shown as they should, changed code again!09/05/2012 -> Fixes in the _GUICtrlPic_SetImage() function, the measures were not being updated according to the parameter FixSiz , identified by @Belini, thank you!Regards, João Carlos.
  2. I get the following error on compiling. All files defined in the resources to add exists. The exe file is created but when executing a pop-up window is shown with the message "File exists ?" >22:51:25 Performing the Program Resource Update steps: !>22:51:25 Error: Failed to get script data from end of target file. Skipping resource update.rc:2
  3. Which of the two should I use? It seems pragma compile offers access to resource fields that AutoIt3Wrapper only allows access to via Res_Field, such as CompanyName and ProductName. AutoIt3Wrapper offers help with versioning in the form of automatic version increase, pragma doesn't. (afaik) Should one ever combine the two in one script? Could I e.g. increase the ProductVersion automatically as well with AutoIt3Wrapper? I'm using the Beta, 3.3.13.19 with Scite 3.4.4 Full as well as TortoiseSVN and WinMerge.
  4. A3X Script Extract With newer versions of AutoIT (v3.3.10.0+), the compiled script is no longer appended to files as an overlay, and instead is embedded as a binary resource. This leads my previous AutoIt-script detection UDF lacking. However, since that UDF (>PE File Overlay Extraction) was targeted towards overlays in general, its still a worthwhile tool to have. This UDF on the other hand is pretty specific - it lets you detect and optionally extract A3X scripts from a compiled executable. The method is rather straightforward - it looks for a resource type of RT_RCDATA with a resource name of "SCRIPT", and then extracts the binary, testing for the A3X signature along the way. The main UDF has two functions: _FileContainsScriptResource() _FileContainsA3XScript() The first of these functions is there only for checking if a resource with "SCRIPT" exists. Its main purpose is to report on possible embedded scripts. I made this a separate function primarily because of issues with compressed executables. Tools like UPX and MPRESS can compress the resources as well as the rest of the executable, so any detection of the A3X signature will fail in those circumstances. (Note that UPX and MPRESS don't compress overlay data, which is why the older Overlay-Extraction A3X-detection worked regardless) The second function will both check for and optionally return the A3X script resource as binary. It also does a signature check for verification. Anyway, here's an example of its usage. The main UDF is attached below. #include <_FileContainsA3XScript.au3> ; ======================================================================================================== ; <A3XScriptExtract.au3> ; ; Example of detecting AutoIt Scripts embedded as binary resources (in AutoIt v3.3.10.0+ exe's), and ; extracting them to .A3X files. ; ; This script can be invoked in interactive or command-line mode. ; Passing an executable as a parameter will extract an A3X resource, writing it out to ; an A3X file with the same base name as the executable. ; ; Uses <_FileContainsA3XScript.au3> functions ; ; Author: Ascend4nt ; ======================================================================================================== ; ---------------------- MAIN CODE ------------------------------- Local $sFile, $sLastDir, $sLastFile, $binA3X, $iErr, $nA3XSize ; Command-line parameter received? Simply do a direct A3X extraction If $CmdLine[0] Then $sFile = $CmdLine[1] If Not FileExists($sFile) Then Exit 1 $binA3X = _FileContainsA3XScript($sFile, True) If @error Then Exit @error $nA3XSize = @extended Local $nExt = StringInStr($sFile, '.', 0, -1) If $nExt Then $sFile = StringLeft($sFile, $nExt - 1) EndIf $sFile &= '.a3x' Exit Not FileWrite($sFile, $binA3X) EndIf ; No command-line parameters, query the user in interactive mode $sLastDir = @ScriptDir While 1 $sFile=FileOpenDialog("Select PE File To Look for Embedded A3X scripts In",$sLastDir,"PE Files (*.exe;*.dll;*.scr)|All Files (*.*)",3,$sLastFile) If @error Or $sFile="" Then Exit $sLastFile = StringMid($sFile, StringInStr($sFile, '\', 1, -1) + 1) $sLastDir = StringLeft($sFile, StringInStr($sFile, '\', 1, -1) - 1) ; Resource 'Script' check $bScriptResourceFound = _FileContainsScriptResource($sFile) ConsoleWrite("_FileContainsScriptResource() return: " & $bScriptResourceFound & ", @error = " & @error & ", @extended = " & @extended & @CRLF) ; Actual A3X script resource check. True to return the A3X script as binary $binA3X = _FileContainsA3XScript($sFile, True) $iErr = @error $nA3XSize = @extended ; No A3X script found? If $iErr Or $nA3XSize = 0 Then ConsoleWrite("Failed Return from _FileContainsA3XScript(), @error = " & $iErr & ", @extended = " & $nA3XSize & @CRLF) MsgBox(64, "No AutoIt A3X script resource Found", "AutoIt A3X script resource not Found!" & @CRLF & _ ($bScriptResourceFound ? "However, *A* script resource was found" : "No 'Script' resource found either") & @CRLF & _ "for '" & $sLastFile & "'") ContinueLoop EndIf ConsoleWrite("_FileContainsA3XScript() return type: " & VarGetType($binA3X) & ", value = " & (IsBinary($binA3X) ? "[A3X_Binary]" : $binA3X) & @CRLF) ConsoleWrite(@TAB & "@error = " & $iErr & ", @extended = " & $nA3XSize & @CRLF) Local $hFileOut = -1, $sOutFile, $iMsgBox, $bSuccess = 0 $iMsgBox = MsgBox(35, "A3X script resource found in " & $sLastFile, "A3X script resource found. File size: " & FileGetSize($sLastFile) & _ ", A3X script size: " & $nA3XSize & @CRLF & @CRLF & _ "Would you like to Extract and save A3X file?") If $iMsgBox = 6 Then ;~ If $nA3XSize > 134217728 Then ;~ MsgBox(48, "A3X script is too huge", "A3X script size is > 128MB, skipping..") ;~ ContinueLoop ;~ EndIf $sOutFile = FileSaveDialog("A3X script - SAVE: Choose a file to write A3X script data to (from " & $sLastFile&")", _ $sLastDir, "AutoIt Compiled Sript (*.a3x)|All (*.*)", 2 + 16) If @error Then ContinueLoop ; Simple check for extension - if none, add .a3x If StringInStr($sOutFile, '.') = 0 Then $sOutFile &= ".a3x" ; Else $hFileOut = FileOpen($sOutFile, 16 + 2) If $hFileOut <> - 1 Then $bSuccess = FileWrite($hFileOut, $binA3X) FileClose($hFileOut) EndIf Else ContinueLoop EndIf If $bSuccess Then ShellExecute(StringLeft($sOutFile,StringInStr($sOutFile,'\',1,-1)-1)) Else MsgBox(64, "Error Opening or writing to file", "Error opening, reading, or saving A3X file") EndIf WEnd Exit _FileContainsA3XScript.au3 *edit: Modified example: Now alternatively accepts a command-line parameter for automated script extraction
  5. First of all, I would like to thank those who helped me immensely on this script: guinness Edano and as well thank those who's script's I barrowed from: Melba23 guinness BrewManNH (if i missed anyone I apologize) I have learned a great deal in a short amount of time, and I certainly couldn't have without the aid of the members of this forum. I've rarely came upon a forum that had such a great community as this, they truly are gems hidden away in the land of internwebs. I made this (with the help of others, which without it this would be a crap script) to aid me in my work, and I hope it helps you with yours as well. If not then at least it's here to serve as an example for others. ResourceManager.au3 CODE: Installation: Description: This tool is used to create a yourscriptname_res.txt file that is associated with your script. This file contains the file paths of all the resources you plan to use in your script for easy access and insertion. Usage Instructions: Tips & Pointers: Changes I Want to Include in An Update: Update: ResourceManager_v2 (a seperate version, see below) Here's an alternate version that runs from a "Resources" file: CODE: You must create a folder named "ResourceManager_v2" in your "Autoit3" folder, also it assumes that the "Autoit3" folder is in your "Program FIles" folder. If it isn't then for now you'll need to change the $ResFileDir variable and all it's occurences to match, UNTIL I update it to find your "Autoit3" folder wherever it is... likely easy peasy but I'm tired and need sleep. This version gives the user the ability to set their own resource file as well in the settings dialogue... ENJOY! Thank you all, Wombat
  6. So here is a current SciTE tool I'm working on, I need a little help finishing it up. I need to have the main gui read the _res.profile that's associated with the script in the focused tab in SciTE... I need it to enter the selected file path at the insertoin cursor in SciTE... anyone wanna throw in on this one? #region;;;;;;;;;;;;;;;SciTE Resource Manager;;;;;;;;;;;;;;;;;;; ;;;;;created by Wombat with help from Melba23, guinness, and Edano;;;;;; #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <File.au3> #include <SendMessage.au3> #include <Misc.au3> Opt("GUIOnEventMode", 1) #NoTrayIcon #region ;;;GUI starts here;;;; $hGUI_Main = GUICreate("Resource Manager", 448, 603, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "MainGUIClose") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore") $List1 = GUICtrlCreateList("", 0, 0, 446, 565) $Options = GUICtrlCreateButton("SHOW OPTIONS", 5, 568, 305, 33) GUICtrlSetOnEvent(-1, "OptionsClick") $Options = GUICtrlCreateButton("REFRESH", 350, 568, 65, 33) GUICtrlSetOnEvent(-1, "RefreshClick") $cDrop_Dummy = GUICtrlCreateDummy() GUICtrlSetOnEvent(-1, "_On_Drop") Global $aDrop_List Global $List1Data GUISetState(@SW_SHOW) #endregion ;;;;;GUI ends here;;;;;6 #region ;;;These register a user defined function for a known Windows Message ID;;;; GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") GUIRegisterMsg(0x233, "On_WM_DROPFILES");<--- This is how the GUI registers the dropped files #endregion ;;;;;;; #region ;;;This is the startup action that populates the ResourceManager's listbox;;; Global $List1Data Global $WinTitle = WinGetTitle('[CLASS:SciTEWindow]') Local $sFilePath = StringRegExpReplace($WinTitle, '^(\V+)(?:\h[-*]\V+)$', '\1') _FileReadToArray($sFilePath & "_res.txt", $List1Data) $ListDef = _ArrayToString($List1Data) GUICtrlSetData($List1, $ListDef) #endregion ;;;;;;;;;;;; While 1 Sleep(10) WEnd #region ;;;;Functions start here;;;;;; Func MainGUIClose();<---- This exits the script and stops the process Exit EndFunc Func RefreshClick();<----This refreshs the Resource Manager's ListBox GUICtrlSetData($List1, "") Local $sFilePath = StringRegExpReplace($WinTitle, '^(\V+)(?:\h[-*]\V+)$', '\1') _FileReadToArray($sFilePath & "_res.txt", $List1Data) $ListDef = _ArrayToString($List1Data) GUICtrlSetData($List1, $ListDef) EndFunc Func OptionsClick();<---- This calls up another gui which edits the contents of the resource file $hGUI = GUICreate("RM Options", 375, 376, 300, 124, Default, $WS_EX_ACCEPTFILES) GUISetOnEvent($GUI_EVENT_CLOSE, "OptionsClose") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore") Global $List2 = GUICtrlCreateList("", 0, -1, 283, 381, $LBS_EXTENDEDSEL) Global $bDeleteSel = GUICtrlCreateButton("Delete Selection", 285, 40, 89, 33) GUICtrlSetOnEvent(-1, "DelSel") Global $bClearAll = GUICtrlCreateButton("Clear All", 299, 88, 73, 33) GUICtrlSetOnEvent(-1, "ClearAll") Global $bGenerate = GUICtrlCreateButton("Generate", 315, 320, 57, 41) GUICtrlSetOnEvent(-1, "GenerateProf") Global $Label1 = GUICtrlCreateLabel("Edit Resource List", 285, 8, 90, 17) Global $Label2 = GUICtrlCreateLabel("Generate", 320, 264, 48, 17) Global $Label3 = GUICtrlCreateLabel("Resource Profile", 295, 288, 82, 17) Global $cDrop_Dummy = GUICtrlCreateDummy() GUICtrlSetOnEvent(-1, "_On_Drop") Global $aDrop_List GUISetState(@SW_SHOW) EndFunc Func _On_Drop() ;<---- This populates the Options Window's ListBox with the items draged&dropped onto it For $i = 1 To $aDrop_List[0] GUICtrlSetData($List2, $aDrop_List[$i]) Next EndFunc ;==>_On_Drop Func On_WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam);<---- This is how the GUI registers the dropped files ; Credit to ProgAndy for DLL calls #forceref $hWnd, $iMsg, $lParam Local $iSize, $pFileName ; Get number of files dropped Local $aRet = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 0) ; Reset array to correct size Global $aDrop_List[$aRet[0] + 1] = [$aRet[0]] ; And add item names For $i = 0 To $aRet[0] - 1 $aRet = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0) $iSize = $aRet[0] + 1 $pFileName = DllStructCreate("wchar[" & $iSize & "]") DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($pFileName), "int", $iSize) $aDrop_List[$i + 1] = DllStructGetData($pFileName, 1) $pFileName = 0 Next ; Send the count to trigger the drop function in the main loop GUICtrlSendToDummy($cDrop_Dummy, $aDrop_List[0]) EndFunc ;==>On_WM_DROPFILES Func DelSel();<---- This deletes the item selected in the Options Window ListBox Local $a_SelectedItems = _GUICtrlListBox_GetSelItems($List2) For $i = $a_SelectedItems[0] To 1 Step -1 _GUICtrlListBox_DeleteString($List2, $a_SelectedItems[$i]) Next EndFunc Func ClearAll();<---- This clears the contents of the ListBox in the Options Window GUICtrlSetData($List2, "") EndFunc Func GenerateProf();<---- This creates the resource profile $FileCount = _GUICtrlListBox_GetCount($List2) $FileList[$FileCount + 1] For $i = 0 To $FileCount $FileList[$i] = _GUICtrlListBox_GetText($List2, $i) Next _ArrayDelete($FileList, $i) _FileWriteFromArray($sFilePath & "_res.txt", $FileList) EndFunc Func OptionsClose();<----This closes the Options Window leaving the MainGUI open !if Exit is used here it will close both windows! GUIDelete("RM Options") EndFunc Func Form1Minimize() EndFunc Func Form1Restore() EndFunc Func _SciTE_InsertText($sString);<---- This inserts the item double-clicked in the ListBox in the Resource Manager's window $sString = StringReplace($sString, '\', '\\') _SciTE_ReplaceMarcos($sString) Return _SciTE_Send_Command(0, _SciTE_WinGetDirector(), 'insert:' & $sString) EndFunc ;==>_SciTE_InsertText Func _SciTE_ReplaceMarcos(ByRef $sString) $sString = StringReplace($sString, @TAB, '\t') $sString = StringReplace($sString, @CR, '\r') $sString = StringReplace($sString, @LF, '\n') EndFunc ;==>_SciTE_ReplaceMarcos Func _SciTE_WinGetDirector() Return WinGetHandle('DirectorExtension') EndFunc ;==>_SciTE_WinGetDirector Func _SciTE_Send_Command($hHandle, $hSciTE, $sString) Local $ilParam, $tData If StringStripWS($sString, 8) = "" Then Return SetError(2, 0, 0) ; String is blank. EndIf $sString = ":" & Dec(StringTrimLeft($hHandle, 2)) & ":" & $sString $tData = DllStructCreate("char[" & StringLen($sString) + 1 & "]") ; wchar DllStructSetData($tData, 1, $sString) $ilParam = DllStructCreate("ptr;dword;ptr") ; ulong_ptr;dword;ptr DllStructSetData($ilParam, 1, 1) ; $ilParam, 1, 1 DllStructSetData($ilParam, 2, DllStructGetSize($tData)) DllStructSetData($ilParam, 3, DllStructGetPtr($tData)) _SendMessage($hSciTE, $WM_COPYDATA, $hHandle, DllStructGetPtr($ilParam)) Return Number(Not @error) EndFunc ;==>_SciTE_Send_Command Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam);<---- This reads the item that is double-clicked in the ListBox in the Resource Manager's window #forceref $hWnd, $iMsg, $lParam $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word $iCode = BitShift($wParam, 16) ; Hi Word Switch $iCode Case $LBN_DBLCLK Switch $iIDFrom Case $List1 $QMark= Chr(34) $sData = GUICtrlRead($List1) ; Use the native function _SciTE_InsertText($QMark & $sData & $QMark) EndSwitch EndSwitch EndFunc #endregion ;;;;;Functions End Here;;;;; #endregion CODE updated per release thread in Example Scripts, to keep it consistent...
  7. I was troubleshooting behavior of a script and was looking at Process Explorer and I noticed that processes that I started using an AutoIT script are void of details such as Description and Company Name. The associated Icon is also generic in Process Explorer. I also have the lower pane open in Process Explorer and I'm noticing that associated DLLS are not listed. If I right click on an application and click on "properties" and look at the Strings tab I get "<Error opening file>". I don't remember seeing this behavior before and I will reboot to see if that corrects it. As of now I'm suspecting AutoIT because that is the common element with all the processes exhibiting the behavior described. I'm using AutoIT v3.3.8.1 with SciTE v2.28 on Windows 7 64 bit.
  8. Hi every body! I have a strange problem that i can't solve: I made a GUI with a ToolBar, and i want to display custom icons in it. It's OK if i don't compile the script and i try to add the icons into my ImageList directly from disque, but when i compile and embeed my icons in the Exe file, then my icons wont appear at all! I made a simplified sample GUI to show you my problem, but here, it's another problem: the first added icon won't appear, and the others (2) appear, and the standard compiled script's icons appear normally! I really have a big headach in this! Here is joined my script with the icons, please compile it to see the problem. Thanks! ToolBar icons.zip
×
×
  • Create New...