Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Include <File.au3>
- #Include <Array.au3>
- #include <GuiToolTip.au3>
- #include <WinAPI.au3>
- #include <GUIConstantsEx.au3>
- #include <FontConstants.au3>
- #include <SendMessage.au3>
- #include <WindowsConstants.au3>
- ;~ lista os arquivos no diretorio escolhido
- Global $FileList = _FileListToArray(@ScriptDir, "*.txt")
- ;~ caso não encontre exibe um erro
- If @Error = 1 Then
- BigToolTip("Não foram encontrados arquivos",2000,@DesktopWidth / 2 - 160,@DesktopHeight / 2 - 45,25)
- Exit
- EndIf
- If IsArray($FileList) Then
- ;~ nome do arquivo de saida
- $filename = 'out.txt'
- $fileout = @ScriptDir & '\' & $filename
- ;~ verifica se o arquivo já existe e o exclui
- if FileExists($fileout) then FileDelete($fileout)
- ;~ abre o arquivo para escrita
- $file = FileOpen($fileout, 1)
- ;~ faz um loop pelos arquivos encontrados
- for $i = 1 to $FileList[0]
- If $FileList[$i] = $filename Then
- Else
- $data = FileRead(@ScriptDir & "\" & $FileList[$i]) ; lê o arquivo encontrado
- $data = StringRegExpReplace($data, '</p><p>', "") ;remove os tgs html de paragrafo
- FileWrite($file, "~c -----" & StringReplace($FileList[$i], ".txt", "")& "-----" & @CRLF) ;usa o nome do arquivo como titulo, removendo o .txt
- FileWrite($file, $data & @CRLF) ;escreve o arquivo encontrado no arquivo de saida
- EndIf
- Next
- FileClose($file) ;fecha o arquivo de saida
- ShellExecute($fileout) ;abre o arquivo de saida
- Else
- BigToolTip("Não foram encontrados arquivos",2000,@DesktopWidth / 2 - 160,@DesktopHeight / 2 - 45,25)
- Exit
- EndIf
- #Region ### PopUp com fonte maior
- ;~ $btt_MSG = mensagem do popup
- ;~ $btt_Temp = tempo que a mensagem permanecerá em milisegundos
- ;~ $btt_Left = espaço da esquerda da tela
- ;~ $btt_Top = espaço do topo da tela
- ;~ $btt_Size = tamanho da fonte
- Func BigToolTip($btt_MSG,$btt_Temp=1000,$btt_Left=@DesktopWidth / 2,$btt_Top=@DesktopHeight / 2,$btt_Size=22)
- Local $hToolTip = _GUIToolTip_Create(0), $hDC = _WinAPI_GetDC(0)
- Local $hFont = _WinAPI_CreateFont($btt_Size, 0, 0, 0, 800, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Tahoma')
- Local $hOldFont = _WinAPI_SelectObject($hDC, $hFont)
- _SendMessage($hToolTip, $WM_SETFONT, $hFont, True)
- _GUIToolTip_AddTool($hToolTip, 0, $btt_MSG, 0, 0, 0, 0, 0, BitOR($TTF_TRACK, $TTF_ABSOLUTE)) ; <<<<<<<<<<<<<<<
- _GUIToolTip_TrackPosition($hToolTip, $btt_Left, $btt_Top)
- _GUIToolTip_TrackActivate($hToolTip, True, 0, 0)
- Sleep($btt_Temp)
- _GUIToolTip_Destroy($hToolTip)
- EndFunc
- #EndRegion ### END Koda GUI section ###
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement