Sign in to follow this  
Followers 0
Kyme

How to make ini files?

9 posts in this topic

i have some question...

how i make .ini file to script remember last info

for ex.

i have 1 GuiCtrlCreateInput how to make it to script create .imi file and record there last text added in GuiCtrlCreateInput

and when i start script to add that text in GuiCtrlCreateInput???

Tnx

Share this post


Link to post
Share on other sites



Dim $CSVFILE = @ScriptDir & "\Data\Path.ini"
- where to save the ini

$INIREAD = IniRead($CSVFILE, "Example", "example", "anothere example")
$DIZINAYAR = GUICtrlSetData(ControlID, $INIREAD)

$SROPATHCHANGE = FileSelectFolder("Select Silkroad Directory", "")
        GUICtrlSetData($SROPATH, $SROPATHCHANGE & "\")
- look alitle on this code and u will see this is what u need to write and read the ini

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

i am little noob in autoit....:)

this is what i try to make

#include <GuiConstants.au3>
Opt("TrayMenuMode",1)
GuiCreate("Universal Hider", 200, 100)
GuiSetState(true)

GUICtrlCreateLabel('Task Name',70,7,100,2*9)
$filecap = GUICtrlCreateMenu ("&File")
$filein = GUICtrlCreateMenuitem ("Quit",$filecap)
$Input = GuiCtrlCreateInput('',50,20,100,2*9)


$hide = Guictrlcreatebutton("Hide It!", 18, 45, 2*40)
$show = Guictrlcreatebutton("Show It!", 102, 45, 2*40)




While 1

      $msg = GUIGetMsg()
   Select       
     Case $msg= $filein
    ExitLoop
   EndSelect
   If $msg = $Gui_event_close Then
    Exit
   EndIf
   If $msg= $hide Then
                hide()
   EndIf
   If $msg= $show Then
                show()
   EndIf
WEnd
    

Func hide()
    Winsetstate(GuiCtrlRead($Input), "",@SW_HIDE)
EndFunc
Func show()
     Winsetstate(GuiCtrlRead($Input), "",@SW_SHOW)
EndFunc

can you guys give me some ex. please

sry for my nooby

how i can make it to script remember last $Input????

Edited by Kyme

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

First, the Input is a GUICtrl and not a window, so WinSetState would never work.

Second, you don't have to read the input's data if you just want to show/hide it.

And third, in a GUICtrl, @SW_SHOW and @SW_HIDE would never work either.

Instead of WinSetState, it will be GUICtrlSetState,

Instead of GUICtrlRead($Input), it will be just $Input,

Instead of @SW_HIDE and @SW_SHOW, they will be $GUI_HIDE and $GUI_SHOW.

SO your functions should be like:

Func hide()
    GUICtrlSetState ($Input, $GUI_HIDE)
EndFunc
Func show()
    GUICtrlSetState ($Input, $GUI_SHOW)
EndFuncoÝ÷ Økzg¦mêìÊ«zn¶¸ ÙèÂÚæ«Øî²Öu«­¢+ÙU%
ÑɱMÑÑ ÀÌØí%¹ÁÕаÅÕ½ÐìÅÕ½Ðì
Edited by Info

Share this post


Link to post
Share on other sites

i understand what you try to explain me but i didn't wann to hide GuiCtrlRead

i wanna make one .ini file whit last text added in GuiCtrlRead

i wanna make this application for hide other application like games and when i exit from the script to write in the .ini the game name and when i start script to read ini and auto write game name

can someone please help me whit IniWrite,IniRead codes???where i must put it to script work

please boys help me

Share this post


Link to post
Share on other sites

It just can't get simpler than that:

#include <GUIConstants.au3>

$MainGUI = GUICreate("INI Stuff", 202, 95, -1, -1)
$Input = GUICtrlCreateInput("", 8, 8, 185, 21)
$Clear = GUICtrlCreateButton ("Clear Input's Data", 8, 36, 185, 25)
$IniWrite = GUICtrlCreateButton("Ini Write", 8, 65, 57, 25, 0)
$IniRead = GUICtrlCreateButton("Ini Read", 72, 65, 57, 25, 0)
$IniDelete = GUICtrlCreateButton("Ini Delete", 136, 65, 57, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $IniWrite
            IniWrite ("Ini File.ini", "Input Section", "Input Info", GUICtrlRead($Input))
        Case $IniRead
            GUICtrlSetData ($Input, IniRead ("Ini File.ini", "Input Section", "Input Info", ""))
        Case $IniDelete
            IniDelete ("Ini File.ini", "Input Section", "Input Info")
        Case $Clear
            GUICtrlSetData ($Input, "")
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

haah i love the code

#include <GUIConstants.au3>

$MainGUI = GUICreate("INI Stuff", 202, 95, -1, -1)
$Input = GUICtrlCreateInput("", 8, 8, 185, 21)
$Clear = GUICtrlCreateButton ("Clear Input's Data", 8, 36, 185, 25)
$IniWrite = GUICtrlCreateButton("Ini Write", 8, 65, 57, 25, 0)
$IniRead = GUICtrlCreateButton("Ini Read", 72, 65, 57, 25, 0)
$IniDelete = GUICtrlCreateButton("Ini Delete", 136, 65, 57, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $IniWrite
            IniWrite ("Ini File.ini", "Input Section", "Input Info", GUICtrlRead($Input))
        Case $IniRead
            GUICtrlSetData ($Input, IniRead ("Ini File.ini", "Input Section", "Input Info", ""))
        Case $IniDelete
            IniDelete ("Ini File.ini", "Input Section", "Input Info")
        Case $Clear
            GUICtrlSetData ($Input, "")
    EndSwitch
WEnd

---------------------------------------------------------------------------------------------------------------->>>>>>| |My scripts: |Warcraft lll auto login -- an auto login to warcraft lll ;) |Wow auto login -- an auto login to wow ;) | |---------------------------------------------------------------------------------------------------------------->>>>>>|

Share this post


Link to post
Share on other sites

heheeeeeeeee this is the code......tnx for the help.....

Nice people on this forum....tnx all

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  
Followers 0