WinDOS Shell 0.1A
Submitted By:
Shehbaz
Rating:





(
Rate It)
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmTextEditor
BackColor = &H00000000&
BorderStyle = 0 'None
ClientHeight = 9000
ClientLeft = 0
ClientTop = 0
ClientWidth = 12000
LinkTopic = "Form1"
Picture = "frmTextEditor.frx":0000
ScaleHeight = 9000
ScaleWidth = 12000
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
WindowState = 2 'Maximized
Begin MSComDlg.CommonDialog DlgOpen
Left = 5700
Top = 4050
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.TextBox txtContents
BackColor = &H00000000&
BorderStyle = 0 'None
BeginProperty Font
Name = "OCR A Extended"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFF80&
Height = 7215
Left = 150
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 1620
Width = 11670
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 420
Left = 0
TabIndex = 0
Top = 0
Width = 12000
_ExtentX = 21167
_ExtentY = 741
ButtonWidth = 609
ButtonHeight = 582
Appearance = 1
ImageList = "imlToolbarIcons"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 20
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "New"
Object.ToolTipText = "New"
ImageKey = "New"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Open"
Object.ToolTipText = "Open"
ImageKey = "Open"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Save"
Object.ToolTipText = "Save"
ImageKey = "Save"
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Print"
Object.ToolTipText = "Print"
ImageKey = "Print"
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Cut"
Object.ToolTipText = "Cut"
ImageKey = "Cut"
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Copy"
Object.ToolTipText = "Copy"
ImageKey = "Copy"
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Paste"
Object.ToolTipText = "Paste"
ImageKey = "Paste"
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Bold"
Object.ToolTipText = "Bold"
ImageKey = "Bold"
EndProperty
BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Underline"
Object.ToolTipText = "Underline"
ImageKey = "Underline"
EndProperty
BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Italic"
Object.ToolTipText = "Italic"
ImageKey = "Italic"
EndProperty
BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Delete"
Object.ToolTipText = "Exit"
ImageKey = "Delete"
EndProperty
BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button19 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button20 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "Encrypt"
Object.ToolTipText = "Encrypt text"
ImageKey = "Encrypt"
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList imlToolbarIcons
Left = 4935
Top = 30
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 13
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":4107
Key = "New"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":4219
Key = "Open"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":432B
Key = "Save"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":443D
Key = "Print"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":454F
Key = "Cut"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":4661
Key = "Copy"
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":4773
Key = "Paste"
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":4885
Key = "Bold"
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":4997
Key = "Underline"
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":4AA9
Key = "Italic"
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":4BBB
Key = "Delete"
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":4CCD
Key = "Encrypt"
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmTextEditor.frx":5121
Key = "Decrypt"
EndProperty
EndProperty
End
Begin VB.Label lblExit
BackStyle = 0 'Transparent
Height = 585
Left = 10230
TabIndex = 2
Top = 675
Width = 1575
End
End
Attribute VB_Name = "frmTextEditor"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim filepath1 As String
Dim f As String
Dim CodedText As String
Dim filepath As String
Dim ans1 As String
Private Function getfile() As String
DlgOpen.CancelError = True
On Error GoTo fileerr
DlgOpen.DialogTitle = "Select a file..."
DlgOpen.DefaultExt = "*.txt"
DlgOpen.Filter = "Text File(*.txt)|*.txt|" & "All Files(*.*)|*.*"
DlgOpen.FilterIndex = 1
DlgOpen.ShowOpen
getfile = DlgOpen.filename
Exit Function
fileerr:
getfile = ""
End Function
Private Sub lblExit_Click()
Unload Me
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button)
On Error Resume Next
Select Case Button.Key
Case "New"
If txtContents.Text <> "" Then
ans1 = MsgBox("Are you sure ?", vbExclamation + vbYesNo, "Confirmation")
If ans1 = vbYes Then
txtContents.Text = ""
End If
End If
Case "Open"
On Error GoTo err1
DlgOpen.CancelError = True
DlgOpen.DialogTitle = "Select a File...."
DlgOpen.DefaultExt = "*.txt"
DlgOpen.Filter = "Text Files (*.txt)|*.txt|" & "All Files (*.*)|*.*"
DlgOpen.FilterIndex = 1
DlgOpen.ShowOpen
filepath1 = DlgOpen.filename
txtContents.Text = ""
Open filepath1 For Input As #2
Do Until EOF(2)
Line Input #2, f
txtContents.Text = txtContents.Text & f & vbCrLf
Loop
Close #2
txtContents.SetFocus
GoTo okay1
err1:
MsgBox "Error! number:" & err.Number & " possibly " & err.Description
okay1:
Case "Save"
On Error GoTo err
DlgOpen.CancelError = True
DlgOpen.DialogTitle = "Select a File...."
DlgOpen.DefaultExt = "*.txt"
DlgOpen.Filter = "Text Files (*.txt)|*.txt|" & "All Files (*.*)|*.*"
DlgOpen.FilterIndex = 1
DlgOpen.ShowSave
filepath = DlgOpen.filename
Open filepath For Output As #1
Print #1, txtContents.Text
Close #1
GoTo okay
err:
MsgBox "Error! number:" & err.Number & " possibly " & err.Description
okay:
Case "Print"
If txtContents.Text <> "" Then
Printer.Print txtContents.Text
Else
MsgBox "No text to print!"
End If
Case "Cut"
Clipboard.clear
Clipboard.SetText (txtContents.SelText)
txtContents.SelStart = txtContents.SelText
Case "Copy"
Clipboard.clear
Clipboard.SetText (txtContents.SelText)
Case "Paste"
txtContents.SelStart = Clipboard.GetText
Case "Bold"
'ToDo: Add 'Bold' button code.
Case "Underline"
'ToDo: Add 'Underline' button code.
Case "Italic"
'ToDo: Add 'Italic' button code.
Case "Delete"
Unload Me
Case "Encrypt"
CodedText = ""
For n = 1 To Len(txtContents)
CodedText = CodedText & Chr$(255 - Asc(Mid$(txtContents, n, 1)))
Next
txtContents = CodedText
End Select
End Sub