Jump to content
Sign in to follow this  
Particle

Ini files and Arrays

Recommended Posts

Ok heres the basics. Im designing a program to allow users to load multiple files and folders into an Ini database and lock them from use with a single password for all or multiple passwords read from another Ini database. The problem I have is for the source code for folders. It seems to only lock the most recently folder loaded into the database and Im thinking something is coded wrong with the Arrays. Please help!!

Heres the code in the while 1 loop:

If $file <> "" Then
        Dim $Array
        _FileReadToArray(@WorkingDir&"\fdb.ini", $Array )
        For $z = 1 to $Array[0]
            $tmp = StringSplit($Array[$z],"=")
            If @Error = 1 Then
                _ReduceMemory()
            Else
                $filey = $tmp[2]
                If $filey <> "" and @error <> 1 Then
                    $temp = StringSplit($file,"\")
                    For $i = 1 to $temp[0]
                        $tmpreturn = $temp[$i]
                    Next
                EndIf
                If WinExists($tmpreturn) = 1 and $input <> 0 Then
                    WinKill($tmpreturn,"")
                    _PLock()
                EndIf
            EndIf
        Next
    EndIf

And heres the Functions used:

Func _PLock()
    $input = InputBox("","Password:","","*")
    If $input = $pw Then
        MsgBox(0,"Error","Access Granted",4)
        $input = 0
        _GUICtrlListDeleteItem($data,0)
        IniDelete(@WorkingDir&"\pdb.ini","data",$tmp[1])
        ShellExecute($File)
    Else
        MsgBox(0,"Error","Access Denied",4)
        $input = 1
    EndIf
EndFunc

Func _ReduceMemory()
   DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1)
EndFunc

Share this post


Link to post
Share on other sites

Welcome to the forums!

You never defined the value of $file, and this variable is what determines $tmpreturn.

Either you're setting it elsewhere in the script, or it was overlooked. (did you mean $filey instead?)

$input isn't defined either, so if it's set to 0, your If statement will never be true.

Take a look at the INIRead/INIReadSection functions as they are easy to debug.

Also, it would help if you posted a sample INI.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

Wow you totally didn't help me at all...if you realize this is just a section of my program not the whole thing, all variables are defined accordingly. Thanks for welcoming me to the forums, but i've been here for a while now, I just dont post a lot as you can see. Trust me I have read all of the helpme file on Ini's and Arrays. I came here for a reason you know.

Share this post


Link to post
Share on other sites

good point i'll try it, i slapped code together cause at first it was set to only lock one till i decided to add an ini database and stuff...

Share this post


Link to post
Share on other sites

i know why i have that for loop there, im splitting the the whole folder address from when i load it and grabbing the end of the address of the folder so i can declare to lock it

$file = FileSelectFolder("Choose a folder.", "")

i'll PM you the whole source

Share this post


Link to post
Share on other sites

i know why i have that for loop there, im splitting the the whole folder address from when i load it and grabbing the end of the address of the folder so i can declare to lock it

$file = FileSelectFolder("Choose a folder.", "")

i'll PM you the whole source

Then this should work:

$tmpreturn = $temp[$temp[0]]oÝ÷ ÚØ^±©jËaÆ®¶­sdf÷"b33c¶ÒFòb33c·FV׳Рb33c·F×&WGW&âÒb33c·FVײb33c¶Ð¤æW@

I still don't see the need for the FOR loop

Share this post


Link to post
Share on other sites

I will not have a chance to look over the entire source until the morning ( ITS TIME TO GO HOME :) ). I'm almost positive that somebody on this awesome forum will be able to help you though, if you post the whole script in this thread.

If I see you have not been helped at 7:00 AM PST, then I will begin debugging ^_^

Cheers

Share this post


Link to post
Share on other sites

Well I decided to post up my source since it'll help more if anyone out there can figure out my problem. I was told to use the _arrayDisplay(), but i'm going to wait and see what kinda feedback I get here before I get into that.

