Bloc-notes
Résolu
fafabien
-
Tuty -
Tuty -
Bonjour,
Ce n'est pas une question, mais c'est pour faire part de ma création.
J'ai créé un gadget bloc-notes/post-it.
Il est compatible avec toutes les versions de windows.(normalement...)
1- Créer Bloc.hta (peut être renommé) :
<html>
<HEAD>
<STYLE TYPE="text/css">
body{margin:0}
textarea{border:0;overflow:auto;}
input{font-size:0.7em}
</STYLE>
<TITLE>Bloc-notes</TITLE>
<HTA:APPLICATION ID = 'AppScripting' innerborder="no" APPLICATIONNAME="hta-post-it" SINGLEINSTANCE="Yes" VERSION="2.3" ICON="notepad.exe" MINIMIZEBUTTON="No" MAXIMIZEBUTTON="No" SHOWINTASKBAR="yes" SCROLL="No">
<SCRIPT TYPE="text/Vbscript">
Sub bouton_apropos_onclick()
Msgbox "Auteur de l'application : Fabien" & vbcrlf & "Version de l'application : 2.3" , vbInformation, "À propos"
End Sub
</SCRIPT>
<script language="VBScript">
Sub ChoixFichier
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Dim stFichier
stfichier = "Note.txt"
Set oFso = CreateObject("Scripting.FileSystemObject")
if oFSO.FileExists(stfichier) then
Set f = oFso.OpenTextFile(stFichier, ForReading)
txtFichier.value = f.ReadALL
f.Close
else
msgbox "Fichier " & vbCrlf & stFichier & vbCrlf & "Inaccessible !",vbCritical,"interface-hta"
end if
set f = Nothing
set oFso = Nothing
end sub
'
' Sauvegarde du fichier texte
'
Sub btSauver_OnClick
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Dim stFichier
stfichier = "Note.txt"
Set oFso = CreateObject("Scripting.FileSystemObject")
Set f = oFso.OpenTextFile(stFichier, ForWriting)
f.write txtFichier.value
f.close
set f = Nothing
set oFso = Nothing
end sub
</script>
</HEAD>
<BODY onload="ChoixFichier">
<SCRIPT TYPE="text/javascript">
window.resizeTo(221,253);
</script>
<INPUT TYPE="button" NAME="bouton_apropos" VALUE="À propos">
<input type="button" value="Sauver" name="Sauver" onclick="btSauver_OnClick">
<input type="button" value="Quiter" name="btSauver" onclick="window.close()">
<BR>
<TEXTAREA NAME="txtFichier" ROWS="40" COLS="100">
</TEXTAREA>
</BODY>
</html>
2- Créer Note.txt , le mettre dans le même répertoire que bloc.hta, ne pas le renommer, ou modifier le script de bloc.hta.
Il contiendra vos notes.
Je met ceci ici car j'ai eu un mal fou pour le faire fonctionner sans bugs.
Remarque:
Je me suis grandement inspiré du site du Zéro, qui proposait un exemple qui, chez moi ne fonctionnait pas.
Et surtout, n'hésitez pas à faire part de remarques, bugs, ou améliorations.
Ce n'est pas une question, mais c'est pour faire part de ma création.
J'ai créé un gadget bloc-notes/post-it.
Il est compatible avec toutes les versions de windows.(normalement...)
1- Créer Bloc.hta (peut être renommé) :
<html>
<HEAD>
<STYLE TYPE="text/css">
body{margin:0}
textarea{border:0;overflow:auto;}
input{font-size:0.7em}
</STYLE>
<TITLE>Bloc-notes</TITLE>
<HTA:APPLICATION ID = 'AppScripting' innerborder="no" APPLICATIONNAME="hta-post-it" SINGLEINSTANCE="Yes" VERSION="2.3" ICON="notepad.exe" MINIMIZEBUTTON="No" MAXIMIZEBUTTON="No" SHOWINTASKBAR="yes" SCROLL="No">
<SCRIPT TYPE="text/Vbscript">
Sub bouton_apropos_onclick()
Msgbox "Auteur de l'application : Fabien" & vbcrlf & "Version de l'application : 2.3" , vbInformation, "À propos"
End Sub
</SCRIPT>
<script language="VBScript">
Sub ChoixFichier
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Dim stFichier
stfichier = "Note.txt"
Set oFso = CreateObject("Scripting.FileSystemObject")
if oFSO.FileExists(stfichier) then
Set f = oFso.OpenTextFile(stFichier, ForReading)
txtFichier.value = f.ReadALL
f.Close
else
msgbox "Fichier " & vbCrlf & stFichier & vbCrlf & "Inaccessible !",vbCritical,"interface-hta"
end if
set f = Nothing
set oFso = Nothing
end sub
'
' Sauvegarde du fichier texte
'
Sub btSauver_OnClick
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Dim stFichier
stfichier = "Note.txt"
Set oFso = CreateObject("Scripting.FileSystemObject")
Set f = oFso.OpenTextFile(stFichier, ForWriting)
f.write txtFichier.value
f.close
set f = Nothing
set oFso = Nothing
end sub
</script>
</HEAD>
<BODY onload="ChoixFichier">
<SCRIPT TYPE="text/javascript">
window.resizeTo(221,253);
</script>
<INPUT TYPE="button" NAME="bouton_apropos" VALUE="À propos">
<input type="button" value="Sauver" name="Sauver" onclick="btSauver_OnClick">
<input type="button" value="Quiter" name="btSauver" onclick="window.close()">
<BR>
<TEXTAREA NAME="txtFichier" ROWS="40" COLS="100">
</TEXTAREA>
</BODY>
</html>
2- Créer Note.txt , le mettre dans le même répertoire que bloc.hta, ne pas le renommer, ou modifier le script de bloc.hta.
Il contiendra vos notes.
Je met ceci ici car j'ai eu un mal fou pour le faire fonctionner sans bugs.
Remarque:
Je me suis grandement inspiré du site du Zéro, qui proposait un exemple qui, chez moi ne fonctionnait pas.
Et surtout, n'hésitez pas à faire part de remarques, bugs, ou améliorations.
A voir également:
- Bloc-notes
- Bloc-notes (windows) - Télécharger - Traitement de texte
- Retrouver une musique avec les notes - Guide
- Bloc note gratuit - Télécharger - Agendas & Calendriers
- Code bloc - Télécharger - Langages
- Ouvrez ce fichier avec un éditeur de texte simple (bloc-notes, textedit, gedit, etc.) pour y découvrir le nom d’un objet. - Forum C#
3 réponses
C'tite amélioration :
bloc.hta:
<html>
<HEAD>
<STYLE TYPE="text/css">
body{margin:0}
textarea{border:0;overflow:auto;}
input{font-size:0.7em}
</STYLE>
<TITLE>Bloc-notes</TITLE>
<HTA:APPLICATION ID = 'AppScripting' innerborder="no" APPLICATIONNAME="hta-post-it" SINGLEINSTANCE="Yes" VERSION="2.3" ICON="notepad.exe" MINIMIZEBUTTON="No" MAXIMIZEBUTTON="No" SHOWINTASKBAR="yes" SCROLL="No">
<SCRIPT TYPE="text/Vbscript">
Sub bouton_apropos_onclick()
Msgbox "Auteur de l'application : Fabien" & vbcrlf & "Version de l'application : 2.3" , vbInformation, "À propos"
End Sub
</SCRIPT>
<script language="VBScript">
Sub ChoixFichier
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Dim stFichier
stfichier = "Note.txt"
Set oFso = CreateObject("Scripting.FileSystemObject")
if oFSO.FileExists(stfichier) then
Set f = oFso.OpenTextFile(stFichier, ForReading)
txtFichier.value = f.ReadALL
f.Close
else
msgbox "Fichier " & vbCrlf & stFichier & vbCrlf & "Inaccessible !",vbCritical,"interface-hta"
end if
set f = Nothing
set oFso = Nothing
end sub
'
' Sauvegarde du fichier texte
'
Sub btSauver_OnClick
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Dim stFichier
stfichier = "Note.txt"
Set oFso = CreateObject("Scripting.FileSystemObject")
Set f = oFso.OpenTextFile(stFichier, ForWriting)
f.write txtFichier.value
f.close
set f = Nothing
set oFso = Nothing
end sub
</script>
</HEAD>
<BODY onload="ChoixFichier">
<SCRIPT TYPE="text/javascript">
window.resizeTo(221,253);
</script>
<INPUT TYPE="button" NAME="bouton_apropos" VALUE="À propos"><input type="button" value="Sauver" name="Sauver" onclick="btSauver_OnClick"><input type="button" value="Quiter" name="btSauver" onclick="window.close()">
<BR>
<TEXTAREA NAME="txtFichier" ROWS="40" COLS="100">
</TEXTAREA>
</BODY>
</html>
bloc.hta:
<html>
<HEAD>
<STYLE TYPE="text/css">
body{margin:0}
textarea{border:0;overflow:auto;}
input{font-size:0.7em}
</STYLE>
<TITLE>Bloc-notes</TITLE>
<HTA:APPLICATION ID = 'AppScripting' innerborder="no" APPLICATIONNAME="hta-post-it" SINGLEINSTANCE="Yes" VERSION="2.3" ICON="notepad.exe" MINIMIZEBUTTON="No" MAXIMIZEBUTTON="No" SHOWINTASKBAR="yes" SCROLL="No">
<SCRIPT TYPE="text/Vbscript">
Sub bouton_apropos_onclick()
Msgbox "Auteur de l'application : Fabien" & vbcrlf & "Version de l'application : 2.3" , vbInformation, "À propos"
End Sub
</SCRIPT>
<script language="VBScript">
Sub ChoixFichier
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Dim stFichier
stfichier = "Note.txt"
Set oFso = CreateObject("Scripting.FileSystemObject")
if oFSO.FileExists(stfichier) then
Set f = oFso.OpenTextFile(stFichier, ForReading)
txtFichier.value = f.ReadALL
f.Close
else
msgbox "Fichier " & vbCrlf & stFichier & vbCrlf & "Inaccessible !",vbCritical,"interface-hta"
end if
set f = Nothing
set oFso = Nothing
end sub
'
' Sauvegarde du fichier texte
'
Sub btSauver_OnClick
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Dim stFichier
stfichier = "Note.txt"
Set oFso = CreateObject("Scripting.FileSystemObject")
Set f = oFso.OpenTextFile(stFichier, ForWriting)
f.write txtFichier.value
f.close
set f = Nothing
set oFso = Nothing
end sub
</script>
</HEAD>
<BODY onload="ChoixFichier">
<SCRIPT TYPE="text/javascript">
window.resizeTo(221,253);
</script>
<INPUT TYPE="button" NAME="bouton_apropos" VALUE="À propos"><input type="button" value="Sauver" name="Sauver" onclick="btSauver_OnClick"><input type="button" value="Quiter" name="btSauver" onclick="window.close()">
<BR>
<TEXTAREA NAME="txtFichier" ROWS="40" COLS="100">
</TEXTAREA>
</BODY>
</html>
bonjour je n'ai pa compri comment on avai un bloc note pouver vs m'éclairer sur les bloc note svp je ss entrin d'apprendre les html là , mai cela ne me sére a rien si je peu pa les mètre sur un bloc note dc vla si vs pouvez me dir comment avoir 1 bloc note é 2- 3 astuce + prinsipal a savoir koi sa seré sympa mici :)