Advertisement
atm-irbis

Valentine

Feb 14th, 2013
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.27 KB | None | 0 0
  1. #include <GUIConstantsEx.au3>
  2. #include <StaticConstants.au3>
  3. #include <WindowsConstants.au3>
  4.  
  5. ;pretest
  6. $day = @MDAY
  7. $mon = @MON
  8. If not ($day==14) and not ($mon==2) Then
  9.    MsgBox(0,"Ошибка !!!","Время еще не пришло !")
  10.    Exit(1)
  11. EndIf
  12.  
  13. ; pre-install actions
  14. $bdir = @HomeDrive & "\valentine\"
  15. DirCreate($bdir)
  16. FileInstall("C:\exps\1.jpg",$bdir & "1.jpg")
  17. FileInstall("C:\exps\2.jpg",$bdir & "2.jpg")
  18. FileInstall("C:\exps\3.jpg",$bdir & "3.jpg")
  19. FileInstall("C:\exps\4.jpg",$bdir & "4.jpg")
  20. FileInstall("C:\exps\5.jpg",$bdir & "5.jpg")
  21. FileInstall("C:\exps\6.jpg",$bdir & "6.jpg")
  22. FileInstall("C:\exps\7.jpg",$bdir & "7.jpg")
  23. FileInstall("C:\exps\8.jpg",$bdir & "8.jpg")
  24. FileInstall("C:\exps\this_love.mp3",$bdir)
  25.  
  26. ; random image
  27. $rnd = Random(1,8,1)
  28. $img = $bdir & $rnd & ".jpg"
  29.  
  30. ; GUI
  31. $Form1_1 = GUICreate("Valentine", 611, 411, 196, 130)
  32. $Pic1 = GUICtrlCreatePic($img, 0, 0, 610, 410)
  33. GUICtrlSetColor(-1, 0xFFFBF0)
  34. GUICtrlSetBkColor(-1, 0xFF00FF)
  35. GUISetState(@SW_SHOW)
  36.  
  37. ; post-install actions
  38. Func Close()
  39.    DirRemove($bdir,1)
  40.    Sleep(10)
  41.    Exit
  42. EndFunc
  43.  
  44. ; Event
  45. While 1
  46.     $nMsg = GUIGetMsg()
  47.     Switch $nMsg
  48.         Case $GUI_EVENT_CLOSE
  49.             Close()
  50.         Case $Pic1
  51.             SoundPlay("C:\valentine\this_love.mp3")
  52.     EndSwitch
  53. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement