silver2002 Posted January 11, 2019 Share Posted January 11, 2019 hi guys im new here and need your help i wanna create dropdown menu with list of keys from INI file and when i choose key i need to show Value outside of dropdown menu (like just show result) i hope u understand what i need example of ini [Phone] John Johnson=1234567890 Jack Jackson=2345678901 Dany Danson=0987654321 so in dropdown menu by selecting key (ex.John Johnson) i need see result on screen i searching for some similar code but i cant find any Link to comment Share on other sites More sharing options...
careca Posted January 11, 2019 Share Posted January 11, 2019 (edited) The basic idea is to read the ini, and then grab that list and populate the drop down, then when you select the item in the dropdown, read it and put the value wherever you want. I would start with IniReadSection, create the combo box with GUICtrlCreateCombo and go from there. Edited January 11, 2019 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
silver2002 Posted January 11, 2019 Author Share Posted January 11, 2019 i dont know how... i need basic script Link to comment Share on other sites More sharing options...
TheXman Posted January 11, 2019 Share Posted January 11, 2019 11 minutes ago, silver2002 said: i need basic script The help file is FULL of example scripts. You should start with example scripts for the functions that @careca suggested. The more effort you show, the more help you're likely to get. CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Subz Posted January 11, 2019 Share Posted January 11, 2019 Welcome to AutoIt, here is a basic script to get you started, use the help file to understand how it works. #include <Array.au3> #include <GuiComboBox.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $iUserList ;~ Get data from ini file Local $aUserInfo = IniReadSection(@ScriptDir & "\test.ini", "Phone") If @error Then Exit MsgBox(4096, "Error", "Error opening ini file") Local $hGUI = GUICreate("User Info", 305, 200) Local $idUserList = GUICtrlCreateCombo("Select User", 10, 10, 150, 20) ;~ Add names from the array. GUICtrlSetData($idUserList, _ArrayToString($aUserInfo, "|", 1, -1, "|", 0, 0), "Select User") Local $idUserPhone = GUICtrlCreateLabel("", 170, 13, 150, 20) GUICtrlSetFont(-1, 11, 800) Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton_Close ExitLoop Case $idUserList $iUserList = _GUICtrlComboBox_GetCurSel($idUserList) GUICtrlSetData($idUserPhone, $aUserInfo[$iUserList][1]) EndSwitch WEnd GUIDelete($hGUI) EndFunc Link to comment Share on other sites More sharing options...
silver2002 Posted January 11, 2019 Author Share Posted January 11, 2019 thank you very much ill analyze script now to see how it work... Link to comment Share on other sites More sharing options...
silver2002 Posted January 12, 2019 Author Share Posted January 12, 2019 ok... now im stuck on another problem... i dont know if that possible but i would like show some pic (splash screen) from ini file i try this but not work: #include <Array.au3> #include <GuiComboBox.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $iUserList ;~ Get data from ini file Local $aUserInfo = IniReadSection(@ScriptDir & "\test.ini", "Phone") If @error Then Exit MsgBox(4096, "Error", "Error opening ini file") Local $hGUI = GUICreate("User Info", 305, 200) Local $idUserList = GUICtrlCreateCombo("Select User", 10, 10, 150, 20) ;~ Add names from the array. GUICtrlSetData($idUserList, _ArrayToString($aUserInfo, "|", 1, -1, "|", 0, 0), "Select User") Local $idUserPhone = GUICtrlCreateLabel("", 170, 13, 150, 20) GUICtrlSetFont(-1, 11, 800) Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton_Close ExitLoop Case $idUserList $iUserList = _GUICtrlComboBox_GetCurSel($idUserList) $showpic = GUICtrlSetData($idUserPhone, $aUserInfo[$iUserList][1]) SplashImageOn("Splash Screen", $showpic, 400, 400, -1, -1, $DLG_NOTITLE) Sleep(5000) EndSwitch WEnd GUIDelete($hGUI) EndFunc and test.ini is: [Phone] John Johnson=john.bmp Jack Jackson=jack.bmp Dany Danson=dany.bmp Link to comment Share on other sites More sharing options...
Subz Posted January 13, 2019 Share Posted January 13, 2019 You would need to use the array item or use GuiCtrlRead for $idUserPhone. You could also look at GuiCtrlCreatePic if you wanted it embedded in the Gui, just read the help file for more information. Case $idUserList $iUserList = _GUICtrlComboBox_GetCurSel($idUserList) GUICtrlSetData($idUserPhone, $aUserInfo[$iUserList][1]) SplashImageOn("Splash Screen", $aUserInfo[$iUserList][1], 400, 400, -1, -1, $DLG_NOTITLE) ;~ Or ;~ SplashImageOn("Splash Screen", GUICtrlRead($idUserPhone), 400, 400, -1, -1, $DLG_NOTITLE) EndSwitch Link to comment Share on other sites More sharing options...
silver2002 Posted January 13, 2019 Author Share Posted January 13, 2019 thank you again !!! i readed help file but i need a looottt of knowledge for sure... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now