Jump to content
Sign in to follow this  
Wombat

SciTE Resource Manager - general help

Recommended Posts

Wombat

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...

Edited 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...

Share this post


Link to post
Share on other sites
guinness

If that _SciTE_Send_Command is from SciTE Jump, then it's an old version of SciTE Jump you have. I have SciTE UDF in the source full of functions. Did you check it out?


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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
guinness

Actually, could you give an example of this "resource file"? As I'm really not understanding what you're trying to create, so the more you provide, the easier it will be for me to get my head around it.


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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Edano

use ClipPut(FilePath), WinActivate("Scite") and Send("^v") ?

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
guinness

use ClipPut(FilePath), WinActivate("Scite") and Send("^v") ?

If that's what they are asking for then I know of a better solution. But I will need confirmation from the user.


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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Wombat

The send command is from BrewManNH's ColorChooser

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=ColorChooser.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Run_Tidy=y
#Tidy_Parameters=/rel
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/so
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Misc.au3>
#include <SendMessage.au3>
Opt("WinTitleMatchMode", 2)
Global $sDefaultColor = 0
Global $iMode = 1
Global Const $WM_COPYDATA = 0x004A
If $cmdline[0] > 0 Then
    $sDefaultColor = $cmdline[1]
EndIf
If StringLeft($sDefaultColor, 2) <> "0x" Then
    $iMode = 0
    $sDefaultColor = "0x" & $sDefaultColor
EndIf
$sReturn = _ChooseColor(2, $sDefaultColor, 2)
If $sReturn = -1 Then Exit (1)
If Not $iMode Then
    $sReturn = StringMid($sReturn, 3)
EndIf
_SciTE_InsertText($sReturn)
Func _SciTE_InsertText($sString)
    Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), "insert:" & $sString)
EndFunc   ;==>_SciTE_InsertText
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

and if you popup, copy, paste, the code i have so far into scite, save it, and then run it, click options, drag a few files onto the listview then click generate, open your file browser to where you saved my code and you'll see the resource file (_res.profile) created by this part of the code:
 

Func GenerateProf()
    $FileCount = _GUICtrlListBox_GetCount($List2)
    Global $FileList[$FileCount + 1]
    For $i = 0 To $FileCount
        $FileList[$i] = _GUICtrlListBox_GetText($List2, $i)
    Next
    _ArrayDelete($FileList, $i)
    _FileWriteFromArray(@ScriptFullPath & "_res.profile", $FileList)
EndFunc

_FileWriteFromArray should get the file path of the script in the focused tab of SciTE upon pressing the generate button, but for now to test the code I have it grabbing its own filepath... the resource file is simply a text file with the filetype .profile so that it is a unique file for the resource manager to use

Edited 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...

Share this post


Link to post
Share on other sites
guinness

The send command is from BrewManNH's ColorChooser

Ah, makes sense if you look through BrewManNH's thread.

I tried it, but what is this file going to be used for eventually?


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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Wombat

Chiming in here:  I dunno about everybody else but I still struggle to grasp just what this is supposed to do.

 

Alright,

Explanation:

When I write software, I use a lot of resource files (e.g. : image files, .ini files, .properties files), and it is a time consumer to have to find those filepaths, copy and paste them, or type them out and hope for no keystroke errors.

This is a resource manager that stores and displays the filepaths for the resources I plan on using in the script i'm working on. You can drag and drop all the files onto the listview in the options, click generate and it will create a _res.profile file with your script's name appended to that file so that when the tool is opened from SciTE's tools list it displays the contents of the _res.profile associated with the script that it was opened on (or hopefully it could dynamically display the _res.profile associated with teh focused tab in SciTE)

When (at the main gui, not the options) you click on a file path in the list view (either by the user hitting enter, or double clicking) it will write that file path in the script where ever your cursor is, thus saving you time and repitition of tasks.

Edit: Later I would revise it so that you can group the images, .ini files etc but for now just showing them all together will work

Edited by Wombat
  • Like 2

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...

Share this post


Link to post
Share on other sites
Edano

thx :)

when i need a resource file more than once, i simply declare a global variable for it ;)


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
guinness

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

To insert at cursor use these functions...


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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Wombat

Alrighty, so i have it reading the double click and inserting the item clicked into SciTE at the cursor...

Now I need to know how to get the filepath of the script opened in SciTE. So that when this script runs it checks the focused script, grabs its filepath and uses that to open the associated resource profile.

