Zedna Posted February 2, 2010 Author Share Posted February 2, 2010 (edited) I've never used resource files so i don't no what to look for, but when i open the file in ResHack it showed a folder treeIn that case it may be better to use FileInstall() instead of my Resource UDF. It's very simple.Latest Scite4Autoit3 beta has new simpler syntax for adding resources (#AutoIt3Wrapper_Res_File_Add=) and it doesn't need reshacker.exe.After Jos push it from beta to release state I will update my UDF and description accordingly. Edited February 2, 2010 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
PhilipG Posted February 2, 2010 Share Posted February 2, 2010 Well I downloaded the beta version, and no I got the file into the resource file. But it still don't show up, but i guess it's a bit closer! Link to comment Share on other sites More sharing options...
PhilipG Posted February 2, 2010 Share Posted February 2, 2010 Got it to work now! had to change rt_rcdata to "10" but now it works like a glove. thanks! Link to comment Share on other sites More sharing options...
wraithdu Posted February 2, 2010 Share Posted February 2, 2010 That shouldn't be necessary. #AutoIt3Wrapper_Res_File_Add=C:\path\to\file.ext,RT_RCDATA,MYRESOURCENAME should work just fine. Link to comment Share on other sites More sharing options...
PhilipG Posted February 4, 2010 Share Posted February 4, 2010 That shouldn't be necessary.#AutoIt3Wrapper_Res_File_Add=C:\path\to\file.ext,RT_RCDATA,MYRESOURCENAMEshould work just fine.I don't know why, but when i changed from RT_RCDATA to 10 it worked fine, but before it didn't Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 4, 2010 Moderators Share Posted February 4, 2010 (edited) PhilipG,You need to use $RC_DATA, which is a Const value AutoIt understands. Of course, using the actual value of 10 also works as you found. #AutoIt3Wrapper_Res_File_Add=C:\path\to\file.ext,$RT_RCDATA,MYRESOURCENAMEM23Edit: Ignore all this - see below Edited February 4, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Developers Jos Posted February 4, 2010 Developers Share Posted February 4, 2010 (edited) PhilipG, You need to use $RC_DATA, which is a Const value AutoIt understands. Of course, using the actual value of 10 also works as you found. #AutoIt3Wrapper_Res_File_Add=C:\path\to\file.ext,$RT_RCDATA,MYRESOURCENAME M23 Don't think AutoIt3Wrapper will understand a variable. RT_RCDATA is a known sting. Edited February 4, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
wraithdu Posted February 4, 2010 Share Posted February 4, 2010 (edited) What he said AI3Wrapper reads the directive as a string, so it looks for "RT_RCDATA". Yes it also understands integers, which is why 10 works, but there's no reason the string value shouldn't work either. And as I've tested it myself... well, it works. Trying to use an AutoIt variable is useless since these are preprocessor directives and know nothing of the AutoIt script. What version of AutoIt3Wrapper are you testing and where did you get it from? In some earlier builds I hadn't coded the string recognition yet, but those were private alphas. Edited February 4, 2010 by wraithdu Link to comment Share on other sites More sharing options...
PhilipG Posted February 4, 2010 Share Posted February 4, 2010 I tried it on the SciTe Beta version downloaded from autoit website two days ago... Link to comment Share on other sites More sharing options...
wraithdu Posted February 5, 2010 Share Posted February 5, 2010 (edited) Please state the version number exactly and copy your #AutoIt3Wrapper_Res_File_Add= directives here. Edited February 5, 2010 by wraithdu Link to comment Share on other sites More sharing options...
Zedna Posted February 12, 2010 Author Share Posted February 12, 2010 Zedna, in your UDF I found a small bug related to memory leaks when using the _SetBitmapToCtrl(). After reading that, I corrected it. expandcollapse popupFunc _SetBitmapToCtrl($CtrlId, $hBitmap) Local Const $STM_SETIMAGE = 0x0172 Local Const $STM_GETIMAGE = 0x0173 Local Const $IMAGE_BITMAP = 0 Local Const $SS_BITMAP = 0x0E Local Const $GWL_STYLE = -16 Local $hWnd, $hPrev, $Style $hWnd = GUICtrlGetHandle($CtrlId) If $hWnd = 0 Then Return SetError(1, 0, 0) EndIf $Style = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) If @error Then Return SetError(2, 0, 0) EndIf _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, BitOR($Style, $SS_BITMAP)) If @error Then Return SetError(3, 0, 0) EndIf $hPrev = _SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_BITMAP, 0) If $hPrev Then _WinAPI_DeleteObject($hPrev) EndIf _SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap) If @error Then Return SetError(4, 0, 0) EndIf $hPrev = _SendMessage($hWnd, $STM_GETIMAGE, $IMAGE_BITMAP, 0) If (@error) Or ($hBitmap = $hPrev) Then $hBitmap = 0 EndIf If $hBitmap Then _WinAPI_DeleteObject($hBitmap) EndIf Return 1 EndFunc ;==>_SetBitmapToCtrl With this version doesn't work correctly my example from first post using animated GIFs resource_test_ani_gif.au3 so I will stick with my old version: ... $hPrev = _SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap) If @error Then Return SetError(3, 0, 0) If $hPrev Then _WinAPI_DeleteObject($hPrev) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted February 12, 2010 Author Share Posted February 12, 2010 (edited) Updated first post: 2010-02-12 - all examples now use fixed #AutoIt3Wrapper_Res_File_Add directive from latest Scite4Autoit3 (no need for ResHacker.exe) - added support for buttons (also checkboxes,radiobuttons,groupboxes) in _ResourceSetImageToCtrl()/_SetBitmapToCtrl() thanks Melba EDIT: Also renamed title of this topic ;-) Edited February 12, 2010 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted February 12, 2010 Author Share Posted February 12, 2010 (edited) Just one note to adding data to resources by AutoIt3Wrapper directive:#AutoIt3Wrapper_Res_File_Add=FileName, ResType, ResNameAccording to AutoIt3Wrapper sources - as ResType can be used these (case insensitive):Local $aRESOURCE_TYPES[24] = _ ["RT_CURSOR", "RT_BITMAP", "RT_ICON", "RT_MENU", "RT_DIALOG", "RT_STRING", "RT_FONTDIR", "RT_FONT", "RT_ACCELERATOR", _ "RT_RCDATA", "RT_MESSAGETABLE", "RT_GROUPCURSOR", "", "RT_GROUPICON", "", "RT_VERSION", "RT_DLGINCLUDE", "", "RT_PLUGPLAY", _ "RT_VXD", "RT_ANICURSOR", "RT_ANIICON", "RT_HTML", "RT_MANIFEST"] Edited February 12, 2010 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
guinness Posted March 28, 2010 Share Posted March 28, 2010 For those who use the full version of SciTe and wish for the following commands to show in the command popup box, I have created entries for <au3.user.calltips.api> and <au3.userudfs.properties> (Located in the api and properties folders)Add the following to <au3.user.calltips.api>_ResourceGet($ResName [, $ResType [, $ResLang [, $DLL]]]) Get from Resource (as a pointer) (Requires: #Include <Resources.au3>) _ResourceGetAsBitmap($ResName [, $ResType [, $DLL]]) Get from Resource as a Bitmap Image (Requires: #Include <Resources.au3>) _ResourceGetAsBytes($ResName [, $ResType [, $ResLang [, $DLL]]]) Return bytes of Resource (Requires: #Include <Resources.au3>) _ResourceGetAsImage($ResName [, $ResType [, $DLL]]) Get Picture from Resource as hImage type (Requires: #Include <Resources.au3>) _ResourceGetAsString($ResName [, $ResType [, $ResLang [, $DLL]]]) Get String from Resource (Requires: #Include <Resources.au3>) _ResourceGetAsStringW($ResName [, $ResType [, $ResLang [, $DLL]]]) Get String from Resource (Unicode) (Requires: #Include <Resources.au3>) _ResourcePlaySound($ResName [, $Flag [, $DLL]]) Play Sound from Resource (Requires: #Include <Resources.au3>) _ResourceSaveToFile($FileName, $ResName [, $ResType [, $ResLang [, $CreatePath [, $DLL]]]]) Save Resource to File (Requires: #Include <Resources.au3>) _ResourceSetImageToCtrl($CtrlId, $ResName [, $ResType [, $DLL]]) Set Image to picture control from Resource (Requires: #Include <Resources.au3>) _SetBitmapToCtrl($CtrlId, $hBitmap) Set Bitmap to a Control (Requires: #Include <Resources.au3>)Add the following to <au3.userudfs.properties>au3.keywords.user.udfs=_resourceget _resourcegetasbitmap _resourcegetasbytes _resourcegetasimage _resourcegetasstring \ _resourcegetasstringw _resourceplaysound _resourcesavetofile _resourcesetimagetoctrl _setbitmaptoctrl \The UDF is very helpful...Thanks!-Please edit and re-post if you find any inconsistencies (the descriptions might need changing) UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Zedna Posted March 28, 2010 Author Share Posted March 28, 2010 (edited) For those who use the full version of SciTe and wish for the following commands to show in the command popup box, I have created entries for <au3.user.calltips.api> and <au3.userudfs.properties> (Located in the api and properties folders)...Thanks! That's very good idea.Later I will definitely test it and add it to my first post and to UDF itself.EDIT: What is purpose of <au3.userudfs.properties>? Edited March 28, 2010 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
guinness Posted March 28, 2010 Share Posted March 28, 2010 What is purpose of <au3.userudfs.properties>?From what I can gather au3.userudfs.properties is called when you first type the function into SciTe for the initial search and then au3.user.calltips.api is called when you are being more specific to the values of the proposed function.And I think that the separation from the official au3.api and au3.keywords.properties is useful because I can update SciTe and simply re-copy au3.userudfs.properties & au3.user.calltips.api again.I got the idea from WinAPIEx and it seemed to work, so I thought I would contribute to the forum. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 28, 2010 Moderators Share Posted March 28, 2010 Zedna,What is purpose of <au3.userudfs.properties>?I seem to remember that Jos added it last year to prevent user-created UDF abbreviations being overwritten when you updated SciTE. The format of the file is identical to the normal properties files and once created it comes up in the SciTE <Options> menu like all the others. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
wraithdu Posted March 28, 2010 Share Posted March 28, 2010 It's also for syntax highlighting so your functions get the pretty blue color. Link to comment Share on other sites More sharing options...
VitAl2013 Posted April 15, 2010 Share Posted April 15, 2010 (edited) I have strange problem when I try use recources.au3. Line 8 (File... resources.au3) Global Const $RT_CURSOR = 1 Global Const ^ERROR Error: Can not redeclare a constant. Even if I Comment string with $RT_CURSOR = 1 this error exists, but with line number 9 and Global Const $RT_BITMAP = 2 Edited April 15, 2010 by VitAl2013 Link to comment Share on other sites More sharing options...
Zedna Posted April 15, 2010 Author Share Posted April 15, 2010 (edited) I have strange problem when I try use recources.au3. Line 8 (File... resources.au3) Global Const $RT_CURSOR = 1 Global Const ^ERROR Error: Can not redeclare a constant. You use another include (or UDF) where these constants are declared too. Just comment global constants (declared in both of them) in one of these includes. This is common problem with constants declared in various UDFs and if you use them together you can easily fix this yourself. Edited April 15, 2010 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now