Jump to content
Sign in to follow this  
Wombat

Displaying dynamic search results - Help

Recommended Posts

The returned_html.txt contains:
 

1
C:\example\example\example\Example.html

its the results of the search function, the results are seperated by file type, stored in an .txt file then the .txt is deleted after used.


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

Don't use _IECreate, use ShellExecute, that will launch the browser using the html file as the page it opens to. _IECreate needs a URL not an HTML text file.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Don't use _IECreate, use ShellExecute, that will launch the browser using the html file as the page it opens to. _IECreate needs a URL not an HTML text file.

 

Ah, so that answers that...

I'll try that after work... I assume I can still read the .txt file to an array then use that array in the ShellExecute command?


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

Yes, you just loop through it one element at a time. You could probably do it will all your file search types (ShellExecute) that way you don't have to know which program to open it with. As long as you don't need to keep track of the file once it's opened ShellExecute is best for files that you want to be opened by the default program that handles that file type, on the computer you're running it on.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Yes, you just loop through it one element at a time. You could probably do it will all your file search types (ShellExecute) that way you don't have to know which program to open it with. As long as you don't need to keep track of the file once it's opened ShellExecute is best for files that you want to be opened by the default program that handles that file type, on the computer you're running it on.

Thank you


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

Ok I tried this:

 

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Pictures\Scc.ico
#AutoIt3Wrapper_Outfile=C:\Program Files\StormCopperTSE\StormCopperTSE.exe
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_SaveSource=y
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Tidy_Stop_OnError=n
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <RecFileListToArray.au3>
#include <Array.au3>
#include <File.au3>
#include <IE.au3>
Opt("GUIOnEventMode", 1)
#region ### START Koda GUI section ### Form=C:\Users\Wombat\Documents\NewTSE.kxf
$Form1 = GUICreate("Trumpf500 Search Engine", 651, 362, 192, 124, BitOR($WS_THICKFRAME, $WS_POPUP))
GUISetBkColor(0x434E54)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$Pic1 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\StormSquare.gif", 12, 12, 49, 49)
GUICtrlSetOnEvent(-1, "Pic1Click")
$StormCopper = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\StormLogo.jpg", 78, 6, 385, 67)
GUICtrlSetOnEvent(-1, "StormCopperClick")
$Pic3 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\divider.jpg", -12, 72, 680, 25)
GUICtrlSetOnEvent(-1, "Pic3Click")
$Input1 = GUICtrlCreateInput("...", 338, 116, 178, 21)
GUICtrlSetOnEvent(-1, "Input1Change")
$Pic4 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\searchbar_half_1.5.jpg", 324, 104, 207, 45)
GUICtrlSetOnEvent(-1, "Pic4Click")
$Pic5 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\searchbar_half_2.5.jpg", 531, 104, 95, 45)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "Pic5Click")
$htmlButton = GUICtrlCreateButton("View Data Sheet", 352, 178, 224, 60, $BS_ICON)
GUICtrlSetImage(-1, "C:\Program Files\StormCopperTSE\res\Document-48.ico", -1)
GUICtrlSetFont(-1, 12, 400, 0, "Tahoma")
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "htmlButtonClick")
$Label1 = GUICtrlCreateLabel("View Data Sheet", 352, 157, 111, 22)
GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetOnEvent(-1, "Label1Click")
$ProgSelect = GUICtrlCreateCombo("ProgSelect", 353, 275, 224, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "ProgSelectChange")
$Label2 = GUICtrlCreateLabel("Select Program to Load", 351, 251, 156, 22)
GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetOnEvent(-1, "Label2Click")
$PartPreview = GUICtrlCreatePic("", 54, 145, 200, 200)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetOnEvent(-1, "PartPreviewClick")
$Label3 = GUICtrlCreateLabel("Part Preview", 112, 110, 84, 22)
GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetOnEvent(-1, "Label3Click")
$Pic2 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\close-button2.jpg", 519, 7, 102, 51)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "Pic2Click")
$Button1 = GUICtrlCreateButton("Button1", 607, 317, 43, 43, $BS_ICON)
GUICtrlSetImage(-1, "C:\Program Files\StormCopperTSE\res\reload_32.ico", -1)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "Button1Click")
$iError = @error
Local $aHTML
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1

WEnd
; If you want the GUI to be moved as well.
Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    Return $HTCAPTION
EndFunc   ;==>WM_NCHITTEST
Func Button1Click()
    GUICtrlSetState($Label3, $GUI_HIDE)
    GUICtrlSetState($Label2, $GUI_HIDE)
    GUICtrlSetState($Label1, $GUI_HIDE)
    GUICtrlSetState($PartPreview, $GUI_HIDE)
    GUICtrlSetState($ProgSelect, $GUI_HIDE)
    GUICtrlSetState($htmlButton, $GUI_HIDE)