#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", 75, 568, 305, 33)
GUICtrlSetOnEvent(-1, "OptionsClick")
$cDrop_Dummy = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_On_Drop")
Global $aDrop_List
Global $List1Data
GUISetState(@SW_SHOW)
#endregion ;;;;;GUI ends here;;;;;
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")
; Register $WM_DROPFILES function to detect drops anywhere on the GUI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUIRegisterMsg(0x233, "On_WM_DROPFILES") ; $WM_DROPFILES

Global $List1Data
_FileReadToArray(@ScriptFullPath & "_res.txt", $List1Data)
$ListDef = _ArrayToString($List1Data)
GUICtrlSetData($List1, $ListDef)

While 1
    Sleep(10)
WEnd

Func MainGUIClose()
    Exit
EndFunc

Func OptionsClick()
    $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

#region ;;;;Options Functions begin here;;;;;
Func _On_Drop() ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    For $i = 1 To $aDrop_List[0]
        GUICtrlSetData($List2, $aDrop_List[$i])
    Next
EndFunc   ;==>_On_Drop

; React to items dropped on the GUI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Func On_WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam)
    ; 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()
    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()
    GUICtrlSetData($List2, "")
EndFunc

Func GenerateProf()
    $FileCount = _GUICtrlListBox_GetCount($List2)
    Global $FileList[$FileCount + 1]
    For $i = 0 To $FileCount
        $FileList[$i] = _GUICtrlListBox_GetText($List2, $i)
    Next
    _ArrayDelete($FileList, $i)
    _FileWriteFromArray(@ScriptFullPath & "_res.txt", $FileList)
EndFunc

Func OptionsClose()
    GUIDelete("RM Options")
EndFunc

Func Form1Minimize()

EndFunc

Func Form1Restore()

EndFunc

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');;;;dbl click read;;;
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 end 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($sData)
            EndSwitch
    EndSwitch

EndFunc

I know, its messy, I haven't cleaned up the code yet, I'm sorry :/







Edited 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...

Share this post


Link to post
Share on other sites
Wombat

Alrighty, I got it to read the title of SciTE with this:

 

Global $List1Data
Global $WinTitle = WinGetTitle('[CLASS:SciTEWindow]')
_FileReadToArray(@ScriptFullPath & "_res.txt", $List1Data)
$ListDef = _ArrayToString($List1Data)
GUICtrlSetData($List1, $ListDef)

How do I remove " - ScITE" from the $WinTitle


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...

Share this post


Link to post
Share on other sites
guinness

All the functions I have provided have been stripped from SciTE Jump...so I really think you should check out the SciTE include in the source folder.

#include <Constants.au3>
#include <WinAPIEx.au3>

Func _SciTE_GetCurrentFile()
    Local Const $sTitle = WinGetTitle(WinGetHandle('[CLASS:SciTEWindow]'))
    If @error Then ; No Window
        Return SetError(1, 0, '')
    EndIf
    If _IsEmpty($sTitle) Then ; New File.
        Return SetError(3, 0, '')
    EndIf
    Local Const $sFilePath = StringRegExpReplace($sTitle, '^(\V+)(?:\h[-*]\V+)$', '\1')
    If FileExists($sFilePath) Then
        If _IsValidFileType($sFilePath, 'au3') Then
            Return $sFilePath
        Else
            Return SetError(4, 0, '') ; File Is Not Supported.
        EndIf
    EndIf
    Return SetError(2, 0, '') ; File Does Not Exist.
EndFunc   ;==>_SciTE_GetCurrentFile

Func _IsValidFileType($sFilePath, $sList = 'bat;cmd;exe', $iOpFast = 1)
    If StringStripWS($sList, $STR_STRIPALL) = '' Then
        $sList = '*'
    EndIf
    Return _WinAPI_PathMatchSpec($sFilePath, StringReplace(';' & $sList, ';', ';*.', 0, $iOpFast * $STR_NOCASESENSE))
EndFunc   ;==>_IsValidFileType
#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
Edited by guinness

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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
guinness

Doesn't he need to register the wm_copydata message?

Only if he wants SciTE to send info back. With what I have posted so far, this hasn't been the case.


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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Wombat

All the functions I have provided have been stripped from SciTE Jump...so I really think you should check out the SciTE include in the source folder.

