Moderators Melba23 Posted April 1, 2019 Moderators Share Posted April 1, 2019 drmusti, The UDF has not been updated for some time and a recent poster found that you needed an additional include file #include <WinAPISysWin.au3>. If the "Unknown function name" was _WinAPI_SetWindowLong then that is indeed the problem. 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...
xekon Posted May 29, 2020 Share Posted May 29, 2020 (edited) On 3/4/2018 at 8:50 PM, Jowy said: @guinness, thanks for the great work. But when I compiled my script on the new AutoIT version, the ResourcesEx.au3 needs an include file: #include <WinAPISysWin.au3> needed by _WinAPI_SetWindowLong Regards, Jowy Thank you! My script using ResourcesEx would not compile: "_WinAPI_SetWindowLong" "undefined function" So I edit ResourcesEx.au3 adding that include: #include <WinAPISysWin.au3> and now it compiles, Hooray! Edited May 29, 2020 by xekon Link to comment Share on other sites More sharing options...
xekon Posted June 1, 2020 Share Posted June 1, 2020 (edited) EDIT: I should have opened up the UDF, it is self documented and appears to support what I am trying to do _Resource_SetToCtrlID($L, 'Torus', Default, Default, True) When using _Resource_SetToCtrlID() is there a way to resize the image to the dimensions of the control, even if that means stretching the image? currently when I create a control then use _Resource_SetToCtrlID(), it resizes the controls dimensions for me and uses the images physical dimensions. For most cases thats actually perfect, but I am needed to be able to set some images to some controls and have the image stretched to fit. I am including a test case as well as some images to further illustrate my issue and what I am trying to accomplish. currently this is what I am seeing: my desired outcome is actually: and here is the code for this example: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_File_Add="C:\Program Files (x86)\AutoIt3\Examples\GUI\Torus.png", RT_RCDATA, Torus, 0 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ResourcesEx.au3>;transparent gui buttons #include <WinAPISysWin.au3>;requirement #include <GUIConstantsEx.au3>;gui #include <array.au3>;arrays Local $hGUI = GUICreate("Test", 1024, 768) $bg = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", 0, 0, 1024, 768) GUICtrlSetState($bg,$GUI_DISABLE) GUISetState(@SW_SHOW) Local $L = GUICtrlCreatePic('', 100, 100, 400, 50) ;debug shows that the GUICtrlCreatePic is set to my desired width 400 and height 50 MsgBox($MB_SYSTEMMODAL, "control properties", _ArrayToString(ControlGetPos("Test", "", $L ), @TAB)) _Resource_SetToCtrlID($L, 'Torus') ;debug shows that _Resource_SetToCtrlID has changed the dimensions of the control I created with GUICtrlCreatePic MsgBox($MB_SYSTEMMODAL, "control properties", _ArrayToString(ControlGetPos("Test", "", $L ), @TAB)) While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop EndIf sleep(random(6,9)) Wend GUIDelete($hGUI) I am hoping that this UDF supports such a method, but if not, let me know if anyone can think of a clever solution. Edited June 1, 2020 by xekon Link to comment Share on other sites More sharing options...
xekon Posted June 1, 2020 Share Posted June 1, 2020 (edited) I tried _Resource_SetToCtrlID($L, 'Torus', True) which according to the functions documentation in the UDF should have resized the image, but when I do this the Torus image does not load at all. EDIT: I got it working _Resource_SetToCtrlID($L, 'Torus', Default, Default, True) Edited June 1, 2020 by xekon Link to comment Share on other sites More sharing options...
SimonRu Posted June 8, 2020 Share Posted June 8, 2020 Hi all. Hopefully you can shed some light on my chaos. I seem to be chasing my tail a bit here, but I'm trying to make a more visually appealing way for users to update the firmware on a device instead of having a bunch of files and running a .bat. I can't find anyway of wrapping and running an exe (that also needs a dll) and firmware file. A small example of what I've got so far, that is pulling from the scriptdir for the time being: #AutoIt3Wrapper_Res_File_Add=updater.exe, rt_rcdata, updater, 0 #AutoIt3Wrapper_Res_File_Add=lib.dll, rt_rcdata, lib, 0 #AutoIt3Wrapper_Res_File_Add=firmware.dfu, rt_rcdata, firmware, 0 Run(@ComSpec & " /c " & "updater.exe upgrade firmware.dfu > %temp%\output.txt", "", @SW_HIDE) Instead is there a way of exporting the wrapped files to the temp directory for example so they can be run from there? I haven't seen anything obvious for exporting wrapped files, but I'm probably just blind from lack of coffee. Many thanks in advance. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 8, 2020 Developers Share Posted June 8, 2020 (edited) 7 minutes ago, SimonRu said: Instead is there a way of exporting the wrapped files to the temp directory for example so they can be run from there? Just use the FileInstall() function for that. Jos Edited June 8, 2020 by Jos SimonRu 1 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...
Zedna Posted June 10, 2020 Share Posted June 10, 2020 @SimonRu There is _Resource_SaveToFile() But as Jos said, in this case is more simple solution to use FileInstall() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
miha04 Posted August 15, 2022 Share Posted August 15, 2022 Autoit 3.3.14.5 -> 3.3.16.0 _WINVER() replaced by _WinAPI_GetVersion resorces.au3 Line 78? If $__WINVER >= 0x0600 Then To If _WinAPI_GetVersion() >= 6.0 Then at least i think so Link to comment Share on other sites More sharing options...
Developers Jos Posted August 15, 2022 Developers Share Posted August 15, 2022 (edited) 1 hour ago, miha04 said: at least i think so Correct, $__XYZ from a standard UDF should never be used as that is considered an internally used variable, so can change. Like:https://www.autoitscript.com/trac/autoit/ticket/3860 ... but the correct info is FIle: RecoursesEx.au3 and line is 788. .. and the same needs to be done in RecoursesEx_PE.au3 Updated the initial post with a fixed zip file next to original one as @guinnessisn't around a lot these days. Edited August 15, 2022 by Jos KnutJ 1 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...
BakedCakes Posted September 5, 2022 Share Posted September 5, 2022 (edited) The example also uses $__WINVER, so it should be updated too, but it was missed. ResourcesEx.au3 is also missing: #include <WinAPISysWin.au3> as without it: _WinAPI_SetWindowLong() is not defined. Edited September 5, 2022 by BakedCakes Link to comment Share on other sites More sharing options...
emendelson Posted April 26, 2023 Share Posted April 26, 2023 I used ResourcesEx.au3 recently at the suggestion of @Jos. I had to add this line to prevent it from causing an error: #include <WinAPI.au3> Perhaps the code could be updated? Or am I wrong about this? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 27, 2023 Developers Share Posted April 27, 2023 (edited) I see I have added this line after the latest upload I have done to fix that: #include <WinAPISysWin.au3> Will update the upload. Edited April 27, 2023 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...
ioa747 Posted August 14, 2023 Share Posted August 14, 2023 (edited) Note with last ResourcesEx 27-4-2023 updated to get Example.au3 to work with AutoIt Version..: 3.3.16.1, I needed to make the following change in Func IsXP() Func IsXP() ;~ Return $__WINVER < 0x0600 Return _WinAPI_GetVersion() < 6 EndFunc ;==>IsXP Edited August 14, 2023 by ioa747 argumentum 1 I know that I know nothing 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