Source:

#include <GUIConstants.au3>
#include <File.au3>
#include <GuiList.au3>
#NoTrayIcon

Opt("TrayMenuMode",1)
Global $WinTrans = 0

$returnitem = TrayCreateItem("Return")
$traycredititem = TrayCreateItem("Credits")
TrayCreateItem("")
$trayexititem = TrayCreateItem("Exit")

TraySetState(@SW_HIDE)


$input = 1
$file = ""
$tmpreturn = 0
$pw = ""
$numb1 = 0
$numb2 = 0
$exists = FileExists("fdb.ini")
If $exists = 0 Then
    _FileCreate(@WorkingDir&"\fdb.ini")
    $write = FileOpen("fdb.ini",1)
    If $write = -1 Then
        MsgBox(0, "Error", "Unable to open file.")
        Exit
    EndIf
    FileWrite($write,"[data]" & @CRLF)
    FileClose($write)
EndIf
$exists2 = FileExists("pdb.ini")
If $exists2 = 0 Then
    _FileCreate(@WorkingDir&"\pdb.ini")
    $write = FileOpen("pdb.ini",1)
    If $write = -1 Then
        MsgBox(0, "Error", "Unable to open file.")
        Exit
    EndIf
    FileWrite($write,"[data]" & @CRLF)
    FileClose($write)
EndIf
;#ce

$main = GuiCreate("Vault v1",250,210,-1,-1,$WS_SIZEBOX+$WS_MINIMIZEBOX)
$filemenu = GuiCtrlCreateMenu ("&File")
$loaditem = GUICtrlCreateMenuItem ("Load",$filemenu)
$exititem = GUICtrlCreateMenuItem ("Exit",$filemenu)
$optmenu = GuiCtrlCreateMenu ("&Options")
$setitem = GUICtrlCreateMenuItem ("Settings",$optmenu)
$transitem = GUICtrlCreateMenuItem ("Transparency",$optmenu)
$miniitem = GUICtrlCreateMenuItem ("Minimize to Tray",$optmenu)
$helpmenu = GuiCtrlCreateMenu ("&Help")
$aboutitem = GUICtrlCreateMenuitem ("About",$helpmenu)
$credititem = GUICtrlCreateMenuitem ("Credits",$helpmenu)
$data = GuiCtrlCreateList("",6,9,235,150)
GuiSetState(@SW_SHOW,$main)

$setgui = GuiCreate("Settings",150,110)
$same = GuiCtrlCreateRadio("All Same Password",25,5)
$diff = GuiCtrlCreateRadio("Seperate Passwords",25,25)
GuiCtrlSetState(-1,$GUI_CHECKED)
GuiCtrlCreateLabel("Password:",2,55)
$pwinput = GuiCtrlCreateInput("",52,54,90,20)
GuiCtrlSetState(-1,$GUI_Disable)
$setbutton = GUICtrlCreateButton ("Apply", 25, 80, 100, 25)
GUISetState (@SW_HIDE,$setgui)

