Juno_okyo

Message dialog with sliding effect

Dec 1st, 2014
991
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.85 KB | None | 0 0
  1. #region
  2. #AutoIt3Wrapper_UseUpx=Y
  3. #AutoIt3Wrapper_Compression=4
  4. #AutoIt3Wrapper_Icon=E:\wamp\www\favicon.ico
  5. #AutoIt3Wrapper_Res_Comment=Coded by Juno_okyo
  6. #AutoIt3Wrapper_Res_Description=Coded by Juno_okyo
  7. #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
  8. #AutoIt3Wrapper_Res_ProductVersion=1.0.0.0
  9. #AutoIt3Wrapper_Res_LegalCopyright=(c) 2014 by Juno_okyo's Blog
  10. #AutoIt3Wrapper_Res_Field=ProductName|Juno_okyo's Production
  11. #AutoIt3Wrapper_Res_Field=ProductVersion|1.0.0.0
  12. #AutoIt3Wrapper_Res_Field=CompanyName|J2TeaM
  13. #endregion
  14.  
  15. ; Includes
  16. #include <Misc.au3>
  17. #include <EditConstants.au3>
  18. #include <GUIConstantsEx.au3>
  19. #include <WindowsConstants.au3>
  20.  
  21. ; Only One Instance
  22. _Singleton(@ScriptName)
  23.  
  24. ; Options
  25. #NoTrayIcon
  26. Opt('WinTitleMatchMode', 2)
  27. Opt('GUIOnEventMode', 1)
  28. Opt('GUICloseOnESC', 0)
  29.  
  30. ; Script Start - Add your code below here
  31. slideUp_Dialog('Message', 'Hello, This is a demo!')
  32.  
  33. While 1
  34.     Sleep(100)
  35. WEnd
  36.  
  37. Func slideUp_Dialog($title, $message)
  38.     Local $desktopH = @DesktopHeight, $desktopW = @DesktopWidth
  39.     Local $width = 285, $height = 236
  40.     Local $x = $desktopW - ($width + 12)
  41.  
  42.     #Region ### START Koda GUI section ### Form=
  43.     Global $MainForm = GUICreate($title, $width, 165, $x, $desktopH, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE), WinGetHandle(AutoItWinGetTitle()))
  44.     GUISetFont(12, 400, 0, "Arial")
  45.     GUISetOnEvent($GUI_EVENT_CLOSE, "slideDown_Dialog")
  46.     GUISetOnEvent($GUI_EVENT_MINIMIZE, "slideDown_Dialog")
  47.     Local $Edit = GUICtrlCreateEdit($message, 0, 0, 284, 164, BitOR($GUI_SS_DEFAULT_EDIT,$ES_READONLY))
  48.     GUICtrlSetState(-1, $GUI_FOCUS)
  49.     GUISetState(@SW_SHOW)
  50.     #EndRegion ### END Koda GUI section ###
  51.  
  52.     For $i = 0 To $height Step + 5
  53.         WinMove($MainForm, '', $x, $desktopH - $i)
  54.         Sleep(1)
  55.     Next
  56. EndFunc
  57.  
  58. Func slideDown_Dialog()
  59.     For $i = 255 To 0 Step - 10
  60.         WinSetTrans($MainForm, '', $i)
  61.         Sleep(1)
  62.     Next
  63.     Exit
  64. EndFunc
Add Comment
Please, Sign In to add comment