Red de conocimiento informático - Consumibles informáticos - Código fuente del Bloc de notas de animación hacker

Código fuente del Bloc de notas de animación hacker

Método de programación de VB.net:

'Nuevo archivo

Private Sub mnuNew_Click()

RichTextBox1.Text = "" 'Borrar Cuadro de texto

FileName = "Unnamed"

Me.Caption = FileName

End Sub

'Abrir archivo

Private Sub mnuOpen_Click()

CommonDialog1.Filter="Documento de texto (*.txt) *.txt Documento RTF (*.rtf) *.rtf Todos los archivos (*.*) *.* "

CommonDialog1.ShowOpen

RichTextBox1.Text = "" 'Borrar el cuadro de texto

FileName = CommonDialog1.FileName

RichTextBox1.LoadFile FileName

Me.Caption = "Super Notepad:" amp FileName

End Sub

'Guardar archivo

Private Sub mnuSave_Click ( )

CommonDialog1.Filter="Documento de texto (*.txt) *.txt Documento RTF (*.rtf) *.rtf Todos los archivos (*.*) *.*"

CommonDialog1.ShowSave

FileType = CommonDialog1.FileTitle

FiType = LCase(center(FileType, 3))

FileName = CommonDialog1.FileName

Seleccione Caso FiType

Caso "txt"

RichTextBox1.SaveFile FileName, rtfText

Caso "rtf"

RichTextBox1 . SaveFile FileName, rtfRTF

Caso "*.*"

RichTextBox1.SaveFile FileName

Fin Seleccionar

Me.Caption = " Super Bloc de notas: " amp; FileName

End Sub

'Salir

Private Sub mnuExit_Click()

Fin

End Sub

'Copia

Private Sub mnuCopy_Click()

Clipboard.Clear

Clipboard.SetText RichTextBox1.SelText

End Sub

'Cut

Sub privado mnuCut_Click()

Clipboard.Clear

Clipboard.SetText RichTextBox1.SelText

RichTextBox1.SelText = ""

End Sub

'Seleccionar todo

Sub privado mnuSelectAll_Click()

RichTextBox1.SelStart = 0

RichTextBox1.SelLength = Len(RichTextBox1 .Text)

End Sub

'Pegar

Sub privado mnuPaste_Click()

RichTextBox1.SelText = Portapapeles.GetText

End Sub

'Find

Private Sub mnuFind_Click()

sFind = InputBox("Ingrese la palabra o palabras que desea buscar: ", "Buscar contenido", sFind)

RichTextBox1.Find sFind

End Sub

'Continuar buscando

Sub privado mnuFindOn_Click ()

RichTextBox1.SelStart = RichTextBox1.SelStart RichTextBox1.SelLength 1

RichTextBox1.Find sFind, , Len(RichTextBox1)

End Sub

'Instrucciones de uso

Private Sub mnuReadme_Click()

En caso de error, controlador GoTo

RichTextBox1.LoadFile "Readme.txt", rtfText'Por favor, escriba Readme.txt y guárdelo en la carpeta donde se encuentra el programa

Me.Caption = "Super Notepad:" amp "Instrucciones de uso"

Salir de Sub

handler:

MsgBox "Es posible que se haya eliminado el documento de instrucciones; comuníquese con el autor.", vbOKOnly, "Mensaje de error"

End Sub

Método de programación VC:

Primero use VC para crear un proyecto de documento único MFC AppWizard (exe) llamado Bloc de notas.

Escriba txt en la extensión de archivo (extensión de archivo) en Avanzado para asociar el archivo txt. En la clase Base, seleccione la clase CEditView (lo que significa que la clase que usa se deriva de esta clase)

De hecho. , se genera así. Es solo un bloc de notas, pero aún es diferente del bloc de notas original

Así que tenemos que agregar algunas funciones para que las personas nuevas entiendan VC

1. Primero agreguemos una fuente establecida

Defina la fuente en la clase CNotepadView (es decir, pública) CFont m_Font;

Defina la función de procesamiento de mensajes:

void CNotepadView::OnFormatFont ()

{

// TODO: Agregue el código del controlador de comandos aquí

LOGFONT lf;

CFont *font=this- gt; GetEditCtrl().GetFont();

if(font==NULL)

{

fuente =new CFont;

font-gt; CreatePointFont(120, "Fixedsys");

font-gt; GetLogFont(amp; lf); p>

}

else

{

font-gt;GetLogFont(amp;lf);

}

CFontDialog cf(amp;lf);

if(cf.DoModal()==IDOK)

{

this-gt; m_Font.DeleteObject();

this-gt; m_Font.CreateFontIndirect(amp; lf);

SetFont(amp; this-gt; m_Font); p>

}

}

2. Establezca la fuente

Defina BOOL bChk en la clase CNotepadView

Procesamiento de mensajes; function

void CNotepadView::OnFormatReturn()

{

// TODO: Agregue el código del controlador de comandos aquí

bChk=! bChk;

if(!bChk)

{

ShowScrollBar(SB_HORZ, verdadero

}

else

{

ShowScrollBar(SB_HORZ, false);

}

}

Lo siguiente es el archivo RAR del código fuente

/Notepad.rar

El código fuente de Hacker Animation Notepad no se revelará fácilmente. Ese Bloc de notas no es muy bueno y la interfaz no es buena. De hecho, también es muy fácil de descifrar, pero el significado no es muy grande.