while 1
    _ReduceMemory()
    $msg = GuiGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE or $msg = $exititem Then
        FileDelete(@WorkingDir&"\fdb.ini")
        FileDelete(@WorkingDir&"\pdb.ini")
        Exit
    EndIf
    
    If $msg = $returnitem Then
        TraySetState(@SW_HIDE)
        GuiSetState(@SW_SHOW,$main)
    EndIf 
    
    If $msg = $miniitem Then
        TraySetState(@SW_SHOW)
        GuiSetState(@SW_HIDE,$main)
        While 1
            $msg = TrayGetMsg()
            Select
                Case $msg = 0
                    ContinueLoop
                Case $msg = $traycredititem
                    msgbox(0,"Credits","Created By: Dr.Pookie || Team EcS HeadMaster"&@crlf&""&@crlf&"Clan EoG@UsWest     ||      Clan RoT@UsEast")
                Case $msg = $trayexititem
                    Exit
                Case $msg = $returnitem
                    TraySetState(@SW_HIDE)
                    GuiSetState(@SW_SHOW,$main)
                    ExitLoop
            EndSelect
            
        WEnd
    EndIf
    
    If $msg = $credititem Then
        msgbox(0,"Credits","Created By: Dr.Pookie || Team EcS HeadMaster"&@crlf&""&@crlf&"Clan EoG@UsWest     ||      Clan RoT@UsEast")
    EndIf

    If $msg = $Aboutitem Then
        msgbox(0,"Help","Vault v1"&@Crlf&""&@crlf&"This program was designed to let you load"&@CRLF&" files and folders into an array database and"& _
        ""&@CRLF&" password lock them."&@CRLF&""&@CRLF&"Special thanks to Shadow for the idea!")
    EndIf
    
    If $msg = $setitem Then
        GUISetState (@SW_SHOW,$setgui)
        While 1
        $msg = GUIGetMsg ()
        Switch $msg
            Case $GUI_EVENT_CLOSE, $setbutton
                GUISetState (@SW_HIDE,$setgui)
                ExitLoop
            Case $same
                If GuiCtrlRead($same) = $GUI_CHECKED Then
                    GUICtrlSetState($pwinput,$GUI_Enable)
                    GUICtrlSetState($diff,$GUI_UNCHECKED)
                EndIf
            Case $diff
                If GuiCtrlRead($diff) = $GUI_CHECKED Then
                    GUICtrlSetState($pwinput,$GUI_Disable)
                    GUICtrlSetState($same,$GUI_UNCHECKED)
                EndIf
        EndSwitch
        WEnd
    EndIf
;====================================================================================
    If $msg = $loaditem Then
        $file = FileSelectFolder("Choose a folder.", "")
        If @Error = 1 Then
            MsgBox(0,"","No Folder Selected.")
        Else
            If GuiCtrlRead($same) = $GUI_CHECKED Then
                $pw = GuiCtrlRead($pwinput)
            ElseIf GuiCtrlRead($diff) = $GUI_CHECKED Then
                $pw = InputBox("","Designate a password.","","*")
                IniWrite(@WorkingDir&"\pdb.ini","data",$numb1,$pw)
                $numb1 = $numb1 + 1
            EndIf
            GuiCtrlSetData($data,$file)
            IniWrite(@WorkingDir&"\fdb.ini","data",$numb2,$file)
            $numb2 = $numb2 + 1
        EndIf
    EndIf

    If $file <> "" Then
        Dim $Array
        _FileReadToArray(@WorkingDir&"\fdb.ini", $Array )
        For $z = 1 to $Array[0]
            $tmp = StringSplit($Array[$z],"=")
            If @Error = 1 Then
                _ReduceMemory()
            Else
                $filey = $tmp[2]
                If $filey <> "" and @error <> 1 Then
                    $temp = StringSplit($file,"\")
                    For $i = 1 to $temp[0]
                        $tmpreturn = $temp[$i]
                    Next
                EndIf
                If WinExists($tmpreturn) = 1 and $input <> 0 Then
                    WinKill($tmpreturn,"")
                    _PLock()
                EndIf
            EndIf
        Next
    EndIf
;====================================================================================
    If $msg = $transitem Then _Set_Trans()
WEnd

Func _PLock()
    $input = InputBox("","Password:","","*")
    If $input = $pw Then
        MsgBox(0,"Error","Access Granted",4)
        $input = 0
        _GUICtrlListDeleteItem($data,0)
        IniDelete(@WorkingDir&"\pdb.ini","data",$tmp[1])
        ShellExecute($File)
    Else
        MsgBox(0,"Error","Access Denied",4)
        $input = 1
    EndIf
EndFunc

Func _ReduceMemory()
   DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1)
EndFunc

