AutoitHacks

Funciones con Autoit

May 16th, 2012
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.43 KB | None | 0 0
  1. #NoTrayIcon
  2. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  3. #AutoIt3Wrapper_Version=Beta
  4. #AutoIt3Wrapper_Outfile=funciones_x86.exe
  5. #AutoIt3Wrapper_Outfile_x64=funciones_x64.exe
  6. #AutoIt3Wrapper_Compression=4
  7. #AutoIt3Wrapper_Compile_Both=y
  8. #AutoIt3Wrapper_UseX64=y
  9. #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
  10. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  11. #cs ----------------------------------------------------------------------------
  12.  AutoIt Version: 3.3.8.1
  13.  Author:         Jesux Herrera - AutoitHacks Admin
  14.  Webpage:        www.autoithacks.tk
  15.  Post:  http://www.autoithacks.tk/2012/05/ejemplo-de-funciones/
  16.  
  17.  Script Function:
  18.     Ejemplo de Funciones con Do Until y Transparencia
  19. #ce ----------------------------------------------------------------------------
  20.  
  21. #include <ButtonConstants.au3>
  22. #include <GUIConstantsEx.au3>
  23. #include <WindowsConstants.au3>
  24. $Form1 = GUICreate("Funciones!!", 291, 138, -1, -1)
  25. $Button1 = GUICtrlCreateButton("Iniciar", 40, 24, 211, 25)
  26. $Button2 = GUICtrlCreateButton("Segunda Funcion", 40, 56, 211, 25)
  27. $Button3 = GUICtrlCreateButton("Despedida", 40, 88, 211, 25)
  28. $Label1 = GUICtrlCreateLabel("www.autoithacks.tk", 96, 120, 98, 17)
  29. GUICtrlSetState($Button2, $GUI_DISABLE)
  30. GUICtrlSetState($Button3, $GUI_DISABLE)
  31. GUISetState(@SW_SHOW)
  32.  
  33.  
  34. While 1
  35.     $nMsg = GUIGetMsg()
  36.     Switch $nMsg
  37.         Case $GUI_EVENT_CLOSE
  38.             Exit
  39.  
  40.         Case $Button1
  41.             WinSetTrans($Form1,"", 255)
  42.             _uno()
  43.             GUICtrlSetState($Button1, $GUI_DISABLE)
  44.             GUICtrlSetState($Button2, $GUI_ENABLE)
  45.             ContinueCase
  46.  
  47.         Case $Button2
  48.             WinSetTrans($Form1,"", 0)
  49.             _dos()
  50.             GUICtrlSetState($Button2, $GUI_DISABLE)
  51.             ContinueCase
  52.  
  53.         Case $Button3
  54.             GUICtrlSetData($Button3,"Adios!")
  55.             _tres()
  56.  
  57.  
  58.  
  59.     EndSwitch
  60. WEnd
  61.  
  62. Func _uno()
  63.  
  64.             Local $i = 255
  65.             Do
  66.             GUICtrlSetData($Button1, $i)
  67.             WinSetTrans($Form1,"", $i)
  68.             WinSetTitle($Form1,"", "Cargando..  " & $i & "%")
  69.             Sleep(10)
  70.             $i = $i - 1
  71.         Until $i = 0
  72.         GUICtrlSetData($Button1,"")
  73. EndFunc
  74.  
  75.  
  76. Func _dos()
  77.  
  78.         Local $i = 0
  79.             Do
  80.             GUICtrlSetData($Button2, $i)
  81.             WinSetTrans($Form1,"", $i)
  82.             WinSetTitle($Form1,"", "Cargando..  " & $i & "%")
  83.             Sleep(10)
  84.             $i = $i + 1
  85.         Until $i = 255
  86.         GUICtrlSetData($Button2,"")
  87.  
  88. EndFunc
  89.  
  90. Func _tres()
  91.  
  92.         Local $i = 255
  93.             Do
  94.             WinSetTrans($Form1,"", $i)
  95.             WinSetTitle($Form1,"", "Cargando..  " & $i & "%")
  96.             Sleep(10)
  97.             $i = $i - 1
  98.         Until $i = 0
  99.         Exit
  100.  
  101. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment