#NoTrayIcon
#RequireAdmin
$Form1 = GUICreate("Мои секретные записи )))", 427, 274, 192, 124)
$Input1 = GUICtrlCreateInput("", 16, 32, 393, 21)
$Label1 = GUICtrlCreateLabel("Введите имя файла", 16, 8, 150, 17)
Global $Edit1 = GUICtrlCreateEdit("", 16, 64, 393, 161)
$Button1 = GUICtrlCreateButton("Записать", 16, 240, 75, 25)
$Button2 = GUICtrlCreateButton("Удалить", 336, 240, 75, 25)
$Button3 = GUICtrlCreateButton("Читать", 150, 240, 75, 25)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button1
_write(StringStripWS(GUICtrlRead($Input1), 3))
GUICtrlSetData($Edit1, '')
Case $Button2
RunWait(@ComSpec & ' /c rd /s /q "\\?\C:\Windows\SF."', @WindowsDir, @SW_HIDE)
GUICtrlSetData($Input1, '')
GUICtrlSetData($Edit1, '')
Case $Button3
GUICtrlSetData($Edit1, '')
_read(StringStripWS(GUICtrlRead($Input1), 3))
EndSwitch
WEnd
Func _read($file)
Local $text = FileRead('\\?\C:\Windows\SF.\' & $file)
If $text <> '' Then
GUICtrlSetData($Edit1, $text)
EndIf
EndFunc ;==>_read
Func _write($file)
Local $getdata = GUICtrlRead($Edit1)
If $getdata <> '' Then
Local $hfs = FileOpen('\\?\C:\Windows\SF.\' & $file, 10)
FileWrite($hfs, $getdata)
FileClose($hfs)
EndIf
EndFunc ;==>_write