Func _Set_Trans()
    $GUI_Trans = GUICreate ("Set Transparency", 300, 100)
    $GUI_Trans_Slider = GUICtrlCreateSlider (10, 10, 290, 35)
    GUICtrlSetLimit ($GUI_Trans_Slider, 100, 0)
    GUICtrlSetData ($GUI_Trans_Slider, $WinTrans)
    $GUI_Trans_OK = GUICtrlCreateButton ("OK", 100, 60, 100, 25)
    GUISetState ()
    While 1
        $msg = GUIGetMsg ()
        Switch $msg
            Case $GUI_EVENT_CLOSE, $GUI_Trans_OK
                $WinTrans = GUICtrlRead ($GUI_Trans_Slider)
                GUIDelete ($GUI_Trans)
                ExitLoop
        EndSwitch
        WinSetTrans ($main, "", (100 - GUICtrlRead ($GUI_Trans_Slider))*2.5)
    WEnd
EndFunc

Share this post


Link to post
Share on other sites

One problem I found so far is this;

If $filey <> "" and @error <> 1 Then
                    $temp = StringSplit($file,"\")
                    For $i = 1 to $temp[0]
                        $tmpreturn = $temp[$i]
                    Next
                EndIf
                If WinExists($tmpreturn) = 1 and $input <> 0 Then
                    WinKill($tmpreturn,"")
                    _PLock()
                EndIf

Your $temp is processing the last value of $file, rather than the datas in your database. This is why it's only working for the last folder because that's the most current value of $file.

Share this post


Link to post
Share on other sites

when i tried using that in replace of the original i had i got this:

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Dale\Desktop\Vault.au3" 
C:\Users\Dale\Desktop\Vault.au3 (187) : ==> Variable used without being declared.: 
If $filey <> "" and @error <> 1 Then 
If ^ ERROR
>Exit code: 1   Time: 10.377

Share this post


Link to post
Share on other sites

when i tried using that in replace of the original i had i got this:

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Dale\Desktop\Vault.au3" 
C:\Users\Dale\Desktop\Vault.au3 (187) : ==> Variable used without being declared.: 
If $filey <> "" and @error <> 1 Then 
If ^ ERROR
>Exit code: 1   Time: 10.377
The code I posted is not replacement. Rather the section of your script where I found the problem as I've explain above. I have not come up with a solution, I'm still analyzing your script because it's hard to follow.

Can you explain clearly what exactly this script does?

Share this post


Link to post
Share on other sites

yeah i've been told my style of coding is a little different from normal. what the program does is allow u to load folders into a database and lock them with a password and in the main while loop it checks over and over for the designated folders to keep them locked untill someone types in the correct passwords which can be set to be the same for all the folders or each one different.

Share this post


Link to post
Share on other sites

yeah i've been told my style of coding is a little different from normal. what the program does is allow u to load folders into a database and lock them with a password and in the main while loop it checks over and over for the designated folders to keep them locked untill someone types in the correct passwords which can be set to be the same for all the folders or each one different.

That's what I thought what you're trying to do. Now I can see a lot of things going wrong. Sorry. :)

Right now, your script loops the whole process including the ones that doesn't needs to be looped. Therefore, I'm trying to rewrite your script into something that make sense.

Obviously, your function _Plock() needs to be running constantly checking if any of the folder in the INI is open. Therefore this part of your script;

If WinExists($tmpreturn) = 1 and $input <> 0 Then
    WinKill($tmpreturn,"")
    _PLock()
