CODICE
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=S.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=~ Password Memory
#AutoIt3Wrapper_Res_Description=~ Password Memory
#AutoIt3Wrapper_Res_Fileversion=0.0.0.2
#AutoIt3Wrapper_Res_LegalCopyright=Aaly©
#AutoIt3Wrapper_Res_Language=1040
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.6.1
Autore: Aaly
#ce ----------------------------------------------------------------------------
;--->
#include <GUIConstants.au3>
#include <GuiListView.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#include <Misc.au3>
; -->
#include "__Login.au3"
#include "__Opzioni.au3"
#include "__PswLib.au3"
#include "__Dati.au3"
#include "__InfoVersione.au3"
#include "__BugReporter.au3"
#include "XXTEA.au3"
;-->
; --->
;Dichiarazione delle variabili base per il funzionamento del programma
Local $color, $font
Global $loo, $s, $item, $y, $LOGIN, $INI, $pos, $GUI_ON, $reb = 0
Global $TEMP = @TempDir & "\Temp.psm"
Global $NEW = @TempDir & "\New.psm"
Global $MOD = @TempDir & "\ModUser.psm"
Global $SBL = @TempDir & "\Sblock.psm"
Global $RES = @TempDir & "\Reset.psm"
Global $NFO = @TempDir & "\Nfo.ini"
Global $CONFG = @ScriptDir & "\Confg.ini"
;Dichiarazione delle variabili relative la configurazione grafica
__LoadSetGraphycOption()
;INIZIO DEL PROGRAMMA
__PSM_Verify()
__CreateLogin()
If $LOGIN = False Then Exit
Global $Form = GUICreate(" ~ PSM", 660, 285)
GUISetBkColor($PSM_BK)
GUISetFont($PSM_Font[1],$PSM_Font[2],$PSM_Font[3],$PSM_Font[4])
$MenuItem1 = GUICtrlCreateMenu("File")
$MenuItem2 = GUICtrlCreateMenuItem("Elimina le categorie", $MenuItem1)
$MenuItem3 = GUICtrlCreateMenuItem("Elimina categoria", $MenuItem1)
GUICtrlCreateMenuItem("", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("Elimina tutto", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenu("Programma")
$MenuItem6 = GUICtrlCreateMenuItem("Finestra OnTop", $MenuItem5)
$MenuItem7 = GUICtrlCreateMenuItem("Opzioni", $MenuItem5)
$MenuItem8 = GUICtrlCreateMenuItem("Crediti", $MenuItem5)
GUICtrlCreateMenuItem("", $MenuItem5)
$MenuItem9 = GUICtrlCreateMenuItem("Controlla aggiornamenti", $MenuItem5)
$MenuItem10 = GUICtrlCreateMenuItem("Bug Reporter", $MenuItem5)
$MenuItem11 = GUICtrlCreateMenu("Documenti")
$MenuItem12 = GUICtrlCreateMenuItem("Info versione", $MenuItem11)
$MenuItem13 = GUICtrlCreateMenuItem("Contratto di licenza", $MenuItem11)
$MenuItem14 = GUICtrlCreateMenu("User")
$MenuItem15 = GUICtrlCreateMenuItem("Cambia accaunt", $MenuItem14)
$MenuItem16 = GUICtrlCreateMenuItem("Info accaunt", $MenuItem14)
$MenuItem17 = GUICtrlCreateMenu("Interfaccia")
$MenuItem18 = GUICtrlCreateMenu("GUI",$MenuItem17)
$MenuItem19 = GUICtrlCreateMenuItem("Background", $MenuItem18)
$MenuItem20 = GUICtrlCreateMenuItem("Font", $MenuItem18)
$MenuItem21 = GUICtrlCreateMenu("Bottoni",$MenuItem17)
$MenuItem22 = GUICtrlCreateMenuItem("Background", $MenuItem21)
$MenuItem23 = GUICtrlCreateMenuItem("Font", $MenuItem21)
$MenuItem24 = GUICtrlCreateMenu("Input",$MenuItem17)
$MenuItem25 = GUICtrlCreateMenuItem("Background", $MenuItem24)
$MenuItem26 = GUICtrlCreateMenuItem("Font", $MenuItem24)
$MenuItem27 = GUICtrlCreateMenu("List",$MenuItem17)
$MenuItem28 = GUICtrlCreateMenuItem("Background", $MenuItem27)
$MenuItem29 = GUICtrlCreateMenuItem("Font", $MenuItem27)
$MenuItem30 = GUICtrlCreateMenu("Categorie",$MenuItem17)
$MenuItem31 = GUICtrlCreateMenuItem("Background", $MenuItem30)
$MenuItem32 = GUICtrlCreateMenuItem("Font", $MenuItem30)
GUICtrlCreateMenuItem("", $MenuItem17)
$MenuItem33 = GUICtrlCreateMenuItem("Applica", $MenuItem17)
$MenuItem34 = GUICtrlCreateMenuItem("Reimposta default", $MenuItem17)
GUICtrlCreateLabel("Categorie: ", 8, 6, 66, 17)
GUIctrlSetColor(-1,$PSM_FC)
$List1 = GUICtrlCreateList("", 8, 24, 129, 175)
GUICtrlSetBkColor(-1,$CAT_BK)
GUICtrlSetFont(-1,$CAT_Font[1],$CAT_Font[2],$CAT_Font[3],$CAT_Font[4])
$lest = GUICtrlCreateListView("",176, 3, 481, 259, 0x0020)
GUICtrlSetBkColor(-1,$LIS_BK)
GUICtrlSetFont(-1,$LIS_Font[1],$LIS_Font[2],$LIS_Font[3],$LIS_Font[4])
_GUICtrlListView_InsertColumn($lest, 0, "UserID", 130)
_GUICtrlListView_InsertColumn($lest, 1, "Password", 150)
_GUICtrlListView_InsertColumn($lest, 2, "Descrizione", 200)
$Button1 = GUICtrlCreateButton("Aggiungi dati", 8, 210, 131, 20, $WS_GROUP)
GUICtrlSetFont(-1,$BUT_Font[1],$BUT_Font[2],$BUT_Font[3],$BUT_Font[4])
If $BUT_FC <> "0x000000" Then GUICtrlSetColor(-1,$BUT_FC)
If $BUT_BK <> 0 Then GUICtrlSetBkColor(-1,$BUT_BK)
$Button2 = GUICtrlCreateButton("Aggiungi una categoria", 8, 234, 131, 20, $WS_GROUP)
GUICtrlSetFont(-1,$BUT_Font[1],$BUT_Font[2],$BUT_Font[3],$BUT_Font[4])
If $BUT_FC <> "0x000000" Then GUICtrlSetColor(-1,$BUT_FC)
If $BUT_BK <> 0 Then GUICtrlSetBkColor(-1,$BUT_BK)
$Button3 = GUICtrlCreateButton("+", 144, 16, 25, 25, $WS_GROUP)
GUICtrlSetFont(-1,$BUT_Font[1],$BUT_Font[2],$BUT_Font[3],$BUT_Font[4])
If $BUT_FC <> "0x000000" Then GUICtrlSetColor(-1,$BUT_FC)
If $BUT_BK <> 0 Then GUICtrlSetBkColor(-1,$BUT_BK)
GUICtrlSetTip(-1,"Aggiungi voce.")
$Button4 = GUICtrlCreateButton("X", 144, 48, 25, 25, $WS_GROUP)
GUICtrlSetFont(-1,$BUT_Font[1],$BUT_Font[2],$BUT_Font[3],$BUT_Font[4])
If $BUT_FC <> "0x000000" Then GUICtrlSetColor(-1,$BUT_FC)
If $BUT_BK <> 0 Then GUICtrlSetBkColor(-1,$BUT_BK)
GUICtrlSetTip(-1,"Elimina selezionato.")
$Button5 = GUICtrlCreateButton("E", 144, 80, 25, 25, $WS_GROUP)
GUICtrlSetFont(-1,$BUT_Font[1],$BUT_Font[2],$BUT_Font[3],$BUT_Font[4])
If $BUT_FC <> "0x000000" Then GUICtrlSetColor(-1,$BUT_FC)
If $BUT_BK <> 0 Then GUICtrlSetBkColor(-1,$BUT_BK)
GUICtrlSetTip(-1,"Modifica selezionato.")
$Button6 = GUICtrlCreateButton("R", 144, 144, 25, 25, $WS_GROUP)
GUICtrlSetFont(-1,$BUT_Font[1],$BUT_Font[2],$BUT_Font[3],$BUT_Font[4])
If $BUT_FC <> "0x000000" Then GUICtrlSetColor(-1,$BUT_FC)
If $BUT_BK <> 0 Then GUICtrlSetBkColor(-1,$BUT_BK)
GUICtrlSetTip(-1,"Aggiorna elementi della categoria.")
$Button7 = GUICtrlCreateButton("Op", 144, 112, 25, 25, $WS_GROUP)
GUICtrlSetFont(-1,$BUT_Font[1],$BUT_Font[2],$BUT_Font[3],$BUT_Font[4])
If $BUT_FC <> "0x000000" Then GUICtrlSetColor(-1,$BUT_FC)
If $BUT_BK <> 0 Then GUICtrlSetBkColor(-1,$BUT_BK)
GUICtrlSetTip(-1,"Apri le opzioni.")
$Button8 = GUICtrlCreateButton("S", 144, 176, 25, 25, $WS_GROUP)
GUICtrlSetFont(-1,$BUT_Font[1],$BUT_Font[2],$BUT_Font[3],$BUT_Font[4])
If $BUT_FC <> "0x000000" Then GUICtrlSetColor(-1,$BUT_FC)
If $BUT_BK <> 0 Then GUICtrlSetBkColor(-1,$BUT_BK)
GUICtrlSetTip(-1,"Mostra l'elemento selezionato.")
If IniRead($CONFG,"PSM","Top",0) = 1 Then
WinSetOnTop(" ~ PSM","",1)
GUICtrlSetState($MenuItem6, $GUI_CHECKED)
Else
WinSetOnTop(" ~ PSM","",0)
GUICtrlSetState($MenuItem6, $GUI_UNCHECKED)
EndIf
__SetGUISavePos("psm")
GUISetState(@SW_SHOW)
_String()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
WinActivate(" ~ PSM","")
__SaveGUIPos("psm")
_Temp_Rewrite()
Exit
Case $list1
$loo = GUICtrlRead($list1)
__CategoryGetItem()
Case $lest
$loo = GUICtrlRead($list1)
__ShowSelected_Item(__GetSelected_ItemNumber(),$loo)
; -------------------------------------------------------------------->
;BOTTONI
; -------------------------------------------------------------------->
Case $Button1 ;Aggiungi dati
__AggiungiDati()
__CategoryGetItem()
__Temp_BackUp()
Case $Button2 ;Aggiungi una categoria
$SO = InputBox("Nuova categoria", "Inserisci il nome della nuova categoria." & @CRLF & "La categoria verrà visualizzata nell'elenco e potrete aggiungerci i dati tramite il bottone 'Aggiungi Dati'.", "","",150,200)
If @error = 0 Then IniWrite($TEMP, "CATEGORIE", $SO, $SO)
__Temp_BackUp()
_String()
Case $Button3 ;Aggiungi dati
$loo = GUICtrlRead($list1)
__AggiungiDati()
__CategoryGetItem()
__Temp_BackUp()
Case $Button4 ;Elimina
$loo = GUICtrlRead($list1)
$item = __GetSelected_ItemNumber()
IniDelete(@TempDir & "\Temp.psm", $loo & "ID", $loo&"ID"&$item)
IniDelete(@TempDir & "\Temp.psm", $loo & "PW", $loo&"PW"&$item)
IniDelete(@TempDir & "\Temp.psm", $loo & "DC", $loo&"DC"&$item)
__CategoryGetItem()
__Temp_BackUp()
Case $Button5 ;Modifica dati
If IniRead($TEMP,"SETTING","Hide.List.Psw",0) = 1 Then
$loo = GUICtrlRead($list1)
$item = __GetSelected_ItemNumber()
$y[1] = IniRead(@TempDir & "\Temp.psm", $loo & "ID", $loo&"ID"&$item,"")
$y[2] = IniRead(@TempDir & "\Temp.psm", $loo & "PW", $loo&"PW"&$item,"")
$y[3] = IniRead(@TempDir & "\Temp.psm", $loo & "DC", $loo&"DC"&$item,"")
__ModificaDati()
Else
$loo = GUICtrlRead($list1)
$item = __GetSelected_ItemNumber()
$read = _GUICtrlListView_GetItemTextString($lest,-1)
Global $y = StringSplit($read,"|")
__ModificaDati()
EndIf
__CategoryGetItem()
__Temp_BackUp()
Case $Button6 ;Leggi la categoria
$loo = GUICtrlRead($list1)
__CategoryGetItem()
Case $Button7 ;Apri le opzioni
$GUI_ON = True
__Option_Create()
MsgBox(0," ~ PSM","Modifiche apportate con successo."&@CRLF&"Il programma verrà riavviato.")
WinActivate(" ~ PSM","")
__SaveGUIPos("psm")
_Temp_Rewrite()
_RebHot()
Case $Button8 ;Mostra l'oggetto selezionato
$loo = GUICtrlRead($list1)
__ShowSelected_Item(__GetSelected_ItemNumber(),$loo)
; -------------------------------------------------------------------->
;MENU
; -------------------------------------------------------------------->
Case $MenuItem2 ;Elimina le categorie
$l = IniReadSection($TEMP, "CATEGORIE")
If @error Then
MsgBox(0," ~ Errore","Error: 0xF"&@error)
Else
For $i = 1 To $l[0][0] Step 1
IniDelete($TEMP,"CATEGORIE",$l[$i][0])
For $i2 = 1 To IniRead($TEMP,$l[$i][0],"Numero","") Step 1
IniDelete($TEMP,$l[$i][0]&"ID",$l[$i][0]&"ID"&$i2)
IniDelete($TEMP,$l[$i][0]&"PW",$l[$i][0]&"PW"&$i2)
IniDelete($TEMP,$l[$i][0]&"DC",$l[$i][0]&"DC"&$i2)
Next
IniDelete($TEMP,$l[$i][0],"Numero")
Next
_String()
__CategoryGetItem()
EndIf
__Temp_BackUp()
Case $MenuItem3 ;Elimina categoria
$NCat = InputBox(" ~ Elimina categoria","Inserisci il nome della categoria da eliminare","","",150,150)
IniDelete($TEMP,"CATEGORIE",$NCat)
For $i = 1 To IniRead($TEMP,$NCat,"Numero","") Step 1
IniDelete($TEMP,$NCat&"ID",$NCat&"ID"&$i)
IniDelete($TEMP,$NCat&"PW",$NCat&"PW"&$i)
IniDelete($TEMP,$NCat&"DC",$NCat&"DC"&$i)
Next
IniDelete($TEMP,$NCat,"Numero")
_String()
__CategoryGetItem()
__Temp_BackUp()
Case $MenuItem4 ;Elimina tutto
If MsgBox(4," ~ Reset","Si è sicuri di voler procedere all'eliminazione totale?") = 6 Then _PsmTotalReset($TEMP)
Case $MenuItem6 ;Finestra OnTop
If BitAND(GUICtrlRead($MenuItem6), $GUI_CHECKED) = $GUI_CHECKED Then
GUICtrlSetState($MenuItem6, $GUI_UNCHECKED)
IniWrite($CONFG,"PSM","Top",0)
WinSetOnTop(" ~ PSM","",0)
Else
GUICtrlSetState($MenuItem6, $GUI_CHECKED)
IniWrite($CONFG,"PSM","Top",1)
WinSetOnTop(" ~ PSM","",1)
EndIf
Case $MenuItem7 ;Opzioni
$GUI_ON = True
__Option_Create()
MsgBox(0," ~ PSM","Modifiche apportate con successo."&@CRLF&"Il programma verrà riavviato.")
__SaveGUIPos("psm")
_Temp_Rewrite()
_RebHot()
Case $MenuItem8 ;Crediti
MsgBox(64," ~ Password Memory"," ~ Created by Aaly©" & @CRLF & " ~ Thanks for use ^^")
Case $MenuItem9 ;Controlla aggiornamenti
;~ _PsmUpdate()
Case $MenuItem10 ;Bug Reporter
__PSM_BugReporter()
Case $MenuItem12 ;Info versione
FileInstall("TEXT\Version\Nfo.ini",$NFO)
__CreateInfoVersionGUI()
Case $MenuItem13 ;Contratto di licenza
FileInstall("TEXT\Contratto di licenza.txt",@ScriptDir & "\Contratto di licenza.txt")
ShellExecute(@ScriptDir & "\Contratto di licenza.txt")
Case $MenuItem15 ;Cambia accaunt
_Temp_Rewrite()
IniDelete($CONFG,"LOGIN","Url")
_RebHot()
Case $MenuItem16 ;Info accaunt
__GetUserInfo()
Case $MenuItem19 ;Interfaccia -> GUI -> Bacground
$color = _ChooseColor(2)
IniWrite($CONFG,"GUI","Background",$color)
GUISetBkColor($color)
__LoadSetGraphycOption()
Case $MenuItem20 ;Interfaccia -> GUI -> FONT(size|weight|attributo|nome|~|~)
$font = _ChooseFont()
IniWrite($CONFG,"GUI","Font",$font[3]&"|"&$font[4]&"|"&$font[1]&"|"&$font[2])
IniWrite($CONFG,"GUI","Font color",$font[7])
GUISetFont($font[3]&"|"&$font[4]&"|"&$font[1]&"|"&$font[2])
__LoadSetGraphycOption()
Case $MenuItem22 ;Interfaccia -> Bottoni -> Bacground
$color = _ChooseColor(2)
IniWrite($CONFG,"GUI","Button background",$color)
__LoadSetGraphycOption()
Case $MenuItem23 ;Interfaccia -> Bottoni -> Font
$font = _ChooseFont()
IniWrite($CONFG,"GUI","Button font",$font[3]&"|"&$font[4]&"|"&$font[1]&"|"&$font[2])
IniWrite($CONFG,"GUI","Button font color",$font[7])
__LoadSetGraphycOption()
Case $MenuItem25 ;Interfaccia -> Input -> Bacground
$color = _ChooseColor(2)
IniWrite($CONFG,"GUI","Input background",$color)
__LoadSetGraphycOption()
Case $MenuItem26 ;Interfaccia -> Input -> Font
$font = _ChooseFont()
IniWrite($CONFG,"GUI","Input font",$font[3]&"|"&$font[4]&"|"&$font[1]&"|"&$font[2])
IniWrite($CONFG,"GUI","Input font color",$font[7])
__LoadSetGraphycOption()
Case $MenuItem28 ;Interfaccia -> list -> Bacground
$color = _ChooseColor(2)
IniWrite($CONFG,"GUI","List background",$color)
__LoadSetGraphycOption()
Case $MenuItem29 ;Interfaccia -> list -> Font
$font = _ChooseFont()
IniWrite($CONFG,"GUI","List font",$font[3]&"|"&$font[4]&"|"&$font[1]&"|"&$font[2])
IniWrite($CONFG,"GUI","List font color",$font[7])
__LoadSetGraphycOption()
Case $MenuItem31 ;Interfaccia -> categorie -> Bacground
$color = _ChooseColor(2)
IniWrite($CONFG,"GUI","Category background",$color)
__LoadSetGraphycOption()
Case $MenuItem32 ;Interfaccia -> categorie -> Font
$font = _ChooseFont()
IniWrite($CONFG,"GUI","Category font",$font[3]&"|"&$font[4]&"|"&$font[1]&"|"&$font[2])
IniWrite($CONFG,"GUI","Category font color",$font[7])
__LoadSetGraphycOption()
Case $MenuItem33 ;Applica
IniWrite($CONFG,"LOGIN","-",1)
IniWrite($CONFG,"LOGIN","--",IniRead($TEMP,"USER","Seriale",""))
WinActivate(" ~ PSM","")
__SaveGUIPos("psm")
_Temp_Rewrite()
_RebHot()
Case $MenuItem34 ;Ripristina default
If MsgBox(48+4," ~ PSM","Si è sicuri di voler tornare alle impostazioni di default?") = 6 Then
__SetDefaultGraphycOption()
MsgBox(0," ~ PSM","Il programma verrà riavviato.")
_RebHot()
Else
EndIf
EndSwitch
WEnd