
typhoon
Active Members-
Posts
30 -
Joined
-
Last visited
Everything posted by typhoon
-
GUI title bar is cut off when top=0
typhoon replied to typhoon's topic in AutoIt GUI Help and Support
I will give up on this for now, but for anyone who might run into the same issue, I found a reference here that seems to confirm that 7/Aero does something weird with window sizing. Border rendering is affected by left=0 too. -
GUI title bar is cut off when top=0
typhoon replied to typhoon's topic in AutoIt GUI Help and Support
This is happening on two different displays (same PC) for me. One is 16:10 AR, 1680x1050. The other is 4:3 AR, 1400x1050. Both are running Windows 7 (Aero). Attached image showing the following: 1. Maximized LibreOffice title bar (background) 2. Affected top=0 window (center) 3. Same script using top=4 (offset to the right) -
GUI title bar is cut off when top=0
typhoon replied to typhoon's topic in AutoIt GUI Help and Support
#include <GUIConstantsEx.au3> ConstructGUI() While 1 Sleep(500) WEnd Func ConstructGUI() Opt("GUIOnEventMode", 1) GUICreate("Clicker", 300, 104, -1, 0) GUISetOnEvent($GUI_EVENT_CLOSE, "OnClose") GUISetState() EndFunc Func OnClose() Exit EndFunc I cut down the script to this basic sample and it still happens. -
If I create any GUI window with top=0, part of the title bar will be cut off from the desktop. Of course I can specify a nonzero top value to push the window down but I expected AutoIt/WinAPI to compensate for the title bar automatically. I'm not sure if the necessary and sufficient top value is consistent across different versions/skins of Windows, so how would I code this dynamically without knowing what the script is running on?
-
If I use WinActivate() with Firefox, it seems to change to the newest created tab automatically. Sometimes. Does the WinTitleMatchMode setting have something to do with it? Here is the relevant code fragment. $title = "Mozilla Firefox" Opt("WinTitleMatchMode", 2) $x = 1287 $y = 900 WinActivate($title) For $i = 0 To 11 MouseClick("left", $x, $y) Sleep(5000) Next
-
I need to be able to distinguish between multiple instances of the same program running, based on how long they've been running, and without having to rely on an already-running script to monitor them. Is this possible? I am currently able to use WinList to get all the window handles, but no way to sort them by age or even to return the list in a consistent order (the same windows will come back in a different order on each call of WinList).
-
ReDim seems to have an issue if the array is modified during the ReDim. It does not produce any error when doing so, and there is also nothing in the ReDim documentation that warns against this. Can someone explain whether this is intended? Global $a[1] $a[0] = 10 ; This code produces unexpected results ReDim $a[NewSize()] ; 20 is returned after assigning $a[0] new value in function, can verify with UBound MsgBox(0, "result", $a[0]) ; however, the stored value after ReDim remains at 10 ; This code produces the expected result ;NewSize() ;MsgBox(0, "result", $a[0]) ; stored value is 20 Func NewSize() $a[0] = 20 Return $a[0] EndFunc
-
Ah, probably should have mentioned this earlier but I was using fsutil. We were just migrated from XP to 7 and it seems to cause headaches with privilege levels (the command has to be run as administrator even if you're already an admin). The functions that kylomas (or guinness!) provided do the job nicely. Thanks guys.
-
Does AutoIt have a mechanism for setting a file's size without having to actually write out the data? Assume that I want to generate a dummy file of large size, and do not want to wait to write zeroes.
-
I read in a file to $buffer, and then I try using StringRegExp on it. This works fine with a pure text file, but if the file is binary (with some clear text) the function seems to return prematurely (but without error). Specifically, for the file I'm reading in it only captures one match. $array = StringRegExp($buffer, "path\d*:", 3) I tried using binary mode with FileOpen, but in that case I get an invalid result code from StringRegExp. I've tested the same code using a file that consists of only plain text; in that case it works.
-
Is there an AutoIt implementation of the CRC32 used in zip files? Or a general-purpose CRC32 algorithm that can be seeded with the magic number?
-
Is there an easy way to read a word/dword value from a file (after opening in binary mode)? It is stored in little-endian so Dec() won't work correctly.
-
All I get from the output window is this: >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "E:\projects\AutoIt\filewriter\test.au3" $binWrite = 0xFEDCBA9876543210FEDCBA9876543210 $binRead = >Exit code: 0 Time: 0.210 However, there are no errors at least. I am using Win2k btw. The Help File does contain the Binary() function, the splash page shows that it is the latest version. The AutoUpdate also says I have the latest version.
-
That's odd. When I try your script I get an error that Binary() is an unknown function. I just installed the current version of AutoIt (fresh, on a new system). Is some kind of include needed for that?
-
I might be using the flags in FileOpen incorrectly, or maybe there is a problem with them. I am choosing 16 for binary read and 17 for binary write. This returns an error for any file that I try to open.
-
I am using FileFindFirstFile, but this only returns a handle rather than a filename. I don't see any functions that can return the filename.
-
Just to make sure I am doing things right, where do I need to set AutoIt options when using the DLL? For example, if I am not using defaults for PixelCoordMode, and I have various classes and functions using PixelChecksum(), where and how often in my code do I need to call the Opt() function?
-
Ok, well it seems that after drawing to the control (after showing the initial state), it still fails to refresh automatically unless the window is clicked off. I am drawing Pixels if that makes any difference.
-
In the Help file, under Variables, all of the Array examples begin iteration at [1].
-
In testing, it seems that arrays are 0-based, but the examples in the docs seem to imply that they are 1-based. Can someone clarify? Here's an example dim $LABEL_TEXT[4] = ["left", "right", "top", "bottom"] for $i = 1 to 4 MsgBox(0, "note", $LABEL_TEXT[$i]) GUICtrlCreateLabel($LABEL_TEXT[$i], 2 * ($i - 1) * $CELL_WIDTH, 0) next I am expecting it to iterate from [1] to [4] but it starts with the second value and ends with an out-of-bounds error. So I assume the arrays are actually 0-based despite the examples using [1] as the starting point?
-
Huh. After playing around with it a bit, it seems like the problem was that I was showing the main GUI window before adding the Graphic control (adding it before showing the main window makes it ok, I guess because there is an implicit repaint). Strange though, because I also added Input controls after showing the main window and they show up without needing a manual refresh. Seems like this is varying from one control to another.
-
$graphic = GUICtrlCreateGraphic(0, 0, 100, 100) GUICtrlSetBkColor($graphic, 0xffffff) while 1 ; main loop wend So, what happens is that I just want the background color to show up (to highlight the graphic box from the rest of the gray window). This doesn't happen when the script runs, only when I click off and then back onto the script gui.
-
When I use the Graphic control, nothing shows up unless I click off the window and then click back to it. Are manual refreshes necessary to make graphics show up while having the script gui on top?
-
I traced the program and the $card variable is not the issue. The array is fine (StringSplit worked). The last If statement would generate a subscript error if it didn't have the array values. The problem is that, when the If statement fails naturally, as per the logic, the function should simply end, returning the default value of 0. But somehow, instead of returning 0 it is returning 1. I have noticed the difference between it returning 0 and returning 1 is whether or not it reaches the 3rd test in the If statement. If it fails before then, the function returns 0. The trace is like this: everything up to the last If statement works as expected. The If statement tests 3 conditions. The first 2 conditions will pass, but the 3rd condition fails. The If block is skipped ($card is not returned), so the function ends, and returns 1 (but it should return 0). This 1 is simply coming from nowhere, except that I think some mechanism in the language is storing this 1 from the call to IsFoil(), because IsFoil will return $TRUE (which I defined equal to 1). I don't think this is the intended behavior and I now suspect that this is actually an AutoIt bug. Unless someone can offer a better explanation, that's where it stands with me now. EDIT: confirmed bug. I changed the value of $TRUE to 5, and now it returns 5. I don't see how the logic would allow for this. Or perhaps what is happening is that the Return from the IsFoil() function is being passed as the Return for GetCard()? Is that supposed to happen?