EndFunc   ;==>Button1Click
Func Form1Close()

EndFunc   ;==>Form1Close
Func Form1Maximize()

EndFunc   ;==>Form1Maximize
Func Form1Minimize()

EndFunc   ;==>Form1Minimize
Func Form1Restore()

EndFunc   ;==>Form1Restore
Func htmlButtonClick()
    $ReadInput1 = GUICtrlRead($Input1)
    _FileReadToArray("C:\Program Files\StormCopperTSE\ret\returned_html.txt", $aHTML)
    If IsArray($aHTML) Then
        ShellExecute($ReadInput1 & ".html", "", "C:\Users\Wombat\workshop\test_obj\", "open")
    EndIf
EndFunc   ;==>htmlButtonClick
Func Input1Change()

EndFunc   ;==>Input1Change
Func Label1Click()

EndFunc   ;==>Label1Click
Func Label2Click()

EndFunc   ;==>Label2Click
Func Label3Click()

EndFunc   ;==>Label3Click
Func PartPreviewClick()

EndFunc   ;==>PartPreviewClick
Func Pic1Click()

EndFunc   ;==>Pic1Click
Func Pic2Click()
    Exit
EndFunc   ;==>Pic2Click
Func Pic3Click()

EndFunc   ;==>Pic3Click
Func Pic4Click()

EndFunc   ;==>Pic4Click
Func Pic5Click()
    $ReadInput1 = GUICtrlRead($Input1)
    $aList = _RecFileListToArray("C:\", $ReadInput1 & ".html*", 1, 1, 1, 2)
    $bList = _RecFileListToArray("C:\", $ReadInput1 & ".bmp*", 1, 1, 1, 2)
    $clist = _RecFileListToArray("C:\", $ReadInput1 & ".lst*", 1, 1, 1, 2)
    If @error Then
        MsgBox(0, "Error", "Error File Not Found " & @CRLF & " - " & " Error Code: " & @extended & @CRLF)
    ElseIf IsArray($aList) Then
        _FileWriteFromArray("C:\Program Files\StormCopperTSE\ret\returned_html.txt", $aList)
        GUICtrlSetState($Label3, $GUI_SHOW)
        GUICtrlSetState($htmlButton, $GUI_SHOW)
    EndIf
    If @error Then
        MsgBox(0, "Error", "Error File Not Found " & @CRLF & " - " & " Error Code: " & @extended & @CRLF)
    ElseIf IsArray($aList) Then
        _FileWriteFromArray("C:\Program Files\StormCopperTSE\ret\returned_bmp.txt", $bList)
        GUICtrlSetState($PartPreview, $GUI_SHOW)
        GUICtrlSetState($Label1, $GUI_SHOW)
    EndIf
    If @error Then
        MsgBox(0, "Error", "Error File Not Found " & @CRLF & " - " & " Error Code: " & @extended & @CRLF)
    ElseIf IsArray($aList) Then
        _FileWriteFromArray("C:\Program Files\StormCopperTSE\ret\returned_lst.txt", $clist)
        GUICtrlSetState($ProgSelect, $GUI_SHOW)
        GUICtrlSetState($Label2, $GUI_SHOW)
    EndIf
EndFunc   ;==>Pic5Click
Func ProgSelectChange()

EndFunc   ;==>ProgSelectChange
Func StormCopperClick()

EndFunc   ;==>StormCopperClick

and this function:

 

Func htmlButtonClick()
    $ReadInput1 = GUICtrlRead($Input1)
    _FileReadToArray("C:\Program Files\StormCopperTSE\ret\returned_html.txt", $aHTML)
    If IsArray($aHTML) Then
        ShellExecute($ReadInput1 & ".html", "", "C:\Users\Wombat\workshop\test_obj\", "open")
    EndIf
EndFunc   ;==>htmlButtonClick

works perfectly!

Even this works:

Func htmlButtonClick()
    $ReadInput1 = GUICtrlRead($Input1)
    $aHTML = ("C:\Users\Wombat\workshop\test_obj\")
    ShellExecute($ReadInput1 & ".html", "", $aHTML, "open")
EndFunc   ;==>htmlButtonClick

BUT!

This is the form of the code I need:

 

Func htmlButtonClick()
    $ReadInput1 = GUICtrlRead($Input1)
    _FileReadToArray("C:\Program Files\StormCopperTSE\ret\returned_html.txt", $aHTML)
    If IsArray($aHTML) Then
        ShellExecute($ReadInput1 & ".html", "", $aHTML, "open")
    EndIf
EndFunc

and it does not work.

I need it set up in this manner so that it uses the results that are stored in the returned_html.txt file.

The odd thing is I can go into the returned_html.txt file and edit it to contain only:  C:UsersWombatworkshoptest obj

and set the button to show on startup so that I don't have to search to make it appear, thus not overwriting the contents of returned_html.txt but that stills does not work.

So I'm thinking my problem is lying within this command:

_FileReadToArray("C:\Program Files\StormCopperTSE\ret\returned_html.txt", $aHTML)

any ideas?

 

EDIT:

and this even works:

ShellExecute("C:\Users\Wombat\workshop\test_obj\Ex123.html")

but not this:
 

Func htmlButtonClick()
    $ReadInput1 = GUICtrlRead($Input1)
    _FileReadToArray("C:\Program Files\StormCopperTSE\ret\returned_html.txt", $aHTML)
    If IsArray($aHTML) Then
        ShellExecute($ReadInput1 & ".html", "", $aHTML, "open")
    EndIf
EndFunc

... and yes before you ask, I am making sure to type the file name without the .html into the Input field.

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

Read about arrays in the wiki, you need to use a For loop to enumerate through the array. Arrays are the the fundamental basics you should grasp before tackling a search utility.

So I'm thinking my problem is lying within this command:

Rule of thumb, don't blame AutoIt immediately, as 99% of the time it's the user implementation of the function, which it is in your 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

Read about arrays in the wiki, you need to use a For loop to enumerate through the array. Arrays are the the fundamental basics you should grasp before tackling a search utility.

Rule of thumb, don't blame AutoIt immediately, as 99% of the time it's the user implementation of the function, which it is in your case.

 

Wasn't blaming the program, I was assuming I was using that command improperly.


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

_FileListToArray(..., $aHTML...)
For $i = 1 To $aHTML[0]
 ; ShellExecute($aHTML[$i]...)
Next

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

Oh, and here is what you should read >> http://www.autoitscript.com/wiki/Arrays


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

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Pictures\Scc.ico
#AutoIt3Wrapper_Outfile=C:\Program Files\StormCopperTSE\StormCopperTSE.exe
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_SaveSource=y
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Tidy_Stop_OnError=n
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <RecFileListToArray.au3>
#include <Array.au3>
#include <File.au3>
#include <IE.au3>
Opt("GUIOnEventMode", 1)
#region ### START Koda GUI section ### Form=C:\Users\Wombat\Documents\NewTSE.kxf
$Form1 = GUICreate("Trumpf500 Search Engine", 651, 362, 192, 124, BitOR($WS_THICKFRAME, $WS_POPUP))
GUISetBkColor(0x434E54)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$Pic1 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\StormSquare.gif", 12, 12, 49, 49)
GUICtrlSetOnEvent(-1, "Pic1Click")
$StormCopper = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\StormLogo.jpg", 78, 6, 385, 67)
GUICtrlSetOnEvent(-1, "StormCopperClick")
$Pic3 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\divider.jpg", -12, 72, 680, 25)
GUICtrlSetOnEvent(-1, "Pic3Click")
$Input1 = GUICtrlCreateInput("...", 338, 116, 178, 21)
GUICtrlSetOnEvent(-1, "Input1Change")
$Pic4 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\searchbar_half_1.5.jpg", 324, 104, 207, 45)
GUICtrlSetOnEvent(-1, "Pic4Click")
$Pic5 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\searchbar_half_2.5.jpg", 531, 104, 95, 45)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "Pic5Click")
$htmlButton = GUICtrlCreateButton("View Data Sheet", 352, 178, 224, 60, $BS_ICON)
GUICtrlSetImage(-1, "C:\Program Files\StormCopperTSE\res\Document-48.ico", -1)
GUICtrlSetFont(-1, 12, 400, 0, "Tahoma")
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "htmlButtonClick")
$Label1 = GUICtrlCreateLabel("View Data Sheet", 352, 157, 111, 22)
GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetOnEvent(-1, "Label1Click")
$ProgSelect = GUICtrlCreateCombo("ProgSelect", 353, 275, 224, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "ProgSelectChange")
$Label2 = GUICtrlCreateLabel("Select Program to Load", 351, 251, 156, 22)
GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetOnEvent(-1, "Label2Click")
$PartPreview = GUICtrlCreatePic("", 54, 145, 200, 200)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetOnEvent(-1, "PartPreviewClick")
$Label3 = GUICtrlCreateLabel("Part Preview", 112, 110, 84, 22)
GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetOnEvent(-1, "Label3Click")
$Pic2 = GUICtrlCreatePic("C:\Program Files\StormCopperTSE\res\close-button2.jpg", 519, 7, 102, 51)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "Pic2Click")
$Button1 = GUICtrlCreateButton("Button1", 607, 317, 43, 43, $BS_ICON)
GUICtrlSetImage(-1, "C:\Program Files\StormCopperTSE\res\reload_32.ico", -1)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "Button1Click")
$iError = @error
Local $aHTML
Local $aBMP
Local $aLST
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1

WEnd
; If you want the GUI to be moved as well.
Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    Return $HTCAPTION
EndFunc   ;==>WM_NCHITTEST
Func Button1Click()
    GUICtrlSetState($Label3, $GUI_HIDE)
    GUICtrlSetState($Label2, $GUI_HIDE)
    GUICtrlSetState($Label1, $GUI_HIDE)
    GUICtrlSetState($PartPreview, $GUI_HIDE)
    GUICtrlSetState($ProgSelect, $GUI_HIDE)
    GUICtrlSetState($htmlButton, $GUI_HIDE)
EndFunc   ;==>Button1Click
Func Form1Close()

EndFunc   ;==>Form1Close
Func Form1Maximize()

EndFunc   ;==>Form1Maximize
Func Form1Minimize()

EndFunc   ;==>Form1Minimize
Func Form1Restore()

EndFunc   ;==>Form1Restore
Func htmlButtonClick()
    $ReadInput1 = GUICtrlRead($Input1)
    _FileReadToArray("C:\Program Files\StormCopperTSE\ret\returned_html.txt", $aHTML)

    For $i = 2 To $aHTML[0]
        ShellExecute($aHTML[$i])
    Next
EndFunc   ;==>htmlButtonClick
Func Input1Change()

EndFunc   ;==>Input1Change
Func Label1Click()

EndFunc   ;==>Label1Click
Func Label2Click()

EndFunc   ;==>Label2Click
Func Label3Click()

EndFunc   ;==>Label3Click
Func PartPreviewClick()

EndFunc   ;==>PartPreviewClick
Func Pic1Click()

EndFunc   ;==>Pic1Click
Func Pic2Click()
    Exit
EndFunc   ;==>Pic2Click
Func Pic3Click()

EndFunc   ;==>Pic3Click
Func Pic4Click()

EndFunc   ;==>Pic4Click
Func Pic5Click()
    $ReadInput1 = GUICtrlRead($Input1)
    $aList = _RecFileListToArray("C:\", $ReadInput1 & ".html*", 1, 1, 1, 2)
    $bList = _RecFileListToArray("C:\", $ReadInput1 & ".bmp*", 1, 1, 1, 2)
    $clist = _RecFileListToArray("C:\", $ReadInput1 & ".lst*", 1, 1, 1, 2)
    If @error Then
        MsgBox(0, "Error", "Error File Not Found " & @CRLF & " - " & " Error Code: " & @extended & @CRLF)
    ElseIf IsArray($aList) Then
        _FileWriteFromArray("C:\Program Files\StormCopperTSE\ret\returned_html.txt", $aList)
        GUICtrlSetState($Label3, $GUI_SHOW)
        GUICtrlSetState($htmlButton, $GUI_SHOW)
    EndIf
    If @error Then
        MsgBox(0, "Error", "Error File Not Found " & @CRLF & " - " & " Error Code: " & @extended & @CRLF)
    ElseIf IsArray($aList) Then
        _FileWriteFromArray("C:\Program Files\StormCopperTSE\ret\returned_bmp.txt", $bList)
        GUICtrlSetState($Label1, $GUI_SHOW)
        _FileReadToArray("C:\Program Files\StormCopperTSE\ret\returned_bmp.txt", $aBMP)

        For $i = 2 To $aBMP[0]
            GUICtrlCreatePic($aBMP[$i], 54, 145, 200, 200)
        Next
    EndIf
    If @error Then
        MsgBox(0, "Error", "Error File Not Found " & @CRLF & " - " & " Error Code: " & @extended & @CRLF)
    ElseIf IsArray($aList) Then
        _FileWriteFromArray("C:\Program Files\StormCopperTSE\ret\returned_lst.txt", $clist)
        GUICtrlSetState($ProgSelect, $GUI_SHOW)
        GUICtrlSetState($Label2, $GUI_SHOW)
    EndIf
EndFunc   ;==>Pic5Click
Func ProgSelectChange()

EndFunc   ;==>ProgSelectChange
Func StormCopperClick()

EndFunc   ;==>StormCopperClick

Spent some time in the wiki, then perused the help file, came back with a working code!


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
_FileListToArray(..., $aHTML...)
For $i = 1 To $aHTML[0]
 ; ShellExecute($aHTML[$i]...)
Next

 

not needed, thank you though. I would prefer you not to give me a "fixed" version of my code, I learn nothing that way.

It's cool though because you taught me what i needed to know with this post:

Read about arrays in the wiki, you need to use a For loop to enumerate through the array. Arrays are the the fundamental basics you should grasp before tackling a search utility.

Rule of thumb, don't blame AutoIt immediately, as 99% of the time it's the user implementation of the function, which it is in your case.

 

Thank you very much guinness!

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

not needed, thank you though. I would prefer you not to give me a "fixed" version of my code, I learn nothing that way.

Good to hear. Though my code was hardly working. 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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...