Wombat Posted August 9, 2013 Posted August 9, 2013 (edited) 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: expandcollapse popup#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 Installation: [1] acquire the script through either downloading it or copy/paste/save [2] compile the script as ResourceManager [3] navigate to the folder that holds your SciTE installation (the one that contains the SciTE.exe) [4] create a new folder called "ResourceManager" and place the ResourceManager.exe inside this new folder [5] locate the SciTEGlobal.properties file [6] add this code to the very bottom of the file (with notepad, notepad++, etc.) # 44 Resource Manager command.name.44.*=Resource Manager command.44.*="$(SciteDefaultHome)\ResourceManager\ResourceManager.exe" $(CurrentSelection) command.shortcut.44.*=Ctrl+Alt+R [7]restart SciTE and you should see the newentry inside of "Tools" 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: Open the ResourceManager by either clicking on Tools and navigating to ResourceManager or by pressing Ctrl+Alt+R Press the "SHOW OPTIONS" button to bring up the profile generator. Drag and drop all the files you plan to include in your script onto this window, upon doing so the listbox should populate with the contents you dropped on it. Review the contents and remove any unwated files with the "Delete Selection" button or clear the list and start over with the "Clear All" button. Once the generator window contains the files you wanna use, press generate, then close the options window and press the REFRESH button on the ResourceManager window. Now, once you are at a place in your script that you need to insert a filepath, you can simply double-click the item in the ResourceManager and it will add it to the script for you. Tips & Pointers: You must keep the "_res.txt" file in the same folder as the script it was made for or it will not be read. To create a new "_res.txt" file you must use the generator with atleast one entry This has been bug tested on Windows XP Professional SP3 32bits, and on Windows 7 Ultimate x64 without any bugs showing up yet / though this does not mean you wont encounter any, and if you do please report them here or to me via pm.This script is provided as is and with no guarantees, I plan to update it as I get the chance to but I make no promises regarding its use nor do I offer any reperations if it blows up your chihuahua or excites your grandmother... You agree you will not seek reperations from the creator by downloading/copying&pasting said script. Changes I Want to Include in An Update: Add a system that auto-groups the items in the main GUI by filetype Add a system that provides previews of the files (images show in a hint, other files such as .txt, .ini, etc show in a tooltip) Set the Options/Generator window to allow direct editing of the _res.txt file so that you don't have to generate a new file every time Add a system that will bake me cookies when I have spent too much time in SciTE... I wish Update: ResourceManager_v2 (a seperate version, see below) Here's an alternate version that runs from a "Resources" file: CODE: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <File.au3> #include <SendMessage.au3> #include <Misc.au3> #include <_RecFileListToArray.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("SETTINGS", 5, 568, 305, 33) GUICtrlSetOnEvent(-1, "OptionsClick") $Options = GUICtrlCreateButton("REFRESH", 350, 568, 65, 33) GUICtrlSetOnEvent(-1, "RefreshClick") Global $QMark = Chr(34) Global $ResFileDir = @ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt" Global $DefPath Global $List1Data GUISetState(@SW_SHOW) #endregion ;;;GUI starts here;;;; ;Dbl Clk read/insert;;;;;;;;;;;;;;;;;;;;;; GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DirCreate(@ProgramFilesDir & "\Autoit3\Resources\") If Not FileExists(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt") Then Do FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", @ProgramFilesDir & "\Autoit3\Resources\") Until FileExists(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt") EndIf If Not FileExists(@ProgramFilesDir & "\Autoit3\Resources\Example.txt") Then Do FileWrite(@ProgramFilesDir & "\Autoit3\Resources\Example.txt", "This is an example") Until FileExists(@ProgramFilesDir & "\Autoit3\Resources\Example.txt") EndIf Sleep(10) $DefPath = FileRead($ResFileDir) $aRes = _RecFileListToArray($DefPath, "*", 1, 0, 0, 2) $ListDef = _ArrayToString($aRes) GUICtrlSetData($List1, $ListDef) While 1 Sleep(10) WEnd Func MainGUIClose() Exit EndFunc ;==>MainGUIClose Func RefreshClick() GUICtrlSetData($List1, "") $DefPath = FileRead($ResFileDir) $aRes = _RecFileListToArray($DefPath, "*", 1, 0, 0, 2) $ListDef = _ArrayToString($aRes) GUICtrlSetData($List1, $ListDef) EndFunc ;==>RefreshClick Func OptionsClick() Global $Options = GUICreate("Settings", 302, 99, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "OptionsClose") Global $Label1 = GUICtrlCreateLabel("Default Resource Folder:", 24, 8, 200, 17) Global $Button1 = GUICtrlCreateButton("Default", 24, 64, 73, 25) GUICtrlSetOnEvent(-1, "OptionsButton1Click") Global $Button2 = GUICtrlCreateButton("...", 112, 64, 33, 25) GUICtrlSetOnEvent(-1, "OptionsButton2Click") Global $Input1 = GUICtrlCreateInput($DefPath, 24, 32, 257, 21, 0x0800) GUICtrlSetOnEvent(-1, "OptionsInput1Change") GUISetState(@SW_SHOW) EndFunc ;==>OptionsClick #region ;;;;Options Functions begin here;;;;; Func OptionsClose() GUIDelete("RM Options") RefreshClick() EndFunc ;==>OptionsClose Func OptionsButton1Click() FileDelete($ResFileDir) Sleep(10) FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", @ProgramFilesDir & "\Autoit3\Resources\") GUICtrlSetData($Input1, "") Sleep(5) Global $DefPath = FileRead($ResFileDir) GUICtrlSetData($Input1, $DefPath) ToolTip("Your Resource File Has Been Reset", Default, Default, "ResourceManager_v2") Sleep(750) ToolTip("") EndFunc ;==>OptionsButton1Click Func OptionsButton2Click() Local $NewPath = FileSelectFolder("Choose A File", "C:\", 7) If IsString($NewPath) Then FileDelete($ResFileDir) FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", $NewPath) GUICtrlSetData($Input1, $NewPath) ToolTip("Your Resource File Has Been Changed To:" & $NewPath, Default, Default, "ResourceManager_v2") Sleep(750) ToolTip("") EndIf EndFunc ;==>OptionsButton2Click Func OptionsInput1Change() EndFunc ;==>OptionsInput1Change Func Form1Minimize() EndFunc ;==>Form1Minimize Func Form1Restore() EndFunc ;==>Form1Restore ;Insert Dbl Clkd String into SciTE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Func _SciTE_InsertText($sString) $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 #endregion ;;;;Options Functions begin here;;;;; ;;;;dbl click read;;; Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #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 $sData = GUICtrlRead($List1) ; Use the native function _SciTE_InsertText($QMark & $sData & $QMark) EndSwitch EndSwitch EndFunc ;==>_WM_COMMAND 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 Edited August 28, 2013 by Wombat Edano 1 Just look at us.Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner The internet is our one and only hope at a truly free world, do not let them take it from us...
Edano Posted August 9, 2013 Posted August 9, 2013 wombat take a look at your other script i fixed it Wombat 1 [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]
mLipok Posted August 9, 2013 Posted August 9, 2013 Is the report you can add the output of these three functions FileGetSize FileGetTime FileGetVersion Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
Wombat Posted August 9, 2013 Author Posted August 9, 2013 (edited) Is the report you can add the output of these three functions FileGetSize FileGetTime FileGetVersion to the items in the list? or to the script active in SciTE? also I understand english is not the primary language of most no this forum, so let me apologize upfront, but what do you mean by "report", again I apologize for having trouble understanding what you mean. Edited August 9, 2013 by Wombat Just look at us.Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner The internet is our one and only hope at a truly free world, do not let them take it from us...
Wombat Posted August 9, 2013 Author Posted August 9, 2013 Quick Update: Cleaned up the code in the first post, it's edited to provide information for beginners (like myself) that need to know what items in the code do. Just look at us.Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner The internet is our one and only hope at a truly free world, do not let them take it from us...
guinness Posted August 9, 2013 Posted August 9, 2013 A couple of updates for you to consider... #include <Constants.au3> #include <SendMessage.au3> #include <WindowsConstants.au3> Func _SciTE_Send_Command($hWnd, $hSciTE, $sString) If StringStripWS($sString, $STR_STRIPALL) = '' Then Return SetError(2, 0, 0) ; String is blank. EndIf $sString = ':' & Dec(StringTrimLeft($hWnd, 2)) & ':' & $sString Local $tData = DllStructCreate('char[' & StringLen($sString) + 1 & ']') ; wchar DllStructSetData($tData, 1, $sString) Local Const $tagCOPYDATASTRUCT = 'ptr;dword;ptr' ; ';ulong_ptr;dword;ptr' Local $tCOPYDATASTRUCT = DllStructCreate($tagCOPYDATASTRUCT) DllStructSetData($tCOPYDATASTRUCT, 1, 1) DllStructSetData($tCOPYDATASTRUCT, 2, DllStructGetSize($tData)) DllStructSetData($tCOPYDATASTRUCT, 3, DllStructGetPtr($tData)) _SendMessage($hSciTE, $WM_COPYDATA, $hWnd, DllStructGetPtr($tCOPYDATASTRUCT)) Return Number(Not @error) EndFunc ;==>_SciTE_Send_Command Func GenerateProf() $FileCount = _GUICtrlListBox_GetCount($List2) If $FileCount Then ; If there are items in the ListView then generate the file. Global $FileList[$FileCount + 1] For $i = 0 To $FileCount $FileList[$i] = _GUICtrlListBox_GetText($List2, $i) Next _ArrayDelete($FileList, $i) _FileWriteFromArray($sFilePath & "_res.txt", $FileList) EndIf EndFunc ;==>GenerateProf ; Place at the top of your script. This is if you're using WinAPIEx or the AutoIt betas (v3.3.9.4+) #include <APIConstants.au3> #include <WinAPIEx.au3> Global $__aDropFiles = 0 ; Then use this function. Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $lParam Switch $iMsg Case $WM_DROPFILES Local Const $aReturn = _WinAPI_DragQueryFileEx($wParam) If UBound($aReturn) Then $__aGUIDropFiles = $aReturn Else Local Const $aError[1] = [0] $__aGUIDropFiles = $aError EndIf EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_DROPFILES ; And create an event for your GUI to monitor $GUI_EVENT_DROPPED. 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
guinness Posted August 9, 2013 Posted August 9, 2013 Also declaring Global variables in functions is not a good idea, unless you know what the consequences really are. It's best to declare Global variables at the start of your script. 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
Wombat Posted August 9, 2013 Author Posted August 9, 2013 Also declaring Global variables in functions is not a good idea, unless you know what the consequences really are. It's best to declare Global variables at the start of your script. I try to do this when possible, the functions that contain Global variables are from the scripts I borrowed from. Except for the options window which is called up via the options button ( i know this can be done by simply defining the options ctrls and gui then just having the function call it to show. In my next update this will likely be changed. I saw your Autoit best coding practices and am studying it closely. Just look at us.Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner The internet is our one and only hope at a truly free world, do not let them take it from us...
Wombat Posted August 9, 2013 Author Posted August 9, 2013 (edited) A couple of updates for you to consider... #include <Constants.au3> #include <SendMessage.au3> #include <WindowsConstants.au3> Func _SciTE_Send_Command($hWnd, $hSciTE, $sString) If StringStripWS($sString, $STR_STRIPALL) = '' Then Return SetError(2, 0, 0) ; String is blank. EndIf $sString = ':' & Dec(StringTrimLeft($hWnd, 2)) & ':' & $sString Local $tData = DllStructCreate('char[' & StringLen($sString) + 1 & ']') ; wchar DllStructSetData($tData, 1, $sString) Local Const $tagCOPYDATASTRUCT = 'ptr;dword;ptr' ; ';ulong_ptr;dword;ptr' Local $tCOPYDATASTRUCT = DllStructCreate($tagCOPYDATASTRUCT) DllStructSetData($tCOPYDATASTRUCT, 1, 1) DllStructSetData($tCOPYDATASTRUCT, 2, DllStructGetSize($tData)) DllStructSetData($tCOPYDATASTRUCT, 3, DllStructGetPtr($tData)) _SendMessage($hSciTE, $WM_COPYDATA, $hWnd, DllStructGetPtr($tCOPYDATASTRUCT)) Return Number(Not @error) EndFunc ;==>_SciTE_Send_Command Func GenerateProf() $FileCount = _GUICtrlListBox_GetCount($List2) If $FileCount Then ; If there are items in the ListView then generate the file. Global $FileList[$FileCount + 1] For $i = 0 To $FileCount $FileList[$i] = _GUICtrlListBox_GetText($List2, $i) Next _ArrayDelete($FileList, $i) _FileWriteFromArray($sFilePath & "_res.txt", $FileList) EndIf EndFunc ;==>GenerateProf added, will be in the next update, thank you ; Place at the top of your script. This is if you're using WinAPIEx or the AutoIt betas (v3.3.9.4+) #include <APIConstants.au3> #include <WinAPIEx.au3> Global $__aDropFiles = 0 ; Then use this function. Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $lParam Switch $iMsg Case $WM_DROPFILES Local Const $aReturn = _WinAPI_DragQueryFileEx($wParam) If UBound($aReturn) Then $__aGUIDropFiles = $aReturn Else Local Const $aError[1] = [0] $__aGUIDropFiles = $aError EndIf EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_DROPFILES ; And create an event for your GUI to monitor $GUI_EVENT_DROPPED. I dont have WinAPIEx.au3, I will be making a version of the script that uses it but I plan to keep both for those that don't have iteither. Edited August 9, 2013 by Wombat Just look at us.Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner The internet is our one and only hope at a truly free world, do not let them take it from us...
guinness Posted August 9, 2013 Posted August 9, 2013 Don't overcomplicate yourself, if you don't use it then fine. Just remember that when the beta versions hit stable, then my code will be valid for all. 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
Edano Posted August 9, 2013 Posted August 9, 2013 wombat, you opened two threads with the same title (SciTE Resource Manager), one in help and one in example scripts. could you reword one of them, because i follow both and cannot distinguish them thx E. [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]
Wombat Posted August 9, 2013 Author Posted August 9, 2013 wombat, you opened two threads with the same title (SciTE Resource Manager), one in help and one in example scripts. could you reword one of them, because i follow both and cannot distinguish them thx E. Not sure I can.. if so, I definitely tried and failed Just look at us.Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner The internet is our one and only hope at a truly free world, do not let them take it from us...
jaberwacky Posted August 12, 2013 Posted August 12, 2013 You can, just use the full editor. Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
Wombat Posted August 28, 2013 Author Posted August 28, 2013 Here's an alternate version that runs from a "Resources" file: CODE: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <File.au3> #include <SendMessage.au3> #include <Misc.au3> #include <_RecFileListToArray.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("SETTINGS", 5, 568, 305, 33) GUICtrlSetOnEvent(-1, "OptionsClick") $Options = GUICtrlCreateButton("REFRESH", 350, 568, 65, 33) GUICtrlSetOnEvent(-1, "RefreshClick") Global $QMark = Chr(34) Global $ResFileDir = @ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt" Global $DefPath Global $List1Data GUISetState(@SW_SHOW) #endregion ;;;GUI starts here;;;; ;Dbl Clk read/insert;;;;;;;;;;;;;;;;;;;;;; GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DirCreate(@ProgramFilesDir & "\Autoit3\Resources\") If Not FileExists(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt") Then Do FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", @ProgramFilesDir & "\Autoit3\Resources\") Until FileExists(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt") EndIf If Not FileExists(@ProgramFilesDir & "\Autoit3\Resources\Example.txt") Then Do FileWrite(@ProgramFilesDir & "\Autoit3\Resources\Example.txt", "This is an example") Until FileExists(@ProgramFilesDir & "\Autoit3\Resources\Example.txt") EndIf Sleep(10) $DefPath = FileRead($ResFileDir) $aRes = _RecFileListToArray($DefPath, "*", 1, 0, 0, 2) $ListDef = _ArrayToString($aRes) GUICtrlSetData($List1, $ListDef) While 1 Sleep(10) WEnd Func MainGUIClose() Exit EndFunc ;==>MainGUIClose Func RefreshClick() GUICtrlSetData($List1, "") $DefPath = FileRead($ResFileDir) $aRes = _RecFileListToArray($DefPath, "*", 1, 0, 0, 2) $ListDef = _ArrayToString($aRes) GUICtrlSetData($List1, $ListDef) EndFunc ;==>RefreshClick Func OptionsClick() Global $Options = GUICreate("Settings", 302, 99, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "OptionsClose") Global $Label1 = GUICtrlCreateLabel("Default Resource Folder:", 24, 8, 200, 17) Global $Button1 = GUICtrlCreateButton("Default", 24, 64, 73, 25) GUICtrlSetOnEvent(-1, "OptionsButton1Click") Global $Button2 = GUICtrlCreateButton("...", 112, 64, 33, 25) GUICtrlSetOnEvent(-1, "OptionsButton2Click") Global $Input1 = GUICtrlCreateInput($DefPath, 24, 32, 257, 21, 0x0800) GUICtrlSetOnEvent(-1, "OptionsInput1Change") GUISetState(@SW_SHOW) EndFunc ;==>OptionsClick #region ;;;;Options Functions begin here;;;;; Func OptionsClose() GUIDelete("RM Options") RefreshClick() EndFunc ;==>OptionsClose Func OptionsButton1Click() FileDelete($ResFileDir) Sleep(10) FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", @ProgramFilesDir & "\Autoit3\Resources\") GUICtrlSetData($Input1, "") Sleep(5) Global $DefPath = FileRead($ResFileDir) GUICtrlSetData($Input1, $DefPath) ToolTip("Your Resource File Has Been Reset", Default, Default, "ResourceManager_v2") Sleep(750) ToolTip("") EndFunc ;==>OptionsButton1Click Func OptionsButton2Click() Local $NewPath = FileSelectFolder("Choose A File", "C:\", 7) If IsString($NewPath) Then FileDelete($ResFileDir) FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", $NewPath) GUICtrlSetData($Input1, $NewPath) ToolTip("Your Resource File Has Been Changed To:" & $NewPath, Default, Default, "ResourceManager_v2") Sleep(750) ToolTip("") EndIf EndFunc ;==>OptionsButton2Click Func OptionsInput1Change() EndFunc ;==>OptionsInput1Change Func Form1Minimize() EndFunc ;==>Form1Minimize Func Form1Restore() EndFunc ;==>Form1Restore ;Insert Dbl Clkd String into SciTE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Func _SciTE_InsertText($sString) $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 #endregion ;;;;Options Functions begin here;;;;; ;;;;dbl click read;;; Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #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 $sData = GUICtrlRead($List1) ; Use the native function _SciTE_InsertText($QMark & $sData & $QMark) EndSwitch EndSwitch EndFunc ;==>_WM_COMMAND 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! Updated the first post as well Just look at us.Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner The internet is our one and only hope at a truly free world, do not let them take it from us...
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