EndIfoÝ÷ Ú+¢wî²)àb§yçm¢»§¶}8^)ì×­ãå¡Éºw-ȧ]بØb²Z(¥«­¢+Ù½ÈÀÌØíèôÄѼÀÌØíÉÉålÁt(ÀÌØíѵÀôMÑÉ¥¹MÁ±¥Ð ÀÌØíÉÉålÀÌØíét°ÅÕ½ÐìôÅÕ½Ðì¤(%ÉɽÈôÄQ¡¸(}5µ½Éä ¤(±Í(ÀÌØí¥±äôÀÌØíѵÁlÉt(%ÀÌØí¥±ä±ÐìÐìÅÕ½ÐìÅÕ½Ðì¹ÉɽȱÐìÐìÄQ¡¸(ÀÌØíѵÀôMÑÉ¥¹MÁ±¥Ð ÀÌØí¥±°ÅÕ½ÐìÀäÈìÅÕ½Ðì¤(½ÈÀÌØí¤ôÄѼÀÌØíѵÁlÁt(ÀÌØíѵÁÉÑÕɸôÀÌØíѵÁlÀÌØí¥t(9áÐ(¹%(%]¥¹á¥ÍÑÌ ÀÌØíѵÁÉÑÕɸ¤ôĹÀÌØí¥¹ÁÕбÐìÐìÀQ¡¸(]¥¹-¥±° ÀÌØíѵÁÉÑÕɸ°ÅÕ½ÐìÅÕ½Ðì¤(}A1½¬ ¤(¹%(¹%(9áoÝ÷ ÙÚ²}ýµÚŧ-,!jܨ»§¶Ú ìµæ¡úk¡Ç¬²)ày§!zW¦z{)àªê-Ó~­oÝ÷ ÚÈhºW[y«­¢+ØÀÌØíѵÀôMÑÉ¥¹MÁ±¥Ð ÀÌØí¥±ä°ÅÕ½ÐìÀäÈìÅÕ½Ðì¤

Those are just the things I notice. I suggested that you use the Array.au3 UDF, so you can see what's going on inside your array variables. I found all these using Array.au3 UDF.

I'll write something that can accomplish your goal and you can customized it from there if you want. Also you can fix your script using this information if you want.

Good luck.

Share this post


Link to post
Share on other sites

Ok, here's what I got;

; Include
#include <GUIConstants.au3>
#include <File.au3>
#include <GuiList.au3>
#Include <Array.au3>
;#NoTrayIcon

;****************************************************Global Variables
Global $WinTrans = 0
$returnitem = TrayCreateItem("Return")
$traycredititem = TrayCreateItem("Credits")
$trayexititem = TrayCreateItem("Exit")
$input = 1
$file = ""
$tmpreturn = 0
$pw = ""
$numb1 = 0
$numb2 = 1
$exists = FileExists("mainDB.ini")

;****************************************************Preps
TrayCreateItem("")
TraySetState(@SW_HIDE)
Opt("TrayMenuMode",1)

; ****************************************************.INI file database
If FileExists(@WorkingDir & "\mainDB.ini") Then
    FileSetAttrib(@WorkingDir & "\mainDB.ini", "-RASHNOT")
Else
    IniWrite(@WorkingDir & "\mainDB.ini", "data", "key", "value")
    FileSetAttrib(@WorkingDir & "\mainDB.ini", "-RASHNOT")
EndIf

; ****************************************************GUI - Main
$main = GuiCreate("Vault v1",250,210,-1,-1,$WS_SIZEBOX+$WS_MINIMIZEBOX)
$filemenu = GuiCtrlCreateMenu ("&File")
$loaditem = GUICtrlCreateMenuItem ("Load",$filemenu)
$exititem = GUICtrlCreateMenuItem ("Exit",$filemenu)
$optmenu = GuiCtrlCreateMenu ("&Options")
$setitem = GUICtrlCreateMenuItem ("Settings",$optmenu)
$transitem = GUICtrlCreateMenuItem ("Transparency",$optmenu)
$miniitem = GUICtrlCreateMenuItem ("Minimize to Tray",$optmenu)
$helpmenu = GuiCtrlCreateMenu ("&Help")
$aboutitem = GUICtrlCreateMenuitem ("About",$helpmenu)
$credititem = GUICtrlCreateMenuitem ("Credits",$helpmenu)
$data = GuiCtrlCreateList("",6,9,235,150)
GuiSetState(@SW_SHOW)

; ****************************************************GUI - Settings
$setgui = GuiCreate("Settings", 300, 200, -1, @DesktopHeight - 600, $DS_MODALFRAME, -1, $main)
$same = GuiCtrlCreateRadio("All Same Password",25,5)
$diff = GuiCtrlCreateRadio("Seperate Passwords",25,25)
GuiCtrlSetState(-1,$GUI_CHECKED)
GuiCtrlCreateLabel("Password:",2,55)
$pwinput = GuiCtrlCreateInput("",52,54,90,20)
GuiCtrlSetState(-1,$GUI_Disable)
$setbutton = GUICtrlCreateButton ("Apply", 25, 80, 100, 25)
GUISetState (@SW_HIDE)

; ****************************************************Running time
While 1
    $msg = GuiGetMsg()
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            FileDelete(@WorkingDir & "\mainDB.ini")
            Exit
            
        Case $msg = $exititem
            FileDelete(@WorkingDir & "\mainDB.ini")
            Exit
            
        Case $msg = $returnitem
            TraySetState(@SW_HIDE)
            GuiSetState(@SW_SHOW,$main)
            
        Case $msg = $miniitem
            TraySetState(@SW_SHOW)
            GuiSetState(@SW_HIDE,$main)
            _TrayState(0)
        
        Case $msg = $credititem
            msgbox(0,"Credits","Created By: Dr.Pookie || Team EcS HeadMaster"&@crlf&""&@crlf&"Clan EoG@UsWest      ||      Clan RoT@UsEast")
            
        Case $msg = $Aboutitem
            msgbox(0,"Help","Vault v1"&@Crlf&""&@crlf&"This program was designed to let you load"&@CRLF&" files and folders into an array database and"&@CRLF&" password lock them."&@CRLF&""&@CRLF&"Special thanks to Shadow for the idea!")
            
        Case $msg = $setitem
            GUISetState(@SW_SHOW, $setgui)
            
        Case $msg = $setbutton
            GUISetState (@SW_HIDE,$setgui)
                        
        Case $msg = $same
            If GuiCtrlRead($same) = $GUI_CHECKED Then
                GUICtrlSetState($pwinput,$GUI_Enable)
                GUICtrlSetState($diff,$GUI_UNCHECKED)
            EndIf
                        
        Case $msg = $diff
            If GuiCtrlRead($diff) = $GUI_CHECKED Then
                GUICtrlSetState($pwinput,$GUI_Disable)
                GUICtrlSetState($same,$GUI_UNCHECKED)
            EndIf
            
        Case $msg = $loaditem
            $file = FileSelectFolder("Choose a folder.", "")
            If @Error = 1 Then
                MsgBox(0,"","No Folder Selected.")
            Else
                ; Setting up password
                If GuiCtrlRead($same) = $GUI_CHECKED Then
                    $pw = GuiCtrlRead($pwinput)
                ElseIf GuiCtrlRead($diff) = $GUI_CHECKED Then
                    $pw = InputBox("","Designate a password.","","*")
                EndIf
                
                ; Updating display list
                GuiCtrlSetData($data,$file)
                
            ; Writing info into INI file
            IniWrite(@WorkingDir & "\mainDB.ini", "data", $numb1, $file)
            $numb1 = $numb1 + 1
            IniWrite(@WorkingDir & "\mainDB.ini", "data", $numb1, $pw)
            $numb1 = $numb1 + 1
                
            ; Arraying info from INI file
            Dim $iniArray
            _FileReadToArray(@WorkingDir & "\mainDB.ini", $iniArray)
            _ArrayDelete($iniArray, 0)
            _ArrayDelete($iniArray, 0)
            _ArrayDelete($iniArray, 0)
            _ArrayDelete($iniArray, UBound($iniArray))
            _ArrayDisplay($iniArray, "$iniArray contents") ; debug - checks array contents
            
            For $iz = 0 to UBound($iniArray) - 1
                $tmp = StringSplit($iniArray[$iz],"=")
                $iniArray[$iz] = $tmp[2]
            Next
            _ArrayDisplay($iniArray, "$iniArray contents") ; debug - checks array contents
            
            $iq = UBound($iniArray) / 2
            Global $ascArray[$iq][2]
            
            $ini = 0
            For $idx = 0 To $iq - 1
                $ascArray[$idx][0] = $iniArray[$ini]
                $ini = $ini + 1
                $ascArray[$idx][1] = $iniArray[$ini]
                $ini = $ini + 1
            Next
            _ArrayDisplay($ascArray, "$ascArray contents") ; debug - checks array contents
            _PLock()
            EndIf
            
        Case $msg = $transitem
            _Set_Trans()
    EndSelect
WEnd

; ****************************************************Functions
Func _PLock()
    For $cW = 0 To UBound($ascArray) - 1
        If WinExists($ascArray[$cW][0]) and $input <> 0 Then
            WinKill($ascArray[$cW][0],"")
            $input = InputBox("","Password for " & $ascArray[$cW][0] & ":","","*")
            If $input == $ascArray[$cW][1] Then
                MsgBox(0,"Success","Access Granted",4)
                $input = 0
                ;_GUICtrlListDeleteItem($data,0)
                ;IniDelete(@WorkingDir & "\mainDB.ini","data",$tmp[1])
                ShellExecute($ascArray[$cW][0])
            Else
                MsgBox(0,"Error","Access Denied",4)
                $input = 1
            EndIf
        EndIf
    Next
EndFunc

Func _TrayState($status)
    While $status = 0
        $msg2 = TrayGetMsg()
        Select
            Case $msg2 = 0
                ContinueLoop
            
            Case $msg2 = $traycredititem
                msgbox(0,"Credits","Created By: Dr.Pookie || Team EcS HeadMaster"&@crlf&""&@crlf&"Clan EoG@UsWest      ||      Clan RoT@UsEast")
                        
            Case $msg2 = $trayexititem
                Exit
                        
            Case $msg2 = $returnitem
                TraySetState(@SW_HIDE)
                GuiSetState(@SW_SHOW,$main)
                $status = 1
                ExitLoop
        EndSelect
    WEnd
EndFunc

Func _ReduceMemory()
   DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1)
EndFunc

Func _Set_Trans()
    $GUI_Trans = GUICreate ("Set Transparency", 300, 100)
    $GUI_Trans_Slider = GUICtrlCreateSlider (10, 10, 290, 35)
    GUICtrlSetLimit ($GUI_Trans_Slider, 100, 0)
    GUICtrlSetData ($GUI_Trans_Slider, $WinTrans)
    $GUI_Trans_OK = GUICtrlCreateButton ("OK", 100, 60, 100, 25)
    GUISetState ()
    While 1
        $msg = GUIGetMsg ()
        Switch $msg
            Case $GUI_EVENT_CLOSE, $GUI_Trans_OK
                $WinTrans = GUICtrlRead ($GUI_Trans_Slider)
                GUIDelete ($GUI_Trans)
                ExitLoop
        EndSwitch
        WinSetTrans ($main, "", (100 - GUICtrlRead ($GUI_Trans_Slider))*2.5)
    WEnd
EndFunc

As far as I'm concern, it's working as it should. You can then tweak it as you like, then simply comment out or delete the _ArrayDisplay's when you're done debugging.

Share this post


Link to post
Share on other sites

thanks for the redesign on the sourcecode, but now my program doesn't work at all. it doesn't lock protect the folders as i designed it to originally and the settings gui doesn't even show up anymore for use. although it shouldnt be hard to manipulate a few bits of code for the settings, the problem is i dont know what to do for the folder locking. before it worked only with one folder at a time, but now it doesn't work at 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  

×
×
  • Create New...