Jump to content

TheDcoder

Active Members
  • Posts

    7,103
  • Joined

  • Days Won

    88

Everything posted by TheDcoder

  1. @Melba23 ? This is the result for me without the MsgBox: http://share.pho.to/9daMa/38/original
  2. Man o man, I hate RichEdits! , I have this code: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiRichEdit.au3> #include <Color.au3> Local $iPID = Run(@ComSpec & " /c " & 'ping -n 7 127.0.0.1', "", @SW_HIDE, 0x8) Local $aGrayCmdColor[3] = [197, 197, 197] Local $iGrayCmdColor = _ColorSetCOLORREF($aGrayCmdColor) Local $iLine = 1 $hGUI = GUICreate("", 500, 300, -1, -1, $WS_POPUP) $idRichEdit = _GUICtrlRichEdit_Create($hGUI, "", 0, 0, 500, 300, BitOR($WS_HSCROLL, $WS_HSCROLL, $ES_MULTILINE, $ES_READONLY)) _GUICtrlRichEdit_SetBkColor($idRichEdit, 0x000000) _GUICtrlRichEdit_SetFont($idRichEdit, Default, "Fixedsys") _GUICtrlRichEdit_SetCharColor($idRichEdit, $iGrayCmdColor) MsgBox(0, 0, @error) ; <---- Comment this to reveal the bug! If @error Then MsgBox(0, 0, 0) GUISetState(@SW_SHOW, $hGUI) While ProcessExists($iPID) $sOutput = StdoutRead($iPID) _GUICtrlRichEdit_AppendText($idRichEdit, $sOutput) If StringLeft($sOutput, 2) = @CRLF Or StringRight($sOutput, 2) = @CRLF Then $iLine += 1 $iStartingPoint = _GUICtrlRichEdit_GetTextLength($idRichEdit, True, True) - StringLen(_GUICtrlRichEdit_GetTextInLine($idRichEdit, $iLine)) _GUICtrlRichEdit_SetSel($idRichEdit, $iStartingPoint, -1, True) _GUICtrlRichEdit_SetFont($idRichEdit, Default, "Fixedsys") _GUICtrlRichEdit_SetCharColor($idRichEdit, $iGrayCmdColor) EndIf Sleep(250) WEnd _GUICtrlRichEdit_AppendText($idRichEdit, StdoutRead($iPID)) _GUICtrlRichEdit_AppendText($idRichEdit, @CRLF & @CRLF & "Debug Complete!") Sleep(1000 * 3) ExitWhen I remove the MsgBox line, some of the text does not get coloured , What in the world can I do to make it work without the help of the MsgBox? Thanks in Advance, TD
  3. TheDcoder

    Haskell

    Translato: Bizarre World: FINALLY After much hair pulling forehead smashing and crying I finally ?????? up this haskell program that takes a sentence that the user enters and then reverses the inner letters of each word I used a proprietary language which is used in a proprietary system to translate it back into English... That system is homo sapian and the lagauage is homo sapianian I think... TD
  4. @Manadar Wow, its like using [iRed, iGreen, iBlue] in parameters in python, Thanks! What will happen if that parameter is ByRef? , Experiment time , Results: Works TD
  5. @clicked Oh , Thanks for the valuable intel! TD
  6. @czardas Oh @guinness But the array gets deleted when the function returns
  7. @guinness I think its an overkill to create an array to get the colorref color :-/
  8. Wastage of memory & an extra line
  9. @RaiNote & @gruntydatsun , For some reason the last % was not copied. Fixed now Thanks! It still does not work... TD
  10. @BrewManNH We need to type an extra line for this: $aColor[3] = [1, 2, 3]TD
  11. Wow, Short & Simple, I learn what DllStruct are in 10 mins , TD P.S I tried to learn the same thing in 2014 but It was freaking hard then, lol
  12. @BrewManNH What about the extra array declaration?
  13. Hello, I am a little confused why most of the Functions in Color.au3 use arrays to get color values ? I think its burden to create an array every time if you want something like a COLORREF value, Lets take _ColorSetCOLORREF as an example, I modified the function to take normal parameters instead of an array: Func _ColorSetCOLORREF($iRed, $iGreen, $iBlue, Const $_iCurrentExtended = @extended) Local $aColor[3] = [$iRed, $iGreen, $iBlue] ; Replaced the array check with an array declaration Local $iColor = 0, $iColorI For $i = 2 To 0 Step -1 $iColor = BitShift($iColor, -8) $iColorI = $aColor[$i] If $iColorI < 0 Or $iColorI > 255 Then Return SetError(2, $i, -1) ; invalid color value $iColor += $iColorI Next Return SetExtended($_iCurrentExtended, $iColor) EndFunc ;==>_ColorSetCOLORREFIt works fine & the array gets deleted when the function returns, so a Win-Win for me... Is there any special reason about accepting an array instead of individual parameters ? Thanks in Advance, TD
  14. Sometimes the title is not what you see on the monitor Please provide us with more details & your progress on code so we can help you , here is a similar question I found on this forum: https://www.autoitscript.com/forum/topic/114062-citrix-transparent-window/ TD
  15. @computergroove That's used to simulate... keyboard input in any application, also it will not work when the window is hidden and the output stream is redirected, TD
  16. @computergroove I think its clear, I am trying to simulate user input in a console application, Like typing something in a command
  17. speeling mistakes, good script at 1st attempt TD
  18. Gah! Paste this in your script: Global $sConsoleOutput = "" Func MyConsoleWrite($sOutput) If @Compiled Then $sConsoleOutput = $sOutput & @CRLF Else ConsoleWrite($sOutput) EndIf EndFuncUse MyConsoleWrite instead of ConsoleWrite, To read the output then call MsgBox like this: MsgBox(0, "Console Output", $sConsoleOutput) You can look at the Debug UDF which is shipped with AutoIt by default, (Helpfile -> User Defined Functions Reference -> Debug Managment) TD
  19. Hello , I am trying simulate user input in console apps, so far this is what I have tried: #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $iPID = Run("test.bat", "", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($iPID, "Banana") Local $sOutput = "" ; Store the output of StdoutRead to a variable. While 1 $sOutput &= StdoutRead($iPID) ; Read the Stdout stream of the PID returned by Run. If @error Then ; Exit the loop if the process closes or StdoutRead returns an error. ExitLoop EndIf WEnd MsgBox($MB_SYSTEMMODAL, "", "The output string is: " & @CRLF & $sOutput) EndFunc ;==>ExampleCode for test.bat: @echo off set /p var = "Input Var: " echo This is the var: %var% I can't write "Banana" when the the bat script prompts for input , I can't find any solution on the WWW for this... Thanks in Advance, TD
  20. Wow, a double resurrected thread
  21. If you are using another program to check your program, then you can simply hash check using _Crypt_HashFile, TD
  22. Please don't remove your code after solving the problem, the code helps other user solve their problem based on your answer
×
×
  • Create New...