3 petits utilitaires sans prétention qui me facilitent la vie, runnotepad, runnotepad++ et runwordpad
En fond d'écran du Bureau, j'ai rajouté un menu Fichiers
Ce menu me permet de rapidement créer le type de fichier que je souhaite.
Quand je le sélectionne, il me présente plusieurs sous-menus dont:
Fichier pb
Fichier txt
Fichier txt+
Fichier rtf
etc...
Cela me permet de créer un fichier unique d'un simple clic dans pb, notepad, notepad++,wordpad,...
Pour Notepad++, j'utilise une version portable "Notepad++ minimalist package 32-bit x86"
Pour enregistrer notepad++ dans les menus contextuels, voici la méthode que j'utilise
RUNNOTEPAD::-------------------------------------------
:: To register Notepad++ as shell extension
:: As admin cmd goto NPP folder
:: for X86
regsvr32 /i NppShell32.dll
:: for X64
regsvr32 /i NppShell64.dll
::-------------------------------------------
:: To unregister Notepad++ as shell extension
:: As admin cmd goto NPP folder
:: for X86
regsvr32 /u NppShell32.dll
:: for X64
regsvr32 /u NppShell64.dll
::-------------------------------------------
Code : Tout sélectionner
;
;************************************************************************
;Titre : runnotepad.pb
;Auteur : (C) 2019 CAGE
;Date : 2019/03/30
;Version PB : PureBasic 5.70 LTS (Windows - x86)
;Version PB : PureBasic 5.70 LTS (Windows - x64)
;Compiler Options
;Compiler Options : Executable format: Console ou Windows au choix
;Compile/Run : Create temporary executable in the source directory
;
;Libairies: aucunes
;
;************************************************************************
;
EnableExplicit
OnErrorGoto(?ErrorHandler)
Define DESKTOP$ = GetUserDirectory(#PB_Directory_Desktop)
Define ext$ = ".txt"
Define NOTEPAD$ = "notepad.exe"
Define D = Date()
Define YY = Year(D)
Define MM = Month(D)
Define DD = Day(D)
Define HH = Hour(D)
Define II = Minute(D)
Define SS = Second(D)
Define out, FILE$
FILE$ = DESKTOP$
FILE$ + "Fichier_"
FILE$ + RSet(Hex(YY+MM+DD+II+SS),4,"0") + ext$
If FileSize(FILE$) = -1
out = OpenFile(#PB_Any, FILE$, #PB_UTF8)
If out
WriteStringN(out,FormatDate("%yyyy/%mm/%dd %hh:%ii:%ss", D ))
CloseFile(out)
Else
End
EndIf
EndIf
RunProgram(NOTEPAD$, FILE$, DESKTOP$)
ErrorHandler:
End
Code : Tout sélectionner
;
;************************************************************************
;Titre : runnotepad++.pb
;Auteur : (C) 2019 CAGE
;Date : 2019/03/30
;Version PB : PureBasic 5.70 LTS (Windows - x86)
;Version PB : PureBasic 5.70 LTS (Windows - x64)
;Compiler Options
;Compiler Options : Executable format: Windows ou Console au choix
;Compile/Run : Create temporary executable in the source directory
;
;Libairies: aucunes
;
;************************************************************************
;
EnableExplicit
OnErrorGoto(?ErrorHandler)
Define DESKTOP$ = GetUserDirectory(#PB_Directory_Desktop)
Define ext$ = ".txt"
Define NOTEPAD$ = "y:\yh\tools\npp\notepad++.exe"
Define D = Date()
Define YY = Year(D)
Define MM = Month(D)
Define DD = Day(D)
Define HH = Hour(D)
Define II = Minute(D)
Define SS = Second(D)
Define out, FILE$
FILE$ = DESKTOP$
FILE$ + "Fichier_"
FILE$ + RSet(Hex(YY+MM+DD+II+SS),4,"0") + ext$
If FileSize(FILE$) = -1
out = OpenFile(#PB_Any, FILE$, #PB_UTF8)
If out
WriteStringN(out,FormatDate("%yyyy/%mm/%dd %hh:%ii:%ss", D ))
CloseFile(out)
Else
End
EndIf
EndIf
RunProgram(NOTEPAD$, FILE$, DESKTOP$)
ErrorHandler:
End
Code : Tout sélectionner
;
;************************************************************************
;Titre : runnotepad++.pb
;Auteur : (C) 2019 CAGE
;Date : 2019/03/30
;Version PB : PureBasic 5.70 LTS (Windows - x86)
;Version PB : PureBasic 5.70 LTS (Windows - x64)
;Compiler Options
;Compiler Options : Executable format: Windows ou Console au choix
;Compile/Run : Create temporary executable in the source directory
;
;Libairies: aucunes
;
;************************************************************************
;
EnableExplicit
OnErrorGoto(?ErrorHandler)
Define DESKTOP$ = GetUserDirectory(#PB_Directory_Desktop)
Define ext$ = ".txt"
Define NOTEPAD$ = "y:\yh\tools\npp\notepad++.exe"
Define D = Date()
Define YY = Year(D)
Define MM = Month(D)
Define DD = Day(D)
Define HH = Hour(D)
Define II = Minute(D)
Define SS = Second(D)
Define out, FILE$
FILE$ = DESKTOP$
FILE$ + "Fichier_"
FILE$ + RSet(Hex(YY+MM+DD+II+SS),4,"0") + ext$
If FileSize(FILE$) = -1
out = OpenFile(#PB_Any, FILE$, #PB_UTF8)
If out
WriteStringN(out,FormatDate("%yyyy/%mm/%dd %hh:%ii:%ss", D ))
CloseFile(out)
Else
End
EndIf
EndIf
RunProgram(NOTEPAD$, FILE$, DESKTOP$)
ErrorHandler:
End