#pragma compile(Out, exe\BlackDate.exe)
#pragma compile(Icon, icons\BlackPhreaker.ico)
; Запуск от имени админ
;#pragma compile(ExecLevel, RequireAdministrator)
#pragma compile(UPX, True)
#pragma compile(AutoItExecuteAllowed, True)
#pragma compile(Stripper, True)
#pragma compile(FileVersion, 1.0.0.0)
#pragma compile(ProductVersion, 1.0.0.0)
#pragma compile(ProductName, BlackDate)
#pragma compile(FileDescription, BlackDate Utility)
#pragma compile(LegalCopyright, Copyright © 2012-2015 BlackPhreaker (BlackPhreaker))
#pragma compile(CompanyName, BlackPhreaker Tech Company Almaty)
#pragma compile(Comments, Program made by BlackPhreaker)
#pragma compile(Sign, BlackPhreaker)
#NoTrayIcon
; Запуск от имени админ
;#RequireAdmin
#cs
#ce
#include <GUIConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
$File = ""
$Form1 = GUICreate("BlackDate", 250, 100)
$Input1 = GUICtrlCreateInput("", 4, 4, 121, 21)
$Input2 = GUICtrlCreateInput("20111111", 4, 30, 121, 21)
$Button1 = GUICtrlCreateButton("...", 128, 4, 21, 21, 0)
$Button3 = GUICtrlCreateButton("Изменить Дату", 4, 55, 145, 21, 0)
$Label1 = GUICtrlCreateLabel("Выберите файлы...", 4, 80, 144, 15, $SS_CENTER)
$Progress1 = GUICtrlCreateProgress(4, 80, 144, 15)
GUICtrlSetState($Progress1, $GUI_HIDE); Progress пока скрываем.
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$File = FileOpenDialog("Выберите файл..", @ScriptDir, "All (*.*)", 1)
; отделяем от пути имя файла
$Name = StringMid($File, StringInStr($File, "\", 0, -1) + 1)
; и заносим его в Input
GUICtrlSetData($Input1, $Name)
Case $Button3
SetDateFiles()
EndSwitch
WEnd
Func SetDateFiles()
If $File = "" Then ; если не выбран файл
GUICtrlSetData($Label1, "Ошибка: Не выбран файл!")
Return
EndIf
If $Input2 = "" Then ; если не выбрана дата
GUICtrlSetData($Label1, "Ошибка: Не выбрана дата")
Return
EndIf
GUICtrlSetState($Label1, $GUI_HIDE)
GUICtrlSetState($Progress1, $GUI_SHOW)
; Test
; FileSetTime(@ScriptDir & "\Test.xyz" , "201111110000")
;FileSetTime($File, GUICtrlRead($Input2), 0, 0)
$Date = GUICtrlRead($Input2)
FileSetTime($File, $Date, 0, 0)
GUICtrlSetState($Progress1, $GUI_HIDE)
GUICtrlSetData($Label1, "Готово!")
GUICtrlSetState($Label1, $GUI_SHOW)
EndFunc