Followers 0

# Gui with the option of choice.

## 1 post in this topic

Select the option by using a selector.

```#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#cs ----------------------------------------------------------------------------
Author: Belini
Date: 07/05/12
AutoIt Version: 3.3.9.4
#ce ----------------------------------------------------------------------------
Const \$MASCARA = 0x8000
Global \$baixo = 0x26
Global \$cima = 0x28
Global \$confir = 0x41
Global \$Label_opt1, \$Label_opt2, \$pic_sel_1, \$pic_sel_2, \$gui, \$opcao_escol = 1
Global \$cont_tempo = 0, \$move = 1, \$loop = 1, \$escol_feita = 1, \$Label_press
escolha()
Func escolha()
gui()
While \$loop
If BitAND(_WinAPI_GetAsyncKeyState(\$baixo), \$MASCARA) Then
\$opcao_escol += 1
\$move = 1
Sleep(200)
EndIf
If BitAND(_WinAPI_GetAsyncKeyState(\$cima), \$MASCARA) Then
\$opcao_escol -= 1
\$move = 1
Sleep(200)
EndIf
If \$opcao_escol > 2 Then \$opcao_escol = 1
If \$opcao_escol <= 0 Then \$opcao_escol = 2
If \$opcao_escol = 1 And \$move = 1 Then
GUICtrlSetImage(\$pic_sel_1, _Seletor(True))
GUICtrlSetImage(\$pic_sel_2, "")
\$move = 0
EndIf
If \$opcao_escol = 2 And \$move = 1 Then
GUICtrlSetImage(\$pic_sel_1, "")
GUICtrlSetImage(\$pic_sel_2, _Seletor(True))
\$move = 0
EndIf
If BitAND(_WinAPI_GetAsyncKeyState(\$confir), \$MASCARA) Then key_press()
Sleep(5)
WEnd
Switch \$opcao_escol
Case 1
MsgBox(4096, "completed.", "The first option was chosen.")
Case 2
MsgBox(4096, "completed.", "The second option was chosen.")
EndSwitch
EndFunc   ;==>escolha
Func key_press()
\$cont_press = TimerInit()
While 1
If Not BitAND(_WinAPI_GetAsyncKeyState(\$confir), \$MASCARA) Or TimerDiff(\$cont_press) >= 3000 Then ExitLoop
Sleep(1)
WEnd
If TimerDiff(\$cont_press) < 3000 Then \$loop_1 = 1
If TimerDiff(\$cont_press) >= 3000 Then
GUIDelete(\$gui)
\$loop = 0
EndIf
GUICtrlSetBkColor(\$Label_press, "")
GUICtrlSetData(\$Label_press, "")
\$cont_tempo = 0
\$cont_press = 0
EndFunc   ;==>key_press
Func gui()
Local \$Label_cima, \$Label_baixo
\$gui_1 = GUICreate("opcional", 393, 157, -1, -1, BitOR(\$WS_POPUP, \$WS_BORDER))
GUISetBkColor(0x000000, \$gui_1)
\$pic_sel_1 = GUICtrlCreatePic(_Seletor(True), 9, 53, 375, 23)
\$pic_sel_2 = GUICtrlCreatePic("", 9, 84, 375, 23)
GUICtrlSetState(\$pic_sel_1, \$GUI_DISABLE)
GUICtrlSetState(\$pic_sel_2, \$GUI_DISABLE)
GUICtrlCreatePic(_barra_horiz(True), 0, 0, 393, 3)
GUICtrlCreatePic(_barra_vert(True), 0, 0, 3, 189)
GUICtrlCreatePic(_barra_vert(True), 390, 0, 3, 189)
GUICtrlCreatePic(_barra_horiz(True), 0, 155, 393, 3)
\$define_arquivo = "áudio e vídeo"
\$Limite_del_arq = "3"
\$Label_cima = GUICtrlCreateLabel(" Use the arrow keys to select an option:", 13, 6, 367, 24, BitOR(\$SS_CENTER, \$SS_CENTERIMAGE))
\$Label_opt1 = GUICtrlCreateLabel("Doing  what  was  defined  in  the  function  number  1.", 13, 56, 367, 17, BitOR(\$SS_LEFT, \$SS_CENTERIMAGE))
\$Label_opt2 = GUICtrlCreateLabel("Doing  what  was  defined  in  the  function  number  2.", 13, 87, 367, 17, BitOR(\$SS_LEFT, \$SS_CENTERIMAGE))
\$Labe_baixo = GUICtrlCreateLabel('Press "A" for 3 seconds to run the option.', 13, 125, 367, 25, BitOR(\$SS_CENTER, \$SS_CENTERIMAGE))
\$Label_press = GUICtrlCreateLabel("", 13, 31, 367, 17, BitOR(\$SS_CENTER, \$SS_CENTERIMAGE))
GUICtrlSetFont(\$Label_cima, 12, 800, 0, "MS Sans Serif")
GUICtrlSetFont(\$Label_opt1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetFont(\$Label_opt2, 10, 800, 0, "MS Sans Serif")
GUICtrlSetFont(\$Labe_baixo, 10, 800, 0, "MS Sans Serif")
GUICtrlSetFont(\$Label_press, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(\$Label_cima, 0xFFFFFF)
GUICtrlSetColor(\$Label_opt1, 0xFFFFFF)
GUICtrlSetColor(\$Label_opt2, 0xFFFFFF)
GUICtrlSetColor(\$Labe_baixo, 0xFFFFFF)
GUICtrlSetColor(\$Label_press, 0x00FF00)
GUISetState(@SW_SHOW)
EndFunc   ;==>gui
Func mostra_mens()
\$cont_tempo += 1
GUICtrlSetData(\$Label_press, 'The "A" key was pressed for ' & \$cont_tempo & " seconds.")
EndFunc   ;==>mostra_mens
; #FUNCTION# ====================================================================================================================
; Name ..........: _barra_horiz()
; Description ...: Compressed file embedded in your .au3 file
; Syntax ........: _barra_horiz( [ lToSave [, sPath [, lExecute ]]] )
; Parameters ....: lToSave           - [optional] If True, save the file, else, return binary data. Default is False.
;                 sPath            - [optional] The path of the file to be save. Default is @TempDir
;                 lExecute          - [optional] Flag to execute file saved. Default is False
; Return values .: Success           - Returns decompressed barra_horiz.bmp binary data or saved.
;        Failure             - Returns 0 and set @error to 1.
; Author(s) .....: João Carlos (Jscript FROM Brazil)
; Modified ......:
; Remarks .......: This function uses _LZNTDecompress() and _Base64Decode() by trancexx.
; Related .......:
; Example .......; _barra_horiz()
; ===============================================================================================================================
Func _barra_horiz(\$lToSave = False, \$sPath = @TempDir, \$lExecute = False)
Local \$hFileHwnd, \$bData, \$sFileName = \$sPath & "\barra_horiz.bmp"
; Original: D:\00 _Importantes\ZZ Proj. maq de música\barra_horiz.bmp
If \$lToSave Then
\$hFileHwnd = FileOpen(\$sFileName, 10)
If @error Then Return SetError(1, 0, 0)
FileWrite(\$hFileHwnd, __barra_horiz(__barra_horizB64(\$bData)))
FileClose(\$hFileHwnd)
If \$lExecute Then
RunWait(\$sFileName, "")
FileDelete(\$sFileName)
Return 1
EndIf
If FileExists(\$sFileName) Then Return \$sFileName
Else
Return __barra_horiz(__barra_horizB64(\$bData))
EndIf
Return SetError(1, 0, 0)
EndFunc   ;==>_barra_horiz
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __barra_horizB64
; Description ...: Base64 decode input data.
; Syntax.........: __barra_horizB64(\$bBinary)
; Parameters ....: \$sInput - String data to decode
; Return values .: Success - Returns decode binary data.
;                         - Sets @error to 0
;                 Failure - Returns empty string and sets @error:
;                 |1 - Error calculating the length of the buffer needed.
;                 |2 - Error decoding.
; Author ........: trancexx
; Modified ......: João Carlos (Jscript FROM Brazil)
; Related .......: _Base64Encode()
; ===============================================================================================================================
Func __barra_horizB64(\$sInput)
Local \$struct = DllStructCreate("int")
Local \$a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
"str", \$sInput, _
"int", 0, _
"int", 1, _
"ptr", 0, _
"ptr", DllStructGetPtr(\$struct, 1), _
"ptr", 0, _
"ptr", 0)
If @error Or Not \$a_Call[0] Then
Return SetError(1, 0, "") ; error calculating the length of the buffer needed
EndIf
Local \$a = DllStructCreate("byte[" & DllStructGetData(\$struct, 1) & "]")
\$a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
"str", \$sInput, _
"int", 0, _
"int", 1, _
"ptr", DllStructGetPtr(\$a), _
"ptr", DllStructGetPtr(\$struct, 1), _
"ptr", 0, _
"ptr", 0)
If @error Or Not \$a_Call[0] Then
Return SetError(2, 0, ""); error decoding
EndIf
Return DllStructGetData(\$a, 1)
EndFunc   ;==>__barra_horizB64
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __barra_horiz
; Original Name..: _LZNTDecompress
; Description ...: Decompresses input data.
; Syntax.........: __barra_horiz(\$bBinary)
; Parameters ....: \$vInput - Binary data to decompress.
; Return values .: Success - Returns decompressed binary data.
;                         - Sets @error to 0
;                 Failure - Returns empty string and sets @error:
;                 |1 - Error decompressing.
; Author ........: trancexx
; Related .......: _LZNTCompress
; ===============================================================================================================================
Func __barra_horiz(\$bBinary)
\$bBinary = Binary(\$bBinary)
Local \$tInput = DllStructCreate("byte[" & BinaryLen(\$bBinary) & "]")
DllStructSetData(\$tInput, 1, \$bBinary)
Local \$tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize(\$tInput) & "]") ; initially oversizing buffer
Local \$a_Call = DllCall("ntdll.dll", "int", "RtlDecompressBuffer", _
"ushort", 2, _
"ptr", DllStructGetPtr(\$tBuffer), _
"dword", DllStructGetSize(\$tBuffer), _
"ptr", DllStructGetPtr(\$tInput), _
"dword", DllStructGetSize(\$tInput), _
"dword*", 0)
If @error Or \$a_Call[0] Then
Return SetError(1, 0, "") ; error decompressing
EndIf
Local \$tOutput = DllStructCreate("byte[" & \$a_Call[6] & "]", DllStructGetPtr(\$tBuffer))
Return SetError(0, 0, DllStructGetData(\$tOutput, 1))
EndFunc   ;==>__barra_horiz
; #FUNCTION# ====================================================================================================================
; Name ..........: _barra_vert()
; Description ...: Compressed file embedded in your .au3 file
; Syntax ........: _barra_vert( [ lToSave [, sPath [, lExecute ]]] )
; Parameters ....: lToSave           - [optional] If True, save the file, else, return binary data. Default is False.
;                 sPath            - [optional] The path of the file to be save. Default is @TempDir
;                 lExecute          - [optional] Flag to execute file saved. Default is False
; Return values .: Success           - Returns decompressed barra_vert.bmp binary data or saved.
;        Failure             - Returns 0 and set @error to 1.
; Author(s) .....: João Carlos (Jscript FROM Brazil)
; Modified ......:
; Remarks .......: This function uses _LZNTDecompress() and _Base64Decode() by trancexx.
; Related .......:
; Example .......; _barra_vert()
; ===============================================================================================================================
Func _barra_vert(\$lToSave = False, \$sPath = @TempDir, \$lExecute = False)
Local \$hFileHwnd, \$bData, \$sFileName = \$sPath & "\barra_vert.bmp"
; Original: D:\00 _Importantes\ZZ Proj. maq de música\barra_vert.bmp
If \$lToSave Then
\$hFileHwnd = FileOpen(\$sFileName, 10)
If @error Then Return SetError(1, 0, 0)
FileWrite(\$hFileHwnd, __barra_vert(__barra_vertB64(\$bData)))
FileClose(\$hFileHwnd)
If \$lExecute Then
RunWait(\$sFileName, "")
FileDelete(\$sFileName)
Return 1
EndIf
If FileExists(\$sFileName) Then Return \$sFileName
Else
Return __barra_vert(__barra_vertB64(\$bData))
EndIf
Return SetError(1, 0, 0)
EndFunc   ;==>_barra_vert
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __barra_vertB64
; Description ...: Base64 decode input data.
; Syntax.........: __barra_vertB64(\$bBinary)
; Parameters ....: \$sInput - String data to decode
; Return values .: Success - Returns decode binary data.
;                         - Sets @error to 0
;                 Failure - Returns empty string and sets @error:
;                 |1 - Error calculating the length of the buffer needed.
;                 |2 - Error decoding.
; Author ........: trancexx
; Modified ......: João Carlos (Jscript FROM Brazil)
; Related .......: _Base64Encode()
; ===============================================================================================================================
Func __barra_vertB64(\$sInput)
Local \$struct = DllStructCreate("int")
Local \$a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
"str", \$sInput, _
"int", 0, _
"int", 1, _
"ptr", 0, _
"ptr", DllStructGetPtr(\$struct, 1), _
"ptr", 0, _
"ptr", 0)
If @error Or Not \$a_Call[0] Then
Return SetError(1, 0, "") ; error calculating the length of the buffer needed
EndIf
Local \$a = DllStructCreate("byte[" & DllStructGetData(\$struct, 1) & "]")
\$a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
"str", \$sInput, _
"int", 0, _
"int", 1, _
"ptr", DllStructGetPtr(\$a), _
"ptr", DllStructGetPtr(\$struct, 1), _
"ptr", 0, _
"ptr", 0)
If @error Or Not \$a_Call[0] Then
Return SetError(2, 0, ""); error decoding
EndIf
Return DllStructGetData(\$a, 1)
EndFunc   ;==>__barra_vertB64
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __barra_vert
; Original Name..: _LZNTDecompress
; Description ...: Decompresses input data.
; Syntax.........: __barra_vert(\$bBinary)
; Parameters ....: \$vInput - Binary data to decompress.
; Return values .: Success - Returns decompressed binary data.
;                         - Sets @error to 0
;                 Failure - Returns empty string and sets @error:
;                 |1 - Error decompressing.
; Author ........: trancexx
; Related .......: _LZNTCompress
; ===============================================================================================================================
Func __barra_vert(\$bBinary)
\$bBinary = Binary(\$bBinary)
Local \$tInput = DllStructCreate("byte[" & BinaryLen(\$bBinary) & "]")
DllStructSetData(\$tInput, 1, \$bBinary)
Local \$tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize(\$tInput) & "]") ; initially oversizing buffer
Local \$a_Call = DllCall("ntdll.dll", "int", "RtlDecompressBuffer", _
"ushort", 2, _
"ptr", DllStructGetPtr(\$tBuffer), _
"dword", DllStructGetSize(\$tBuffer), _
"ptr", DllStructGetPtr(\$tInput), _
"dword", DllStructGetSize(\$tInput), _
"dword*", 0)
If @error Or \$a_Call[0] Then
Return SetError(1, 0, "") ; error decompressing
EndIf
Local \$tOutput = DllStructCreate("byte[" & \$a_Call[6] & "]", DllStructGetPtr(\$tBuffer))
Return SetError(0, 0, DllStructGetData(\$tOutput, 1))
EndFunc   ;==>__barra_vert
; #FUNCTION# ====================================================================================================================
; Name ..........: _Seletor()
; Description ...: Compressed file embedded in your .au3 file
; Syntax ........: _Seletor( [ lToSave [, sPath [, lExecute ]]] )
; Parameters ....: lToSave           - [optional] If True, save the file, else, return binary data. Default is False.
;                 sPath            - [optional] The path of the file to be save. Default is @TempDir
;                 lExecute          - [optional] Flag to execute file saved. Default is False
; Return values .: Success           - Returns decompressed Seletor.bmp binary data or saved.
;        Failure             - Returns 0 and set @error to 1.
; Author(s) .....: João Carlos (Jscript FROM Brazil)
; Modified ......:
; Remarks .......: This function uses _LZNTDecompress() and _Base64Decode() by trancexx.
; Related .......:
; Example .......; _Seletor()
; ===============================================================================================================================
Func _Seletor(\$lToSave = False, \$sPath = @TempDir, \$lExecute = False)
Local \$hFileHwnd, \$bData, \$sFileName = \$sPath & "\Seletor.bmp"
; Original: F:\_0 SCRIPTS\zzz ultimas\Testes deletar arquivos\Auxiliares\Seletor.b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fAf8fAR8BHwEfAR8BH"
\$bData &= "wEfAR8B/x8BHwEfAR8BHwEfAR8BHwH/HwEfAR8BHwEfAR8BHwEfAf8fAR8BHwEfAR8BHwEfAR8B/x8BHwETAX9GnwIfAR8BHwH/HwEfAR8BHwEfAR8BHwEfAf8fAR8BHwEfAR8BHwEfAR8B/x8BHwEfAR8BHwEfAR8BHwH/HwEfAR8BHwEfAR8BHwEfAf8fAR8BHwEfAR8BHwEfAR8BAx8BGQE+sCIAHAECqbyAkAje8PYH3/h/Af9BP0F/EP9/EH8QfxB/EH8QfxA/CL9m/79avwy/DL8Mvwy/DL8MswwDIIwisQ=="
If \$lToSave Then
\$hFileHwnd = FileOpen(\$sFileName, 10)
If @error Then Return SetError(1, 0, 0)
FileWrite(\$hFileHwnd, __Seletor(__SeletorB64(\$bData)))
FileClose(\$hFileHwnd)
If \$lExecute Then
RunWait(\$sFileName, "")
FileDelete(\$sFileName)
Return 1
EndIf
If FileExists(\$sFileName) Then Return \$sFileName
Else
Return __Seletor(__SeletorB64(\$bData))
EndIf
Return SetError(1, 0, 0)
EndFunc   ;==>_Seletor
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __SeletorB64
; Description ...: Base64 decode input data.
; Syntax.........: __SeletorB64(\$bBinary)
; Parameters ....: \$sInput - String data to decode
; Return values .: Success - Returns decode binary data.
;                         - Sets @error to 0
;                 Failure - Returns empty string and sets @error:
;                 |1 - Error calculating the length of the buffer needed.
;                 |2 - Error decoding.
; Author ........: trancexx
; Modified ......: João Carlos (Jscript FROM Brazil)
; Related .......: _Base64Encode()
; ===============================================================================================================================
Func __SeletorB64(\$sInput)
Local \$struct = DllStructCreate("int")
Local \$a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
"str", \$sInput, _
"int", 0, _
"int", 1, _
"ptr", 0, _
"ptr", DllStructGetPtr(\$struct, 1), _
"ptr", 0, _
"ptr", 0)
If @error Or Not \$a_Call[0] Then
Return SetError(1, 0, "") ; error calculating the length of the buffer needed
EndIf
Local \$a = DllStructCreate("byte[" & DllStructGetData(\$struct, 1) & "]")
\$a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", _
"str", \$sInput, _
"int", 0, _
"int", 1, _
"ptr", DllStructGetPtr(\$a), _
"ptr", DllStructGetPtr(\$struct, 1), _
"ptr", 0, _
"ptr", 0)
If @error Or Not \$a_Call[0] Then
Return SetError(2, 0, ""); error decoding
EndIf
Return DllStructGetData(\$a, 1)
EndFunc   ;==>__SeletorB64
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __Seletor
; Original Name..: _LZNTDecompress
; Description ...: Decompresses input data.
; Syntax.........: __Seletor(\$bBinary)
; Parameters ....: \$vInput - Binary data to decompress.
; Return values .: Success - Returns decompressed binary data.
;                         - Sets @error to 0
;                 Failure - Returns empty string and sets @error:
;                 |1 - Error decompressing.
; Author ........: trancexx
; Related .......: _LZNTCompress
; ===============================================================================================================================
Func __Seletor(\$bBinary)
\$bBinary = Binary(\$bBinary)
Local \$tInput = DllStructCreate("byte[" & BinaryLen(\$bBinary) & "]")
DllStructSetData(\$tInput, 1, \$bBinary)
Local \$tBuffer = DllStructCreate("byte[" & 16 * DllStructGetSize(\$tInput) & "]") ; initially oversizing buffer
Local \$a_Call = DllCall("ntdll.dll", "int", "RtlDecompressBuffer", _
"ushort", 2, _
"ptr", DllStructGetPtr(\$tBuffer), _
"dword", DllStructGetSize(\$tBuffer), _
"ptr", DllStructGetPtr(\$tInput), _
"dword", DllStructGetSize(\$tInput), _
"dword*", 0)
If @error Or \$a_Call[0] Then
Return SetError(1, 0, "") ; error decompressing
EndIf
Local \$tOutput = DllStructCreate("byte[" & \$a_Call[6] & "]", DllStructGetPtr(\$tBuffer))
Return SetError(0, 0, DllStructGetData(\$tOutput, 1))
EndFunc   ;==>__Seletor```