Jump to content

Sokko

Active Members
  • Posts

    238
  • Joined

  • Last visited

Sokko's Achievements

Polymath

Polymath (5/7)

1

Reputation

  1. Incidentally, the reason you observed this only with password fields is that by setting $ES_PASSWORD as the style, you are overriding the default style for input boxes, which is a combination of styles that includes $ES_AUTOHSCROLL. The help file will tell you what the default styles are for all controls, if you need to find out.
  2. The reason for the listbox resizing is that by default, the height of a listbox is locked to a multiple of the height of a single item. You need to add the $LBS_NOINTEGRALHEIGHT style to make it behave otherwise. As for your resizing, try this: GUICtrlSetResizing($chatrcv,$GUI_DOCKBORDERS) GUICtrlSetResizing($nicklist,$GUI_DOCKWIDTH+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) GUICtrlSetResizing($chinputbox,$GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT+$GUI_DOCKLEFT+$GUI_DOCKRIGHT) GUICtrlSetResizing($chsendbtn,$GUI_DOCKSIZE+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM) While testing this, I ran into something strange: The controls seem to resize in discrete steps, a few pixels at a time, instead of continuously. Maybe a bug, maybe not. Anyone observed this before?
  3. It's 0 to 9, not 1 to 9. Both $ and \ are valid for back-references in StringRegExpReplace and they are both documented in the parameters section. In this case you have only one group in the pattern, so 0 is the only back-reference that makes sense. (EDIT: Forum eats backslash-zero)
  4. With Java you are flying blind all the way. Jon (one of the developers and the creator of AutoIt) recently described a Java application window as "a total black box". I'm sure someone will find a way eventually, but it might be pretty far down the line.
  5. Reverse your thinking. Instead of trying to remove the last group, capture everything except the last group with another group. $aRegex = StringRegExp($sLogText, "(Date (.*?)\r\nStart " & $sSearchText & "\r\n((?:.|\r\n)*?))(?:\r\nDate|\z)", 2) This shifts the return values around a bit: $aRegex now has indexes from 0 to 3 (the new captured group is index 1). It's not actually possible to exclude the trailing Date from the full match. Your problem is that the sequence you're trying to capture has no definite terminator that resides within the block. The only way to see whether you've reached the end of the sequence is to step outside it. Blame the designer of the file format.
  6. You're putting $ES_PASSWORD in the extended style parameter, instead of the style parameter.
  7. You can include quotes in a string parameter of a function call in two different ways. Double them up: ConsoleWrite("This is an example of ""quotes"" used in a string.")oÝ÷ ÙK²)àꮢ׬¶§rZ,zØ^²Úâ®¶­sd6öç6öÆUw&FRb33µF22âWׯRöbgV÷C·V÷FW2gV÷C²W6VBâ7G&ærâb33² Keep in mind that if you use single quotes to enclose the string, you need to double those up if you want to use them inside the string.
  8. Did my code work for the file you have? This has quickly dropped down to page 5 so I figured you might have missed the reply.
  9. Better/shorter/simpler is what regular expressions are all about. I tested this code on the data you posted so it should work fine, assuming the entire file looks like that. Any questions? $aRegex = StringRegExp($sLogText, "Date (.*?)\r\nStart " & $sSearchText & "\r\n((?:.|\r\n)*?)\r\n\r\n", 2) If a matching block is found, $aRegex is an array: $aRegex[0] contains the entire matching block (from "Date" up to and including the blank line) $aRegex[1] contains the date of the block ("04.06.2007 13:20") $aRegex[2] contains the text of the block ("lots of text in lots of lines") In addition, @extended contains the offset of the character in $sLogText that immediately follows the matching block, so you can trim the string and try again to get another match. If a matching block is not found, @error is set to 1 and $aRegex is NOT an array (so make sure you check that first).
  10. Actually, that did help me out, thanks Smoke! Once I knew what I was looking for, it was easy to rewrite the example to use EN_SETFOCUS instead of EN_CHANGE. It works fine, but it really shouldn't be this hard...
  11. What is "it"? I tried clicking and tabbing all over the place but the function never executed.
  12. I would suggest that there is a problem with the particular icon files you're using. I have compiled a test script with an icon that goes up to 256x256 and Vista has no problem with it. If the icons are your own, whatever software you are using to create them isn't doing it correctly.
  13. Already tried it. ControlGetFocus gives you back a ClassNameNN (or HWND with ControlGetHandle), but I need an AutoIt control ID as returned by a GUICtrlCreate function.
  14. I could have sworn I did this once before, but I'm blanking on the exact method, and twenty-odd forum searches turned up nothing. I need a way to tell when the input focus on my GUI changes (from one control to another), and when it does, I need to find out which control currently has the focus. Any suggestions?
  15. Modern 3D-accelerated video games can be somewhat resistant to automation. Either as a side-effect of the way they are programmed, or intentionally because the developers don't want you doing it. If your code works outside the game (e.g. in Notepad) but not inside, there's a good chance you've run into a brick wall. On a different tack, the help file notes that using a value of 0 for SendKeyDelay sometimes doesn't work properly. Have you tried setting it to 1? Also try sending the two keys in one command, like "{1 DOWN}{2 DOWN}".
×
×
  • Create New...