Fácil uso, solo activan el programa y proceden a copiar cualquier texto legible, igualmente esto lo pueden detener al volver al pulsar el botón.
Espero que a mas de uno le sirva.
Codigo fuente - adjunto archivos utilizados
Código: Seleccionar todo
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=iconoTextReaderYasmany.ico
#AutoIt3Wrapper_Outfile=TextReader.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=Software [email protected]
#AutoIt3Wrapper_Res_Description=Lector de texto - w8 o superior
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Yasmany Curimilma
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
#Au3Stripper_Parameters=/sf /sv
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <Misc.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPISys.au3>
Opt("GUICloseOnESC", 0)
Opt("GUIOnEventMode", 1)
_Singleton('TextReaderYas')
Global $statusButton
Global $statusActivacion
Global $o_speech = 0
Global $data1, $data2
FileInstall('.\btn1texReader.png', @TempDir & '\', 1)
FileInstall('.\btn3texReader.png', @TempDir & '\', 1)
FileInstall('.\btnResplandorTexReader.png', @TempDir & '\', 1)
FileInstall('.\btnSombraTexReader.png', @TempDir & '\', 1)
FileInstall('.\PNG-mini-TextReader.png', @TempDir & '\', 1)
Global $hMainGUI = GUICreate("TextReaderYasmanyCurimilma", 403, 218, -1, -1, $WS_POPUPWINDOW)
GUISetBkColor(0x424242)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUISetIcon('iconoTextReaderYasmany.ico')
GUICtrlCreateLabel(' TextReader', 0, 0, 370, 30, $ss_centerimage, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, 0X303030)
GUICtrlSetColor(-1, 0Xcccccc)
GUICtrlSetFont(-1, 13)
GUICtrlCreateLabel("", 0, 31, 404, 1)
GUICtrlSetBkColor(-1, 0X6e6c6c)
GUICtrlSetState(-1, $gui_disable)
Global $btnCerrar = GUICtrlCreateLabel("X", 370, 0, 33, 30, $SS_CENTER + $SS_CENTERIMAGE)
GUICtrlSetTip($btnCerrar, 'Cierra el programa')
GUICtrlSetOnEvent($btnCerrar, "_exit")
GUICtrlSetCursor($btnCerrar, 0)
GUICtrlSetBkColor($btnCerrar, 0Xcc3333)
GUICtrlSetColor($btnCerrar, 0XFFFFFF)
GUICtrlSetFont($btnCerrar, 13)
_GUICtrlPic_Create(@TempDir & '\PNG-mini-TextReader.png', 2, 3)
Global $btnAzul = _GUICtrlPic_Create(@TempDir & '\btn1texReader.png', 30, 50);, 100, 100)
GUICtrlSetOnEvent($btnAzul, 'clicLogo1')
GUICtrlSetCursor($btnAzul, 0)
Global $sombra = _GUICtrlPic_Create(@TempDir & '\btnSombraTexReader.png', 30, 50);, 100, 100)
GUICtrlSetCursor($sombra, 0)
GUICtrlSetState($sombra, $GUI_HIDE)
Global $btnVerde = _GUICtrlPic_Create(@TempDir & '\btn3texReader.png', 30, 50);, 100, 100)
GUICtrlSetCursor($btnVerde, 0)
GUICtrlSetState($btnVerde, $GUI_HIDE)
GUICtrlSetTip($btnVerde, 'Desactivar la lectura')
Global $resplandor = _GUICtrlPic_Create(@TempDir & '\btnResplandorTexReader.png', 30, 50);, 100, 100)
GUICtrlSetCursor($resplandor, 0)
GUICtrlSetState($resplandor, $GUI_HIDE)
Global $lblIniciar = GUICtrlCreateLabel("Iniciar", 165, 65, 215, 30)
GUICtrlSetColor(-1, 0Xcccccc)
GUICtrlSetFont(-1, 15, 600)
Global $textoAyuda = GUICtrlCreateLabel("Al pulsar sobre el botón, activará el programa y empezará a detectar cada vez que copie " & _
"un texto y procederá a leerlo, válido para Windows 8 o superior.", 165, 100, 215, 70)
GUICtrlSetColor(-1, 0XFFFFFF)
GUICtrlCreateLabel("Status: ", 20, 195, 40, 20)
GUICtrlSetColor(-1, 0x868686)
Global $status = GUICtrlCreateLabel("Detenido", 60, 195, 150, 20)
GUICtrlSetColor($status, 0x868686)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
Global $btnInfo = GUICtrlCreateLabel("I n f o", 355, 195, 40, 20)
GUICtrlSetColor($btnInfo, 0x99ccff)
GUICtrlSetTip($btnInfo, 'Información acerca' & @CRLF & 'de TextReader')
GUICtrlSetCursor($btnInfo, 0)
GUICtrlSetOnEvent($btnInfo, 'mostrarInfo')
Local $tRID = DllStructCreate($tagRAWINPUTDEVICE)
DllStructSetData($tRID, 'UsagePage', 0x01) ; Generic Desktop Controls
DllStructSetData($tRID, 'Usage', 0x02) ; Mouse
DllStructSetData($tRID, 'Flags', $RIDEV_INPUTSINK)
DllStructSetData($tRID, 'hTarget', $hMainGUI)
_WinAPI_RegisterRawInputDevices($tRID)
GUIRegisterMsg($WM_INPUT, 'WM_INPUT')
GUICtrlSetTip($btnAzul, 'Iniciar')
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func _detectando()
If ClipGet() <> '' And StringRight(StringLeft(ClipGet(), 3), 2) <> ':\' Then
_TalkOBJ(ClipGet())
ClipPut('')
EndIf
EndFunc ;==>_detectando
Func clicLogo1()
EndFunc ;==>clicLogo1
Func _TalkOBJ($s_text)
_Voice_Stop()
$o_speech = ObjCreate("SAPI.SpVoice");$o_speech.Volume = 100
$o_speech.Speak($s_text, 1)
EndFunc ;==>_TalkOBJ
Func _Voice_Stop() ; COLABORACION DE DANIEL RIVERO (Venezuela)
If IsObj($o_speech) Then ; AGREGUÉ ESTA LINEA
$o_speech.Pause()
$o_speech = 0
EndIf
EndFunc ;==>_Voice_Stop
Func _exit()
FileDelete(@TempDir & '\btn1texReader.png')
FileDelete(@TempDir & '\btn3texReader.png')
FileDelete(@TempDir & '\btnResplandorTexReader.png')
FileDelete(@TempDir & '\btnSombraTexReader.png')
FileDelete(@TempDir & '\PNG-mini-TextReader.png')
Exit
EndFunc ;==>_exit
Func mostrarInfo()
If GUICtrlRead($btnInfo) = 'I n f o' Then
$data1 = GUICtrlRead($lblIniciar)
$data2 = GUICtrlRead($textoAyuda)
GUICtrlSetData($lblIniciar, 'Acerca de...')
GUICtrlSetData($textoAyuda, 'Desarrollador: ' & @CRLF & 'Yasmany Curimilma (Ecuador)' & @CRLF & 'facebook.com\yasmanycurimilma' & @CRLF & @CRLF & 'Agradecimiento: Daniel Rivero (Venezuela)')
GUICtrlSetData($btnInfo, 'No Info')
ElseIf GUICtrlRead($btnInfo) = 'No Info' Then
GUICtrlSetData($lblIniciar, $data1)
GUICtrlSetData($textoAyuda, $data2)
GUICtrlSetData($btnInfo, 'I n f o')
$data1 = ''
$data2 = ''
EndIf
EndFunc ;==>mostrarInfo
Func _GUICtrlPic_Create($sFilename, $iLeft, $iTop, $iWidth = -1, $iHeight = -1, $iStyle = -1, $iExStyle = -1)
_GDIPlus_Startup()
Local $idPic = GUICtrlCreatePic("", $iLeft, $iTop, $iWidth, $iHeight, $iStyle, $iExStyle)
Local $hBitmap = _GDIPlus_BitmapCreateFromFile($sFilename)
If $iWidth = -1 Then $iWidth = _GDIPlus_ImageGetWidth($hBitmap)
If $iHeight = -1 Then $iHeight = _GDIPlus_ImageGetHeight($hBitmap)
Local $hBitmap_Resized = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight)
Local $hBMP_Ctxt = _GDIPlus_ImageGetGraphicsContext($hBitmap_Resized)
_GDIPlus_GraphicsSetInterpolationMode($hBMP_Ctxt, $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC)
_GDIPlus_GraphicsDrawImageRect($hBMP_Ctxt, $hBitmap, 0, 0, $iWidth, $iHeight)
Local $hHBitmap = _GDIPlus_BitmapCreateDIBFromBitmap($hBitmap_Resized)
Local $hPrevImage = GUICtrlSendMsg($idPic, $STM_SETIMAGE, 0, $hHBitmap) ; $STM_SETIMAGE = 0x0172
_WinAPI_DeleteObject($hPrevImage); Delete Prev image if any
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_BitmapDispose($hBitmap_Resized)
_GDIPlus_GraphicsDispose($hBMP_Ctxt)
_WinAPI_DeleteObject($hHBitmap)
_GDIPlus_Shutdown()
Return $idPic
EndFunc ;==>_GUICtrlPic_Create
Func WM_INPUT($hWnd, $iMsg, $wParam, $lParam)
#forceref $iMsg, $wParam
Local $tPoint
Local $pos = ControlGetPos('TextReaderYasmanyCurimilma', 'TextReader', $btnAzul);~ ConsoleWrite($pos[0] & "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3] & @CRLF)
If WinActive('TextReaderYasmanyCurimilma') Then
Switch $hWnd
Case $hMainGUI
Local $tRIM = DllStructCreate($tagRAWINPUTMOUSE)
If _WinAPI_GetRawInputData($lParam, $tRIM, DllStructGetSize($tRIM), $RID_INPUT) Then
Local $iFlags = DllStructGetData($tRIM, 'Flags')
$iFlags = DllStructGetData($tRIM, 'ButtonFlags')
If BitAND($iFlags, BitOR($RI_MOUSE_LEFT_BUTTON_DOWN, $RI_MOUSE_LEFT_BUTTON_UP)) Then
Select
Case BitAND($iFlags, $RI_MOUSE_LEFT_BUTTON_DOWN);PRESIONADO ConsoleWrite("CLIC IZQUIERDO PRESIONADO" & @CRLF)
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$tPoint = _WinAPI_GetMousePos(True, $hMainGUI)
If DllStructGetData($tPoint, "Y") > $pos[1] And DllStructGetData($tPoint, "Y") <= $pos[1] + $pos[3] And DllStructGetData($tPoint, "X") > $pos[0] And DllStructGetData($tPoint, "X") <= $pos[0] + $pos[2] Then
$statusButton = 1
If GUICtrlGetState($sombra) = 96 Then
If GUICtrlGetState($resplandor) = 80 Then
GUICtrlSetState($resplandor, $GUI_HIDE)
EndIf
GUICtrlSetState($sombra, $GUI_HIDE)
Sleep(50)
GUICtrlSetState($sombra, $GUI_SHOW)
EndIf
EndIf
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Case BitAND($iFlags, $RI_MOUSE_LEFT_BUTTON_UP);LIBERADO ConsoleWrite("CLIC IZQUIERDO LIBERADO" & @CRLF)
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$tPoint = _WinAPI_GetMousePos(True, $hMainGUI)
If DllStructGetData($tPoint, "Y") > $pos[1] And DllStructGetData($tPoint, "Y") <= $pos[1] + $pos[3] And DllStructGetData($tPoint, "X") > $pos[0] And DllStructGetData($tPoint, "X") <= $pos[0] + $pos[2] Then
If $statusButton = 1 Then
$statusButton = ''
If GUICtrlGetState($btnVerde) = 96 Then
GUICtrlSetState($btnVerde, $GUI_SHOW)
GUICtrlSetData($status, 'Ejecutándose...')
GUICtrlSetData($lblIniciar, 'Iniciado...')
GUICtrlSetData($textoAyuda, 'El programa se ha iniciado, proceda a copiar cualquier texto legible para que TextReader dé lectura de ello.')
GUICtrlSetTip($btnAzul, 'Terminar')
GUICtrlSetColor($status, 0xa4f350)
If GUICtrlRead($btnInfo) = 'No Info' Then
GUICtrlSetData($btnInfo, 'I n f o')
$data1 = ''
$data2 = ''
EndIf
AdlibRegister('_detectando', 1000)
ElseIf GUICtrlGetState($btnVerde) = 80 Then
GUICtrlSetState($btnVerde, $GUI_HIDE)
GUICtrlSetData($status, 'Detenido')
GUICtrlSetColor($status, 0x868686)
AdlibUnRegister('_detectando')
_Voice_Stop()
GUICtrlSetData($lblIniciar, 'Finalizado')
GUICtrlSetData($textoAyuda, 'Se a terminado la ejecución.' & @CRLF & 'Para iniciar vuelva a presionar el botón de activación')
GUICtrlSetTip($btnAzul, 'Iniciar')
If GUICtrlRead($btnInfo) = 'No Info' Then
GUICtrlSetData($btnInfo, 'I n f o')
$data1 = ''
$data2 = ''
EndIf
EndIf
EndIf
Else
$statusButton = ''
If GUICtrlGetState($btnVerde) = 80 Then
;~ GUICtrlSetState($btnVerde, $GUI_HIDE)
EndIf
EndIf
GUICtrlSetState($sombra, $GUI_HIDE)
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EndSelect
EndIf
$tPoint = _WinAPI_GetMousePos(True, $hMainGUI)
If DllStructGetData($tPoint, "Y") > $pos[1] And DllStructGetData($tPoint, "Y") <= $pos[1] + $pos[3] And DllStructGetData($tPoint, "X") > $pos[0] And DllStructGetData($tPoint, "X") <= $pos[0] + $pos[2] Then
If GUICtrlGetState($resplandor) = 96 Then
If GUICtrlGetState($sombra) = 96 Then GUICtrlSetState($resplandor, $GUI_SHOW)
EndIf
Else
If GUICtrlGetState($resplandor) = 80 Then
GUICtrlSetState($resplandor, $GUI_HIDE)
EndIf
If $statusButton = '' Then
If GUICtrlGetState($sombra) = 80 Then
GUICtrlSetState($sombra, $GUI_HIDE)
EndIf
EndIf
EndIf
EndIf
EndSwitch
Return $GUI_RUNDEFMSG
EndIf
EndFunc ;==>WM_INPUT