#include <Constants.au3>#include <WinAPIEx.au3>Func _SciTE_GetCurrentFile() Local Const $sTitle = WinGetTitle(WinGetHandle('[CLASS:SciTEWindow]'))  If @error Then ; No Window      Return SetError(1, 0, '')   EndIf   If _IsEmpty($sTitle) Then ; New File.       Return SetError(3, 0, '')   EndIf   Local Const $sFilePath = StringRegExpReplace($sTitle, '^(\V+)(?:\h[-*]\V+)$', '\1') If FileExists($sFilePath) Then      If _IsValidFileType($sFilePath, 'au3') Then         Return $sFilePath       Else            Return SetError(4, 0, '') ; File Is Not Supported.      EndIf   EndIf   Return SetError(2, 0, '') ; File Does Not Exist.EndFunc   ;==>_SciTE_GetCurrentFileFunc _IsValidFileType($sFilePath, $sList = 'bat;cmd;exe', $iOpFast = 1)  If StringStripWS($sList, $STR_STRIPALL) = '' Then       $sList = '*'    EndIf   Return _WinAPI_PathMatchSpec($sFilePath, StringReplace(';' & $sList, ';', ';*.', 0, $iOpFast * $STR_NOCASESENSE))EndFunc   ;==>_IsValidFileType
#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

I'm sorry, I was at work and didn't get the chance to look through it, but I am for sure going to now that I'm home with my system.

Thank you btw for taking the time to grab those examples and post them.


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...

Share this post


Link to post
Share on other sites
Wombat

I'm trying to figure out how to get it to read new tabs in SciTE... I downloaded SciTE Jump and read through your files guinness, I'm lost at how to adapt them. Maybe this is something for tomorrow


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...

Share this post


Link to post
Share on other sites
guinness

You mean when a new tab is open, you want your application to react?


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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • leomoon
      By leomoon
      Hello,
      I'm trying to write a hotkey program and I know exactly how to do it but it will be hard coded and the user won't be able to edit it.
      HotKeySet("{ESC}", "HotKeyPressed") HotKeySet("^!d", "HotKeyPressed") HotKeySet("^+x", "HotKeyPressed") While 1 Sleep(500) WEnd Func HotKeyPressed() Switch @HotKeyPressed Case "{ESC}" Exit Case "^!d" ShellExecute("D:\Docs") Case "^+x" ShellExecute("D:\Docs\My Portables\Burner\AnyBurn\AnyBurn.exe") EndSwitch EndFunc I want the program to read a file that has hotkeys on odd lines and paths on even lines but I don't see how the program will load into itself.
      Is it even possible?
      Thanks.
    • Mag91
      By Mag91
      Hey Community,
      cause im too new in the Auto it world i will try it with the your help. hopefully.
      I woud like to know how i can handle my Problem.
      ----
      I have a Excel Data with 362 random numbers.
      For Example:
      1166642335374 1172899897343
      .....
      this numbers are a part of the filepath ...example
      D:\Projekte\1166_64233_5374
      as u can see its the first number of the Excel data. After the first 4 numbers it shoud make a "_" than another 5 "_"
      This is my first question. How can i handle this to make it Shell execute.
       
      --------
      Second question:
      If i am in the path.
      For Example:
      D:\Projekte\1166_64233_5374
      the code shoud search for specific PDF Files.
      They are named like: 0050569E364B1ED79B900F73E62660EC.pdf
      the first 15 letters are always the same
      0050569E364B1ED
      when he found this data he has to copy it on a Folder on the Desktop.
      (There can also be 2 or 3 pdfs in one Folder with this letters)
      ----
      Please give me some help :-)
       
       
       
       
       
       
    • Ahile07
      By Ahile07
      Hello Guys,
      Planning to build a little script to get the path of a file. Wondering if there is any change I can drop a file in a box and read its path. Or click on it and read it. Or any easy way of getting the file path - the specific file that i want from a specific folder. Planning to store the path in a variable and use it after.
      I can't find anywhere an example of how to read and store the path of a file in a folder.
      Appreciate.
    • TheBreeder
      By TheBreeder
      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

       
    • Kanashius
      By Kanashius
      This Epubmanager is good for short loadingtime and Detailed Information about the Books. With the manager it comes an full-reader with readout-function (TTS), using installed voices.
      This Program is used to Manage e-books/epubs. You can import directorys. A lot of information is read from the epub and saved in a database.
      Most important is the speed of loading books, because the management should be used for lots of epubs.
      All chargings are displayed. There is also an Sql-Console, if you want to edit a lot of entry, otherwise you can do a rightclick and edit every Element in another window.
      Also there is a Epub-Reader to read the epubs just with a doubleclick at any entry.

      Information saved in the database (if they can be read in the epub):
      identifier, author, description, title, genre, creationdate, path, speach
      Information about Epub-Reader:
      The Epub-Reader opens Epubs and they can be read chapter by chapter.
      At the left side there is a Listbox, where you can select the chapters
      There is also a read out function, reading your epub. (You can change Voice and Audiooutput, but you need to have installed a TTS-Speach).
      Also you can edit the font-size.
×