Public PriponyObrazky As String Public PriponyVidea As String Public PriponyOstatni As String Private Obrazky() As Boolean Private Jaky As Integer Private JakyFrame As Integer Private Sub Command1_Click() LB.Vycisti LB.Nenacitej = True For i = 1 To 100 LB.PridejPolozku "" & i, "", -1 Next LB.Nacitani True LB.ZobrazOd 0 End Sub Private Sub Form_Load() Dim i As Integer: Jaky = 0 ReDim Obrazky(0 To Img.Count - 1) For i = 0 To Img.Count - 1 Obrazky(i) = True Next Img_MouseMove -1, 0, 0, 0, 0 RSZ.Enabled = True While Not LB.JizLoaded: DoEvents: Wend LB.AktualniPolozka = -10 End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Img_MouseMove -1, 0, 0, 0, 0 If Button = 1 Then Menu.OUT.PresunOkno hwnd End Sub Private Sub Form_Resize() Dim W As Single W = Height - OST.Height - SPY * 8 If W < SPX * 100 Then Exit Sub If Width < SPX * 80 Then Width = SPX * 80 Dim i As Integer For i = 0 To Img.Count - 1 If Img(i).Left + Img(i).Width > Width - SPX * 8 Then Img(i).Visible = False Else Img(i).Visible = True Next LB.Height = W LB.Width = Width - SPX * 8 OST.Width = Width - SPX * 8 Mezi.Width = OST.Width RSZ.Enabled = True End Sub Private Sub Frm_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Img_MouseMove -10, 0, 0, 0, 0 End Sub Private Sub Img_Click(Index As Integer) SkryjFrame Select Case Index Case 6: If OST.Tag = "0" Then Otevri 1 Else Otevri 5 Case 7: If OST.Tag = "0" Then Otevri 2 Else Otevri 6 Case 8: If OST.Tag = "0" Then Otevri 3 Else Otevri 7 Case 9: If OST.Tag = "0" Then Otevri 4 Else Otevri 8 End Select End Sub Public Sub Img_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) If Jaky = Index Then Exit Sub Jaky = Index Dim i As Integer For i = 0 To Img.Count - 1 Imag(i).BackColor = Menu.BarvaPozadi Next If Index >= 0 Then Imag(Index).BackColor = Menu.BarvaPopredi If Index = 0 Or Index = 1 Then If Img(3 + Index).Visible = True Then SkryjFrame: OST.Tag = "" & Index JakyFrame = Index Frm(0).Move Img(Index).Left, OST.Top - Frm(0).Height + Img(0).Top Frm(0).Visible = True End If ElseIf Index = 4 Or Index = 5 Then If Img(2 + Index).Visible = True Then SkryjFrame JakyFrame = Index Frm(Index - 3).Move Img(Index).Left + Img(Index).Width - Frm(Index - 3).Width, OST.Top - Frm(Index - 3).Height + Img(0).Top Frm(Index - 3).Visible = True End If Else JakyFrame = -1 If Index <= 5 And Index <> -10 Then SkryjFrame End If End If If Index < 0 Then Menu.ZobrazZpravu -1 Else Menu.ZobrazZpravu Index + 20 End Sub Private Sub SkryjFrame() Frm(0).Visible = False: Frm(1).Visible = False: Frm(2).Visible = False End Sub Private Sub LB_Click(Text As String, Poznamka As String, CisloPolozky As Double, CisloRadky As Double) Menu.NactiSoubor Poznamka, Text End Sub Private Sub LB_MouseMove(Button As Integer, Shift As Integer) SkryjFrame End Sub Private Sub Mezi_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Form_MouseMove Button, Shift, X, OST.Top + Y End Sub Private Sub OST_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Form_MouseMove Button, Shift, OST.Left + X, OST.Top + Y End Sub Private Sub LB_GotFocus() On Error Resume Next FIL.SetFocus End Sub Private Sub LB_MouseDown(Button As Integer, Shift As Integer) Form_MouseMove Button, 0, 0, 0 End Sub Private Sub RSZ_Timer() RSZ.Enabled = False While LB.CelkovaVyska = 0: DoEvents: Wend OST.Top = LB.CelkovaVyska FIL.Top = OST.Top + SPY Height = OST.Top + OST.Height + SPY * 8 End Sub Private Sub FIL_KeyDown(KeyCode As Integer, Shift As Integer) Menu.FIL_KeyDown KeyCode, Shift End Sub Private Sub FIL_KeyUp(KeyCode As Integer, Shift As Integer) Menu.FIL_KeyUp KeyCode, Shift End Sub ' Public Sub Otevri(X As Byte) With CD Dim s As String If X <= 4 Then s = "Otevřít " Else s = "Přidat " If X = 1 Or X = 5 Then s = s & "soubor:" .DialogTitle = s 'otev/při - Složku/ podsložky/ jedno If X <> 1 And X <> 5 Then If X = 4 Or X = 8 Then s1 = Menu.JednotkaCD: Fl.Pattern = "*.*": GoTo Pres Dim ss1 As String VybSlo.Zobraz X ss1 = VybSlo.Cesta If ss1 = "" Then Exit Sub GoTo Pres End If ' .FileName = "" .Flags = cdlOFNFileMustExist .Filter = "Soubory obrázků|" & PriponyObrazky & "|Soubory videí / zvuků|" & PriponyVidea & "|Ostatní soubory|" & PriponyOstatni & "|Předdefinované soubory|" & PriponyObrazky & PriponyOstatni & PriponyVidea & "|Všechny soubory|*.*" .FilterIndex = Menu.Filtr .ShowOpen If .FileName = "" Then Exit Sub Menu.Filtr = .FilterIndex Pres: LB.Nenacitej = True If X <= 4 Then s = "" LB.Vycisti LB.VybranaPolozka = 0 Else If LB.VybranaPolozka > 0 Then s = "Q" Else s = "" End If If X = 1 Or X = 5 Then OtevriSoubor .FileName, .FileTitle Else 'Složky; pod;.. If X <> 4 And X <> 8 Then Dim ss As String Select Case VybSlo.Pripony Case 1: ss = PriponyObrazky Case 2: ss = PriponyVidea Case 3: ss = PriponyOstatni Case 4: ss = PriponyObrazky & PriponyOstatni & PriponyVidea Case 5: Fl.Pattern = "*.*" End Select If VybSlo.Pripony <> 5 Then Fl.Pattern = Left(ss, Len(ss) - 1) Else 'Jednotka CD If JeJednotka = False Then Exit Sub VybSlo.Cesta = Menu.JednotkaCD & ":\" End If ' If X = 2 Or X = 6 Then L2.Clear L2.AddItem VybSlo.Cesta Else NactiPodslozky VybSlo.Cesta End If ' Dim i As Double, o As Single For i = 0 To L2.ListCount - 1 Fl.Path = L2.List(i) For o = 0 To Fl.ListCount - 1 OtevriSoubor Fl.Path & "\" & Fl.List(o), Fl.List(o) Next Next End If i = LB.AktualniPolozka LB.Nacitani True If s = "" Then If LB.PocetPolozek = 0 Then LB.VybranaPolozka = 0: LB.ZobrazOd 0: Exit Sub LB.VybranaPolozka = 1 'Menu.NactiSoubor LB.Text(0), LB.Poznamka(0) End If If LB.PocetPolozek = 0 Then LB.VybranaPolozka = 0 LB.ZobrazOd i End With 'ZmenNahodne End Sub Private Sub NactiPodslozky(X As String) L1.Clear: L1.AddItem X L2.Clear: L2.AddItem X Dim i As Integer Do L1.ListIndex = 0 D.Path = L1.Text For i = 0 To D.ListCount - 1 D.ListIndex = i L2.AddItem D.List(i) L1.AddItem D.List(i) Next L1.RemoveItem 0 Loop Until L1.ListCount = 0 End Sub Public Sub OtevriSoubor(Cesta As String, Nazev As String) Select Case LCase(Right(Nazev, 4)) Case ".pl4": OtevPl4 Cesta: Exit Sub Case ".pl5": OtevPl5 Cesta: Exit Sub End Select LB.PridejPolozku Nazev, Cesta, -1 End Sub Private Function JeJednotka() As Boolean On Error GoTo p Fl.Path = Menu.JednotkaCD & ":\" JeJednotka = True Exit Function p: JeJednotka = False End Function Public Sub UlozitPl() If LB.PocetPolozek = 0 Then Exit Sub With CD .FileName = "" .DialogTitle = "Uloži LBist" .Flags = Empty .Filter = "Soubory LBistu v.5|*.pl5" .ShowOpen If .FileName = "" Then Exit Sub If Trim(Dir(.FileName)) <> "" Then Zpravy.Tag = "Opravdu chcete tento soubor přepsat?" Zpravy.Zobraz 2 If Zpravy.Heslo = "n" Then Exit Sub End If Ulozit .FileName End With End Sub Public Sub Ulozit(X As String) Dim s As String: s = "" Dim s2 As String Dim i As Single, hes As String If Tag = "U" Then Tag = "": hes = "": GoTo Pres Zpravy.Zobraz 0 hes = Zpravy.Heslo Pres: If hes = "" Then hes = "{<|>}" For i = 1 To LB.PocetPolozek s = s & LB.Poznamka(i - 1) & "<¶:P>" Next s2 = ProvedKodovani("__", hes, 1) s2 = "ASCII:" & Hs.AsciiPosun & "_XOR:" & Hs.XorPosun s2 = ProvedKodovani(s2, "securityaccess", 0) s = "" & hes & "" & s RB.Text = ProvedKodovani(s, hes, 1) & s2 RB.SaveFile X, rtfText End Sub Public Sub OtevPl4(X As String) RB.LoadFile X, rtfText Dim Te As String, Tes As String Te = RB.Text 'Zkusit, je-li bez hesla Tes = ProvedKodovani(Left(Te, 19), "{_|_}", 1) If Tes <> "<#pl4#>{_|_}<#pl4#>" Then Zpravy.Zobraz 0 Tes = Zpravy.Heslo Else Tes = "{_|_}" End If RB.Text = ProvedKodovani(Te, Tes, 1) Te = RB.Text 'Kontrola If Left(Te, Len(Tes) + 14) <> "<#pl4#>" & Tes & "<#pl4#>" Then Zpravy.Tag = "! Chybné heslo !" Zpravy.Zobraz 1 Exit Sub End If Te = Right(Te, Len(Te) - 14 - Len(Tes)) RB.Text = "" 'Zobrazení Dim a As String Dim B As String Sta: Dim Od As Double: Od = 1 Dim Delka As Double: Delka = 0 On Error GoTo Chyba For qz = 1 To Len(Te) - 5 a = Mid(Te, qz, 5) If a = "<*/#>" Then B = Mid(Te, Od, qz - 1 - Delka) Delka = Delka + Len(B) + 5 Od = qz + 5: qz = qz + 4 DejDoVypis B End If Next B = Mid(Te, Od, Len(Te) - Delka - 5) Te = "" DejDoVypis B Chyba: End Sub Public Sub OtevPl5(X As String) RB.LoadFile X, rtfText Dim Te As String, Tes As String Te = RB.Text 'Zkusit, je-li bez hesla Tes = ProvedKodovani(Left(Te, 19), "{<|>}", 0) If Tes <> "{<|>}" Then Zpravy.Tag = Right(Te, 20) Zpravy.Zobraz 0 Tes = Zpravy.Heslo Else Tes = "{<|>}" End If If Tes = "" Then Exit Sub RB.Text = ProvedKodovani(Te, Tes, 0) Te = RB.Text 'Kontrola If Left(Te, Len(Tes) + 14) <> "" & Tes & "" Then Zpravy.Tag = "! Chybné heslo !" Zpravy.Zobraz 1 Exit Sub End If Te = Right(Te, Len(Te) - 14 - Len(Tes)) RB.Text = "" 'Zobrazení Dim a As String Dim B As String Sta: Dim Od As Double: Od = 1 Dim Delka As Double: Delka = 0 Dim qz As Single On Error GoTo Chyba For qz = 1 To Len(Te) - 5 a = Mid(Te, qz, 5) If a = "<¶:P>" Then B = Mid(Te, Od, qz - 1 - Delka) Delka = Delka + Len(B) + 5 Od = qz + 5: qz = qz + 4 DejDoVypis B End If Next B = Mid(Te, Od, Len(Te) - Delka - 5) Te = "" DejDoVypis B Chyba: End Sub Public Sub DejDoVypis(X As String) Dim Q As String For ii = Len(X) - 1 To 1 Step -1 If Mid(X, ii, 1) = "\" Then Q = Right(X, Len(X) - ii) LB.PridejPolozku Q, X, -1 Exit Sub End If Next End Sub Public Sub ZmenNahodne() Fl.Tag = "" If LB.PocetPolozek = 0 Then Exit Sub If Menu.NahodnyVyber = False Then Exit Sub Dim Pocet As Double: Pocet = LB.PocetPolozek ReDim Nahodne(1 To Pocet) Dim i As Double For i = 1 To Pocet Nahodne(i) = i Next Dim k As Double, kl As Double, Y As Double Dim k0 As Byte For i = 1 To Pocet k = Rnd * Pocet + 1 k0 = 6: Y = k While Y >= 10 k0 = k0 - 1 Y = Y / 10 Wend Y = 10 ^ k0: k = k * Y \ Y kl = Nahodne(i) Nahodne(i) = Nahodne(k) Nahodne(k) = kl Next If LB.Poznamka(Nahodne(1)) = Menu.Nacteny Then JakaNahodne = 2 Else JakaNahodne = 1 End Sub Private Obrazky() As Boolean Private Jaky As Integer Private Umisteni As Byte Private MinY As Single, MinX As Single Public SkokY As Single Public Sub ZmenitUmisteni(X As Byte) Umisteni = X: Dim V As Boolean Dim Q As Single If X = 0 Then Q = 0: V = True Else Q = Width - Horni.Width: V = False End If BokL.Visible = V: BokP.Visible = Not V Horni.Left = Q Dolni.Left = Q End Sub Public Sub ZmenPozici() If Umisteni = 0 Then Move Menu.Left + Menu.Width - SPX * 4, Menu.Top + SkokY * SPY Else Move Menu.Left - Width + SPX * 4, Menu.Top + SkokY * SPY End If End Sub Private Sub Bok_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Img_MouseMove -1, 0, 0, 0, 0 If Button = 1 Then If MinY = -1 Then MinY = Y: MinX = X: Exit Sub Move Left + X - MinX, Top + Y - MinY If Umisteni = 0 Then Menu.Move Left - Menu.Width + SPX * 4, Top - SkokY * SPY Else Menu.Move Left + Width - SPX * 4, Top - SkokY * SPY End If End If If Button = 2 Then If MinY = -1 Then MinY = Y: MinX = X: Exit Sub Dim Q As Single, q2 As Byte Q = Top - MinY + Y Horni.Visible = False: Dolni.Visible = False If Q - 3 * SPY <= Menu.Top Then Q = Menu.Top: Horni.Visible = True If Q + 3 * SPY >= Menu.Top + Menu.Pozadi.Height - Height Then Q = Menu.Top + Menu.Pozadi.Height - Height: Dolni.Visible = True Top = Q SkokY = (Q - Menu.Top) / SPY q2 = 10 If Left + X < Menu.Left Then q2 = 1 If Left + X > Menu.Left + Menu.Width Then q2 = 0 If q2 <> Umisteni And q2 <> 10 Then ZmenitUmisteni q2: ZmenPozici End If End Sub Private Sub Bok_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) MinY = -1 End Sub Private Sub BokL_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Bok_MouseUp Button, Shift, X, Y End Sub Private Sub BokP_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Bok_MouseMove Button, Shift, BokP.Left + X, BokP.Top + Y End Sub Private Sub Bokl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Bok_MouseMove Button, Shift, BokL.Left + X, BokL.Top + Y End Sub Private Sub BokP_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Bok_MouseUp Button, Shift, X, Y End Sub Private Sub FIL_KeyDown(KeyCode As Integer, Shift As Integer) Menu.FIL_KeyDown KeyCode, Shift End Sub Private Sub FIL_KeyUp(KeyCode As Integer, Shift As Integer) Menu.FIL_KeyUp KeyCode, Shift End Sub Private Sub Form_Load() MinY = -1 Width = Bok.Width: Height = Bok.Height Dim i As Integer: Jaky = 0 ReDim Obrazky(0 To Img.Count - 1) For i = 0 To Img.Count - 1 Obrazky(i) = True Next Img_MouseMove -1, 0, 0, 0, 0 End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Bok_MouseMove Button, Shift, X, Y End Sub Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Bok_MouseMove Button, Shift, X, Y End Sub Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Bok_MouseUp Button, Shift, X, Y End Sub Private Sub Img_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Select Case Index Case 5: Okno.Minimalizovat Case 6: Menu.Ukoncit Case 7: PL.Otevri 1 Case 8: Menu.ZobrazNastaveni End Select End Sub Public Sub Img_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) If Jaky = Index Then Exit Sub Jaky = Index Dim i As Integer For i = 0 To Img.Count - 1 If Obrazky(i) = True Then Imag(i).BackColor = Menu.BarvaPozadi Next If Index >= 0 Then Imag(Index).BackColor = Menu.BarvaPopredi If Index < 0 Then Menu.ZobrazZpravu -1 Else Menu.ZobrazZpravu Index + 11 End Sub Public Cesta As String Public Pripony As Byte Private AktualSlozka As String Private Sub di_Change() Sloz.Vycisti AktualSlozka = di.Path If di.ListCount = 0 Then Sloz_Click "", "", 1, 0: Exit Sub If Len(di.Path) > 3 Then Sloz.PridejPolozku "[...Nahoru...]", "", -1 Dim i As Integer, s As String Dim o As Integer For i = 0 To di.ListCount - 1 s = di.List(i) For o = Len(s) To 1 Step -1 If Mid(s, o, 1) = "\" Then Exit For Next s = Right(s, Len(s) - o) Sloz.PridejPolozku s, "", -1 Next Sloz.ZobrazOd 1 di.Tag = "L" End Sub Private Sub Dr_Change() If Tag = "L" Then di_Change: Tag = "": Exit Sub Tag = "" di.Tag = "" di.Path = Dr.Drive If di.Tag = "" Then di_Change di.Tag = "" End Sub Private Sub Form_Load() Show Hide Timer1.Enabled = True End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button <> 1 Then Exit Sub Menu.OUT.PresunOkno hwnd End Sub Private Sub Image7_Click() End Sub Private Sub ii_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Form_MouseMove Button, Shift, 0, 0 End Sub Private Sub Jed_Click(Text As String, Poznamka As String, CisloPolozky As Double, CisloRadky As Double) Jed.ZobrazOd 1 Dim s As String s = Dr.Drive Tag = "" Sloz.Vycisti On Error GoTo p Dr.Drive = Text If s = Dr.Drive Then Dr_Change Exit Sub p: Tag = "L" End Sub Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Form_MouseMove Button, Shift, 0, 0 End Sub Private Sub Sloz_Click(Text As String, Poznamka As String, CisloPolozky As Double, CisloRadky As Double) If (CisloPolozky > 1) Or (CisloPolozky = 1 And Len(di.Path) = 3) Then Sloz.Vycisti If Len(di.Path) > 3 Then di.Path = di.Path & "\" & Text Else di.Path = di.Path & Text Else For o = Len(AktualSlozka) To 1 Step -1 If Mid(AktualSlozka, o, 1) = "\" Then Exit For Next Sloz.Vycisti di.Path = Left(AktualSlozka, o) End If End Sub Private Sub Timer1_Timer() While Not Typy.JizLoaded: DoEvents: Wend While Not Sloz.JizLoaded: DoEvents: Wend While Not Jed.JizLoaded: DoEvents: Wend Timer1.Enabled = False Dim i As Integer, o As Integer: o = Dr.ListIndex For i = 0 To Dr.ListCount - 1 Jed.PridejPolozku UCase(Left(Dr.List(i), 1)) & ":\", "", -1 Next Typy.PridejPolozku "Soubory obrázků", "", -1 Typy.PridejPolozku "Sobory videí / zvuků", "", -1 Typy.PridejPolozku "Ostatní soubory", "", -1 Typy.PridejPolozku "Předdefinované soubory", "", -1 Typy.PridejPolozku "Všechny soubory", "", -1 Typy.ZobrazOd 1 End Sub Public Sub Zobraz(Typ As Byte) Clona.Visible = False If Typ = 2 Or Typ = 3 Then Inf.Caption = "Vyberte složku: (Otevřít " Else _ Inf.Caption = "Vyberte složku: (Přidat " If Typ = 2 Or Typ = 6 Then Inf.Caption = Inf.Caption & "složku)" Else _ Inf.Caption = Inf.Caption & "podsložky)" If Typ = 8 Then Clona.Visible = True: Inf.Caption = "Vyberte složku, kam chcete soubory překopírovat:" Cesta = "" Typy.VybranaPolozka = Menu.Filtr: Typy.ZobrazOd 1 Show 1 End Sub Private Sub Z_Button1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Cesta = "" Hide End Sub Private Sub Z_Button2_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Z_Button2_MouseDown 1, 0, 0, 0 If KeyCode = 27 Then Z_Button1_MouseDown 1, 0, 0, 0 End Sub Private Sub Z_Button1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then Z_Button2_MouseDown 1, 0, 0, 0 If KeyCode = 27 Then Z_Button1_MouseDown 1, 0, 0, 0 End Sub Private Sub Z_Button2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Len(di.Path) = 3 Then k = "" Else k = "\" If Sloz.VybranaPolozka < 2 Then Exit Sub End If Dim s As String Cesta = di.Path & k & Sloz.Text(Sloz.VybranaPolozka - 1) Pripony = Typy.VybranaPolozka Menu.Filtr = Typy.VybranaPolozka Hide End Sub Public Sub BarvaPozadi(X As OLE_COLOR) BackColor = X Clona.BackColor = X Jed.NastavBarvuPozadi X Sloz.NastavBarvuPozadi X Typy.NastavBarvuPozadi X End Sub Public Heslo As String Private Typ As Byte Private Sub b2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Hide End Sub Private Sub Form_Load() Show Hide End Sub Private Sub GHes_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 27 Then GHes.Text = "": Zavri If KeyCode = 13 Then Zavri If KeyCode = 123 Then If GHes.Text = "cout< Val(Tag) Then Exit Sub Heslo = i Hide End Sub Public Sub BarvaPozadi(X As OLE_COLOR) Dim i As Byte For i = 0 To 4 Frm(i).BackColor = X Next BackColor = X GHes.BackColor = X Hod.BackColor = X Min.BackColor = X Sek.BackColor = X End Sub Public SPX As Integer, SPY As Integer Public Type Hesl AsciiPosun As Integer XorPosun As Integer End Type Public Hs As Hesl Public Function Kodovani(Text As String, Xor_ As Integer, ASC_ As Integer, Mode As Byte) As String Dim i As Double, z As String * 1, TXT As String Dim O As Integer TXT = "" For i = 1 To Len(Text) z = Mid(Text, i, 1) If Mode = 0 Then O = (Asc(z) Xor Xor_) + ASC_ If Mode = 1 Then O = (Asc(z) - ASC_) Xor Xor_ ASC_ = -ASC_ While O >= 256: O = O - 256: Wend While O < 0: O = O + 256: Wend TXT = TXT & Chr(O) Next Kodovani = TXT End Function Public Function ProvedKodovani(Text As String, Heslo As String, Mode As Byte) As String Hs = VytvorHeslo(Heslo) ProvedKodovani = Kodovani(Text, Hs.XorPosun, Hs.AsciiPosun, Mode) End Function Private Function VytvorHeslo(Heslo As String) As Hesl If Heslo = "" Then Exit Function Dim i0 As Integer, a1 As Double, a2 As Double, k As Integer k = Len(Heslo) * Sqr(Asc(Mid(Heslo, 1, 1))) a1 = 1: a2 = 1 For i0 = 1 To Len(Heslo) If i0 Mod 2 = 0 Then a1 = a1 + Asc(Mid(Heslo, i0, 1)) + Sqr(a2 * k) Else a2 = a2 + Asc(Mid(Heslo, i0, 1)) + Sqr(a1 * k) End If Next While a1 >= 256: a1 = a1 - 256: Wend While a2 >= 256: a2 = a2 - 256: Wend VytvorHeslo.AsciiPosun = a1 VytvorHeslo.XorPosun = a2 End Function