14 posts in this topic
GUICtrlSetResizing and hidden window
I have to set a resizing mode to differents controls in a hidden gui, that gui is initialised (hidden) and resized by a WinMove.
But when i show it, control are not resized where thez should.
There is a simple code that reproduce the problem.
Same gui, same content, one displayed then moved, the other moved then displayed :
#include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Global $gui Global $labels Global $taille = [200, 100] For $i = 0 To UBound($gui, 1) - 1 $gui[$i] = GUICreate($i, $taille, $taille, $i * ($taille+100) + 500, (@DesktopHeight-$taille)/2) GUISetOnEvent($GUI_EVENT_CLOSE, "quit", $gui) $labels[$i] = GUICtrlCreateLabel("Test resizing...", $taille-105, $taille-25, 100, 20) GUICtrlSetBkColor($labels[$i], 0xE0E0E0) GUICtrlSetResizing($labels[$i], BitOR($GUI_DOCKRIGHT, $GUI_DOCKBOTTOM, $GUI_DOCKWIDTH, $GUI_DOCKHEIGHT)) Next GUISetState(@SW_SHOW, $gui) For $i = 0 To UBound($gui, 1) - 1 WinMove($gui[$i], "", Default, Default, $taille+100, $taille+100) Next GUISetState(@SW_SHOW, $gui) While(True) Sleep(10) WEnd Func quit() Exit EndFunc Is that a bug or do miss i something ?
EDIT : This bug disapear if gui is shown at lease one time (even if hide then)
Looped Array Out of Range (_Excel_RangeFind output)
Basically, my script needed a conditional assignment to a variable. It needed to check if the size of the array was valid before assigning any value to the variable.
So I've got a data entry task that I've been trying to automate. I actually have the script running, it cycles, draws it's necessary arrays, etc. But it will only cycle up to count #22, 23+ do not work.
I have two excel documents that I draw the data from. $aWO array has values from one of these documents. The instructions to draw these are under _at_wo().
This function feeds into another function to compare a derived value from the first file and request it's corresponding value. In order to do this, I used _Excel_RangeFind() (had to comment out the Cell Name and Cell Comment aspects of that function in order for it to work at all.) Then I pull the address information from array $aTracking, swap the column from A to B, and it works beautifully.
Then cycle 23 happens, and then $aTracking reports as out of range. Why?
Here's the code. Error reported from line #70. This array call works on loops 1-22 ($iCount value 0-21)
[Solved] SciTE no functions working
I updated to the last version. Since then a lot of functions are not working. For instance expanding abbreviation. My au3abbrev.properties are correct and abbrev.properties are including both import lines. The abbreviation is red but won't expand. Neither with space nor Ctrl+B.
Debug to msgbox and console not working, list functions, jump to function, open include too.
SciTE Jump works. Block and box comment too.
I have the feeling all functions especially for autoit are not working.
Any help? Regards, Conrad
Again WinHTTP and Proxy
I'm testing this code:
#include "WinHttp.au3" ; http://www.w3schools.com/php/demo_form_validation_escapechar.php $sUserName = "SomeUserName" $sEmail = "firstname.lastname@example.org" $sDomain = "www.w3schools.com" $sPage = "/php/demo_form_validation_escapechar.php" ; Data to send $sAdditionalData = "name=" & $sUserName & "&email=" & $sEmail ; Initialize and get session handle $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hOpen = ' & $hOpen & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ; Get connection handle $hConnect = _WinHttpConnect($hOpen, $sDomain) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hConnect = ' & $hConnect & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ; Make a request $hRequest = _WinHttpOpenRequest($hConnect, "POST", $sPage) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hRequest = ' & $hRequest & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ; Send it. Specify additional data to send too. This is required by the Google API: $hSendRequest = _WinHttpSendRequest($hRequest, "Content-Type: application/x-www-form-urlencoded", $sAdditionalData) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hSendRequest = ' & $hSendRequest & @CRLF & '>Error code: ' & @error & @TAB & "@extended: " & @extended & @CRLF) ;### Debug Console ; Wait for the response $hReceiveResponse = _WinHttpReceiveResponse($hRequest) ; See what's returned Dim $sReturned If _WinHttpQueryDataAvailable($hRequest) Then ; if there is data Do $sReturned &= _WinHttpReadData($hRequest) Until @error EndIf ; Close handles _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; See what's returned ConsoleWrite("Returned: " & $sReturned & @CRLF) But sending a request fails.
Console outputs this:
>Running:(126.96.36.199) ... --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop @@ Debug(14) : $hOpen = 0x00000000007DF540 >Error code: 0 @@ Debug(18) : $hConnect = 0x00000000008271C0 >Error code: 0 @@ Debug(22) : $hRequest = 0x00000000008B88E0 >Error code: 0 @@ Debug(26) : $hSendRequest = 0 >Error code: 1 @extended: 0 Returned: +>17:00:18 AutoIt3.exe ended.rc:0 +>17:00:18 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.6003 I'm testing it at work. There, we always have to identify at a proxy to be allowed to go to internet. But requests via inet.au3 will work. Maybe our firewall will block the request?
Any ideas? I don't have any possibilities to test at home, because of OSX.
[SOLVED]Count duplicates in an array
I just have a beginner question: is there a way to count duplicates in an array? If you don't see what I mean, here is an example of what I mean:
$arr = ['a', 'a', 'b', 'b', 'c'] ; the array countDuplicates($arr); Representing the data in a bidimensionnal array, this would return: #cs ['a'] ['b'] ['c'] Of course this is a bit messy, but that's just for you to get the idea #ce I'm trying to achieve this to check whether yes or no an array has more or same amount of occurrences of a character than another array.
Am I doing this the right way?
Does such a function exist?
Thanks for everything