Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long
Const EM_UNDO = &HC7
Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
Private Sub BrowserTo(frm As Form, URL As String)
Call ShellExecute(frm.hwnd, vbNullString, URL, vbNullString, vbNullString, 1)
End Sub
Private Sub about_SClick()
MsgBox "Morse © by netarrow 2003", , "About"
End Sub
Private Sub about_Click()
MsgBox "Morse © by netarrow 2003", vbInformation, "About"
End Sub
Private Sub Command1_Click()
On Error GoTo error
Command1.Enabled = False
Dim per As Integer
Dim a As Long
For a = 1 To Len(Text2.Text)
per = 100 * a / Len(Text2.Text)
If Mid(Text2.Text, a, 1) = "." Then
Label3.Caption = per & "%"
Sleep 500
Label3.Caption = per & "%"
p.Picture = LoadPicture("punto.jpg")
Label3.Caption = per & "%"
Sleep 500
Label3.Caption = per & "%"
p.Picture = LoadPicture("1.jpg")
Label3.Caption = per & "%"
ElseIf Mid(Text2.Text, a, 1) = "-" Then
Label3.Caption = per & "%"
Sleep 500
Label3.Caption = per & "%"
p.Picture = LoadPicture("linea.jpg")
Label3.Caption = per & "%"
Sleep 500
Label3.Caption = per & "%"
p.Picture = LoadPicture("1.jpg")
Label3.Caption = per & "%"
Else
Label3.Caption = per & "%"
Sleep 500
Label3.Caption = per & "%"
p.Picture = LoadPicture("1.jpg")
Label3.Caption = per & "%"
End If
Next a
Command1.Enabled = True
Exit Sub
error:
If Err.Number = 53 Then
MsgBox "Non trovo le immagini, mettere 1.jpg, linea.jpg e punto.jpg vicono all'exe", vbCritical, "Errore"
End If
End Sub
Private Sub Command2_Click()
Command1.Enabled = False
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub copi_Click()
On Error GoTo error
Clipboard.SetText Text2.Text
Exit Sub
error:
MsgBox "E' avvenuto un errore", vbCritical, "Errore"
End Sub
Private Sub Exit_Click()
Unload Me
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("Sei sicuro di voler uscire?", vbYesNo, "Morse") = vbNo Then
Cancel = True
Else
End
End If
End Sub
Private Sub morse_Click()
On Error GoTo er
BrowserTo Me, "morse.htm"
Exit Sub
er:
MsgBox "Tenere morse.html e l'activeX vinici all'exe", vbCritical, "Errore"
End Sub
Private Sub nbmf_Click()
On Error GoTo error
Text1.Text = Clipboard.GetText
Exit Sub
error:
MsgBox "E' avvenuto un errore", vbCritical, "Errore"
End Sub
Private Sub qew_Click()
Text1.Text = LCase(Text1.Text)
For i = 1 To Len(Text1.Text)
Select Case Mid(Text1.Text, i, 1)
Case "a"
Text2.Text = Text2.Text & ".-/"
Case "à"
Text2.Text = Text2.Text & ".-/"
Case "b"
Text2.Text = Text2.Text & "-.../"
Case "c"
Text2.Text = Text2.Text & "-.-./"
Case "d"
Text2.Text = Text2.Text & "-../"
Case "e"
Text2.Text = Text2.Text & "./"
Case "è"
Text2.Text = Text2.Text & "./"
Case "f"
Text2.Text = Text2.Text & "..-./"
Case "g"
Text2.Text = Text2.Text & "--./"
Case "h"
Text2.Text = Text2.Text & "..../"
Case "i"
Text2.Text = Text2.Text & "../"
Case "ì"
Text2.Text = Text2.Text & "../"
Case "j"
Text2.Text = Text2.Text & ".--/"
Case "k"
Text2.Text = Text2.Text & "-.-/"
Case "l"
Text2.Text = Text2.Text & ".-../"
Case "m"
Text2.Text = Text2.Text & "--/"
Case "n"
Text2.Text = Text2.Text & "-./"
Case "o"
Text2.Text = Text2.Text & "---/"
Case "ò"
Text2.Text = Text2.Text & "---/"
Case "p"
Text2.Text = Text2.Text & ".--./"
Case "q"
Text2.Text = Text2.Text & "--.-/"
Case "r"
Text2.Text = Text2.Text & ".-./"
Case "s"
Text2.Text = Text2.Text & ".../"
Case "t"
Text2.Text = Text2.Text & "-/"
Case "u"
Text2.Text = Text2.Text & "..-/"
Case "ù"
Text2.Text = Text2.Text & "..-/"
Case "v"
Text2.Text = Text2.Text & "...-/"
Case "w"
Text2.Text = Text2.Text & ".--/"
Case "x"
Text2.Text = Text2.Text & "-..-/"
Case "y"
Text2.Text = Text2.Text & "-.--/"
Case "z"
Text2.Text = Text2.Text & "--../"
Case "1"
Text2.Text = Text2.Text & ".----/"
Case "2"
Text2.Text = Text2.Text & "..--/"
Case "3"
Text2.Text = Text2.Text & "...--/"
Case "4"
Text2.Text = Text2.Text & "....-/"
Case "5"
Text2.Text = Text2.Text & "...../"
Case "6"
Text2.Text = Text2.Text & "-..../"
Case "7"
Text2.Text = Text2.Text & "--.../"
Case "8"
Text2.Text = Text2.Text & "-../"
Case "9"
Text2.Text = Text2.Text & "----./"
Case "0"
Text2.Text = Text2.Text & "----/"
Case " "
Text2.Text = Text2.Text & " "
End Select
Next i
End Sub
Private Sub reset_Click()
a.Enabled = True
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub save_Click()
Form3.Show
End Sub
Private Sub vhjn_Click()
Form2.Show
End Sub