Código: Seleccionar todo
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
;--------------------------------------------------->>Ventana de loggin<<----------------------------------------------------
$Loggin = GUICreate("Loggin", 210, 74, 349, 436)
GUISetBkColor(0x00000000)
GUISetIcon("Shell32.dll", 269)
$User = GUICtrlCreateInput("Usuario", 8, 8, 129, 21)
$Password = GUICtrlCreateInput("Password", 8, 40, 129, 21, $ES_PASSWORD)
$OK = GUICtrlCreateButton("OK", 144, 8, 57, 57, 0)
GUISetState(@SW_SHOW)
;---------------------------------------------------->>teclas<<-----------------------------------------------
Global $AccelKeys[1][2] = [["{enter}", $OK]]
GUISetAccelerators($AccelKeys)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $OK
If GUICtrlRead($Password) = "dark123" Then
; GUIDelete()
GUISetState(@SW_HIDE)
ExitLoop
Else
Exit 0
EndIf
Case $GUI_EVENT_CLOSE ;------------------------------------ cierra el chat
Exit 0
EndSwitch
WEnd
;-------------------------------------------------->>Ventana Principal<<----------------------------------------------------
$Chatico = GUICreate("Chatico V2.51 By Bett®Soft", 363, 210);997, 503
; GUISetBkColor(0x00000000)
GUISetIcon("Shell32.dll", 269)
GUISetFont(12, 400, 2, "Segoe UI")
$Label1 = GUICtrlCreateLabel("Nivel de Transparencia", 30, 180, 200, 35)
; GUICtrlSetColor(-1, 0xff0000)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$salida = GUICtrlCreateInput("", 8, 128, 345, 29) ;Cuadro de texto donde escribes
$entrada = GUICtrlCreateEdit("", 8, 8, 345, 113, BitOR($WS_VSCROLL, $ES_MULTILINE, $ES_WANTRETURN)) ;Cuadro donde ves lo escrito
$enviar = GUICtrlCreateButton("Enviar", 264, 168, 90, 33, $WS_GROUP) ;Boton "enviar"
GUICtrlSetFont(-1, 18, 800, 0, "Papyrus")
GUICtrlSetCursor(-1, 0)
$borrar = GUICtrlCreateButton("Borrar", 172, 168, 90, 33, $WS_GROUP) ;Boton "borrar"
GUICtrlSetFont(-1, 18, 800, 0, "Papyrus")
GUICtrlSetCursor(-1, 0)
$mute = GUICtrlCreateCheckbox("Sonido", 2, 192, 80, 20)
; GUICtrlSetColor(-1, 0xff0000)
$slider1 = GUICtrlCreateSlider(2, 160, 170, 20)
GUICtrlSetLimit(-1, 254, 50)
GUICtrlSetData($slider1, 128)
GUISetState(@SW_SHOW)
WinSetTrans("Chatico V2.51 By Bett®Soft", "", GUICtrlRead($slider1))
If Not FileExists("i1310.txt") Then
_FileCreate("i1310.txt")
MsgBox(4096, "Aviso", "Log creado", 1 / 2)
EndIf
;------------------------------------------------->>ocultar archivo<<----------------------------------------------------
FileSetAttrib("i1310.txt", "+H")
$size_1 = FileGetSize("i1310.txt")
Global $number = 0
;---------------------------------------------->>Opciones para traymenu<<-----------------------------------------------
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)
;------------------------------------------>>opciones generales para las ventanas<<----------------------------------
Opt("WinWaitDelay", 100)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 0)
Opt("WinTitleMatchMode", 3)
;------------------------------------------------->>incio de secion de un usuario<<----------------------------------------
$file = FileOpen("i1310.txt", 1)
If $file = -1 Then
MsgBox(0, "Info", "Aguante mijo que el archivo no esta listo", 1)
EndIf
FileWriteLine($file, GUICtrlRead($User) & " ha conectado ");GUICtrlRead($User)
FileClose($file)
Global $AccelKeys[1][2] = [["{enter}", $enviar]]
GUISetAccelerators($AccelKeys)
HotKeySet("^!{space}", "boss_key")
While 1
If WinActive("Chatico V2.51 By Bett®Soft") Then
TraySetIcon("Shell32.dll", 16)
EndIf
$nMsg = GUIGetMsg()
WinSetTrans("Chatico V2.51 By Bett®Soft", "", GUICtrlRead($slider1))
Switch $nMsg
Case $enviar ; -----------------------------------------accion cuando se oprime el boton "enviar"
enviar()
Case $GUI_EVENT_CLOSE ;------------------------------------ accion cuando se cierra el chat
$file = FileOpen("i1310.txt", 1)
If $file = -1 Then
MsgBox(0, "Info", "Aguante mijo que el archivo no esta listo", 1)
EndIf
FileWriteLine($file, GUICtrlRead($User) & " ha desconectado ")
FileClose($file)
Exit
Case $borrar
FileDelete("i1310.txt")
_FileCreate("i1310.txt")
FileSetAttrib("i1310.txt", "+H")
EndSwitch
$size_2 = FileGetSize("i1310.txt"); ------------------------------secuencia de actualizacion del chat
If $size_1 <> $size_2 Then
$file = FileOpen("i1310.txt", 0)
If $file = -1 Then
MsgBox(0, "Info", "Aguante mijo que el archivo no esta listo", 1)
EndIf
$line = FileReadLine($file, -1)
FileClose($file)
GUICtrlSetData($entrada, $line & @CRLF, 1)
$size_1 = $size_2
TraySetIcon("Shell32.dll", 282)
If GUICtrlRead($mute) = 1 Then
SoundPlay(@WindowsDir & "\media\Barra de info de Windows XP.wav", 0)
EndIf
WinFlash("Chatico V2.51 By Bett®Soft", "", 2, 400)
EndIf
WEnd
;---------------------------------------------------->>Funcion tecla jefe<<--------------------------------------------
Func boss_key()
$x = Not $number
$number = $x
If $number = True Then
WinSetState("Chatico V2.51 By Bett®Soft", "", @SW_HIDE)
Opt("TrayIconHide", 1)
Else
WinSetState("Chatico V2.51 By Bett®Soft", "", @SW_SHOW)
Opt("TrayIconHide", 0)
EndIf
EndFunc ;==>boss_key
;------------------------------------------------->>Funcion tesa<<----------------------------------------
Func enviar()
$file = FileOpen("i1310.txt", 1)
If $file = -1 Then
MsgBox(0, "Info", "Aguante mijo que el archivo no esta listo", 1)
EndIf
FileWriteLine($file, GUICtrlRead($User) & " Dice: " & GUICtrlRead($salida))
FileClose($file)
GUICtrlSetData($salida, "") ;borrar lo escrito
$file = FileOpen("i1310.txt", 0)
If $file = -1 Then
MsgBox(0, "Info", "Aguante mijo que el archivo no esta listo", 1)
EndIf
$line = FileReadLine($file, -1)
FileClose($file)
GUICtrlSetData($entrada, $line & @CRLF, 1)
$size_1 = FileGetSize("i1310.txt")
;~ GUICtrlSetData($entrada, @lf)
EndFunc ;==>enviar
solo quiero decir.... ADORO AUTOIT