
dleigh
Active Members-
Posts
22 -
Joined
-
Last visited
About dleigh
- Birthday 08/26/1961
Profile Information
-
Location
Alsace, France
-
WWW
http://david.leighweb.com
dleigh's Achievements

Seeker (1/7)
0
Reputation
-
Ok - edit of the situation. I found that I wasn't at the latest AutoIt version. I then updated to 3.3.8.1 and then it didn't work at all! I had updated to make the simplesort work in x64 but it broke my call to java. So I went and looked into the help file about x64 issues and found this piece of code: DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1) So I added it to my script. Now the java call works AND the simplesort works. Next step will be the compile and testing under 32 bit systems. So, we're good for now - more testing to do!
-
Hello - I've got a situation for which I'd like to get some insight from those more knowledgeable than I: I have an Autoit application that I deploy as an executable. I can be deployed (I hope) to any level of Windows (2K - 8) both 32 and 64 bit. I has a sub-component that is a java app (BaseX XML database). I develop on a Win 7 Pro 64bit machine. Just recently (last 4 months), I had not touched it since its last version and I started coding/testing again for another release. It no longer worked! I'd not changed the code but both the compiled and non-compiled versions now failed on my development machine. Banged my head for quite a while to figure out what the deal was! I finally narrowed it all down to: This command: Local $pid = run(@ComSpec & " /c " & "java -cp BaseX.jar org.basex.BaseXServer","C:\Users\David\DOCUME~1\OPENSO~3\TESTIN~1\OPENSO~1\BaseX",@SW_HIDE,$STDERR_MERGED) ;starts the basex server to facilitate queries worked when I commented out: #AutoIt3Wrapper_UseX64=n when it was NOT commented out (I had it uncommented to create 32bit executables for multi-architecture deployment) I received this message from the run command: 'java' is not recognized as an internal or external command, operable program or batch file. I've uninstalled ALL of java and then just reinstalled the most recent version to see what that would do - same behavior. I'm guessing that perhaps java, in more recent versions, has changed the way it is deployed for distinguishing between 32 and 64 bit machines. So it would appear that my tactic to develop and deploy as a single 32-bit application that would cover all 32 and 64 bit machines will no longer work. Is my only choice to create/use an installer that installs EITHER the 32 bit or 64 bit executable? Or is there some way to change my Run command such that it finds "java" no matter how it is intalled on my machine? Thanks!
-
PuTTY window management and keepalive
dleigh replied to doj's topic in AutoIt General Help and Support
I had to make a few changes to this to make it work for me: My PuTTY windows did not keep "PuTTY" in the title so nothing was being recognized. The looping of script was chewing up a bunch of CPU.For #1, I realized that for my sessions, I typically sudo in to Midnight Commander and stay there. So all my windows on different hosts have a title that begins "mc [root@" so I could use that as my title. Unfortunately, the variable holding the title is expected to have the value of "putty" so that it can also create an executable file name of "putty.exe". So I had to split the variable "$brand" into "$putty" and "$brand". For #2, I saw that the sleep function was not being used. So I added a sleep for the amount of time that the slider indicated. Now my machine makes no noise (no fan coming on when the CPU cranks up!). So, just minor changes. Here's my code: Opt('MustDeclareVars', 1) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <String.au3> #include <Process.au3> #cs putty switch puttyma.exe lists all putty sessions (appears with 5 empty buttons if none) switches to the one you like keeps them alive except the one just in foreground sends them all back updates GUI if you open more .... as soon as you put it in foreground PAUSE -KEY while pressed in an active putty session excludes single putty windows from keepalive by renaming to PUDDY and back best regards to the autoit community doj Version 0.2 premiere, functional missing: nothing Version 0.3 uploaded to forum with a little flaw (finds itself) Version 0.4 polished #ce Local $oldslid, $kalv, $phan, $ptxt, $pbtn, $guix, $knbx, $guiy, $knby, $var, $found, $foundnew, $i, $x, $n, $m, $y Local $gui, $stopb, $kpa, $kpat, $kpahx, $slider, $newguiy, $text, $message, $pbhan, $cexit, $sallb, $shall, $endit Local $palered, $pale, $white, $minguiy, $Version, $keepali, $hexcheck, $kpaltxt, $winpos, $myprog, $me $Version = "0.4" $me = " puttyma.exe" $myprog = $me & " Kurzwahl und keepalive J.Schoormann Version: " Global $putty = "PuTTY" Global $brand = "mc [root@" $keepali = 0 ;keepalive isn't checked $hexcheck = 0 ;and no hex stuff is entered $kpaltxt = "{ENTER}" ;keep alive sequence $oldslid = 180 ;initial keepalive counter at 3:00 min $kalv = $oldslid ;and exactly that it's the initial keepalivetime Dim $parr[300][5] ;manage up to 300 putty sessions -> turn this knob if you'd like more $phan = 1 ; index handle putty window $ptxt = 2 $pbtn = 3 ; corresponding btn in window !not! the handle (this might stay longer) $pbhan = 4 ; button handle (this might be renewed) ; latter has been deviced to keep the button for a putty session always on the same ; location in the GUI .. helps orientating while configuring Dim $winpos[4] = [400, 250, 870, 99] ; the the first two are needed to locate the position of the own gui for renewal ; means if anyone moved it, the new GUI will be placed at the new position $guix = 870 ; GUI <--------> $knbx = 167 ; button with $guiy = 0 ; vertical dimension of the GUI to begin with $knby = 20 ; button hight $minguiy = 99 ;minimal dimension needed for slide and keepalive stuff and end button $palered = 0xff7fff $pale = 0xbfbf7f $white = 0xFFFFFF HotKeySet("{PAUSE}", "toggleDD") $var = ProcessList($me) ;check if theres more than one instance of this program If $var[0][0] > 1 Then ;highlander principle "there can be but one" Exit EndIf While 1 If dran() Then ; are all putty windows known ? and kill all inactive or any containing error messages $var = WinList() $found = 0 ;any putty alife ? $foundnew = 0 ;new among them For $i = 1 To $var[0][0] If StringInStr($var[$i][0], $brand) And IsVisible($var[$i][1]) And isputty($var[$i][1]) Then If StringInStr($var[$i][0], "atal") Or StringInStr($var[$i][0], "inactive") Then ; inaktive win or one cntn error message WinKill($var[$i][1]) For $x = 1 To $parr[0][0] If $var[$i][1] = $parr[$x][$phan] Then ; remove all we knew about GUICtrlSetData($parr[$x][$pbhan], " ") $parr[$x][$ptxt] = " " $parr[$x][$phan] = 0 ExitLoop EndIf Next Else ;aktive putty win found $found = $found + 1 $foundnew = 1 For $x = 1 To $parr[0][0] If $var[$i][1] = $parr[$x][$phan] Then ; if its allready known $foundnew = 0 ExitLoop EndIf Next If $foundnew Then ;new one look for an empty place $y = 0 ;none found For $n = 1 To $parr[0][0] If $parr[$n][$phan] = 0 Then $parr[$n][$ptxt] = $var[$i][0] $parr[$n][$phan] = $var[$i][1] GUICtrlSetData($parr[$n][$pbhan], $var[$i][0]) $y = 1 ExitLoop EndIf Next If not ($y) Then $parr[0][0] = $parr[0][0] + 1 $parr[$parr[0][0]][$ptxt] = $var[$i][0] $parr[$parr[0][0]][$phan] = $var[$i][1] $guiy = 0 ;better check gui capacity EndIf EndIf EndIf EndIf Next If not ($found) And $guiy <> $minguiy Then ; no putty window left, remove gui and wait $parr[0][0] = 5 ; with 5 empty buttons $guiy = 0 Else For $i = 1 To $parr[0][0] ;single putties gone stealthily ? If $parr[$i][$phan] Then $found = 0 For $x = 1 To $var[0][0] If $var[$x][1] = $parr[$i][$phan] Then $found = 1 ExitLoop EndIf Next If Not $found Then GUICtrlSetData($parr[$i][$pbhan], " ") $parr[$i][$ptxt] = " " $parr[$i][$phan] = 0 EndIf EndIf Next EndIf $newguiy = Int(($parr[0][0] - 1) / 5) * ($knby + 2) + $minguiy ;if $parr[0][0] > 0 and $guiy < $newguiy then ; ______________________________a new gui is neccessary_________________________________ If $guiy < $newguiy Then If $gui Then $winpos = WinGetPos($myprog) ;set the new gui exactly at the old position GUIDelete($gui) EndIf $guiy = $newguiy $gui = GUICreate($myprog & $Version, 850, $guiy, $winpos[0], $winpos[1]) ;don't make it PuTTY .. it counts itself and will be included $kpa = GUICtrlCreateCheckbox("Keep Alive String", 10, 15) ;English : keep alive with If $keepali Then GUICtrlSetState(-1, $GUI_CHECKED) $kpat = GUICtrlCreateInput($kpaltxt, 140, 15, 150) $kpahx = GUICtrlCreateCheckbox("Hexadecimal", 310, 15) If $hexcheck Then GUICtrlSetState(-1, $GUI_CHECKED) $slider = GUICtrlCreateSlider(500, 22, 300, 22) GUICtrlSetLimit(-1, 600, 5) ; GUICtrlSetData($slider, $oldslid) GUICtrlCreateLabel(Int($oldslid / 60) & ":" & Mod($oldslid, 60), 650, 1) GUICtrlCreateLabel("10min", 805, 22) GUICtrlCreateLabel("5Sec", 470, 22) $n = 1 $y = 50 $x = 5 For $i = 1 To $parr[0][0] If $n = 6 Then $n = 1 $x = 5 $y = $y + $knby + 2 EndIf ;old btn context ought to be the same in the new gui look for previous context $text = " " $found = 0 For $z = 1 To $parr[0][0] If $parr[$z][$pbtn] = $i Then $parr[$z][$pbhan] = GUICtrlCreateButton($parr[$i][$ptxt], $x, $y, $knbx, $knby) $found = 1 ExitLoop EndIf Next If not ($found) Then For $z = 1 To $parr[0][0] If $parr[$z][$pbtn] = 0 Then $parr[$z][$pbhan] = GUICtrlCreateButton($parr[$i][$ptxt], $x, $y, $knbx, $knby) $parr[$z][$pbtn] = $z ExitLoop EndIf Next EndIf $x = $x + $knbx + 1 $n = $n + 1 Next $sallb = GUICtrlCreateButton("Minimize All", 174, $newguiy - 22, $knbx, $knby) GUICtrlSetBkColor(-1, $pale) $shall = GUICtrlCreateButton("Close All", 343, $newguiy - 22, $knbx, $knby) GUICtrlSetBkColor(-1, $pale) $endit = GUICtrlCreateButton("End", 710, $newguiy - 22, 100, $knby) GUICtrlSetColor(-1, $white) GUICtrlSetBkColor(-1, $palered) GUISetState() EndIf $message = GUIGetMsg() If $message = $GUI_EVENT_CLOSE Or $message = $endit Then ;_____________________________end it ______________________________________________ GUIDelete($gui) Exit EndIf For $i = 1 To $parr[0][0] ;__________________________________switch________________________________________________ If $message = $parr[$i][$pbhan] Then WinActivate($parr[$i][$phan]) EndIf Next If $message = $sallb Then ;_________________________________minimize all___________________________________________ For $n = 1 To $parr[0][0] If $parr[$n][$phan] And not (BitAND(16, WinGetState($parr[$n][$phan]))) Then WinSetState($parr[$n][$phan], "", @SW_MINIMIZE) Next EndIf If $message = $shall Then ;_________________________________kill all___________________________________________ For $n = 1 To $parr[0][0] If $parr[$n][$phan] Then WinKill($parr[$n][$phan]) $parr[$n][$phan] = 0 $parr[$n][$ptxt] = " " ;be aware...my User might just open a new putty session while I close all.. GUICtrlSetData($parr[$n][$pbhan], " ") EndIf Next EndIf EndIf ; ___________________________________keepalives___________________________________________ If GUICtrlRead($kpa) = $GUI_CHECKED Then $keepali = 1 Else ;we need this info while renewing the gui $keepali = 0 EndIf If GUICtrlRead($kpahx) = $GUI_CHECKED Then $hexcheck = 1 Else ;we need this info while renewing the gui $hexcheck = 0 EndIf $kpaltxt = GUICtrlRead($kpat) ;ditto $x = GUICtrlRead($slider) - $oldslid ;changes? $kalv = $kalv + $x ; new keepalive delta time $oldslid = GUICtrlRead($slider) If $x Then GUICtrlCreateLabel(Int($oldslid / 60) & ":" & StringRight("0" & String(Mod($oldslid, 60)), 2), 650, 1) ;show keepalive pause (min:sec) Sleep($oldslid) If $keepali And secs() > $kalv Then $y = WinGetHandle("[active]", "") $var = WinList() For $i = 1 To $var[0][0] If StringInStr($var[$i][0], $brand) And IsVisible($var[$i][1]) Then If StringInStr($var[$i][0], "atal") Or StringInStr($var[$i][0], "inactive") Then WinKill($var[$i][1]) Else If not ($var[$i][1] = $y) Then If $hexcheck Then ControlSend($var[$i][0], "", $var[$i][1], _HexToString($kpaltxt)) Else ControlSend($var[$i][0], "", $var[$i][1], $kpaltxt) EndIf EndIf EndIf EndIf Next $kalv = secs() + GUICtrlRead($slider) EndIf WEnd ;====================================================================================================================================================== Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible Func isputty($handle) If StringInStr(_ProcessGetName(WinGetProcess($handle)), $putty & ".exe") Then Return 1 Else Return 0 EndIf EndFunc ;==>isputty Func secs() return (@HOUR * 3600 + @MIN * 60 + @SEC) EndFunc ;==>secs Func dran() If Not WinExists($myprog) Then Return 1 return (BitAND(WinGetState($myprog), 8)) EndFunc ;==>dran Func toggleDD() Local $n $n = WinGetTitle("[active]") If StringInStr($n, $brand) Then WinSetTitle("[active]", "", StringRegExpReplace($n, "(T{2})", "DD")) Else If StringInStr($n, "PuDDY") Then WinSetTitle("[active]", "", StringRegExpReplace($n, "(D{2})", "TT")) EndIf EndIf Return 0 EndFunc ;==>toggleDD -
Related/similar problem (yes I know this is an old thread, but perhaps putting them together makes sense for the next guy/gal searching): I have a file that is produced with the DOS "sort" command and it's in codepage 850. No FileOpen choice seems to read it correctly. Does AutoIt have a way to deal with this or does someone else know a way to deal with either getting DOS (Windows 7 in this case) to output it differently or to convert it afterwards? Thank you!
-
Windows 7 compatibility - Au3Recorder
dleigh replied to Martineau's topic in AutoIt General Help and Support
Has anyone gotten this to work? It's an issue for me too. -
Yep, that fixed it! Thanks! I'll check out to see if it's mentioned in Bugtrack. That does bring up another point. I'm developing on an x64 system but I want to deploy as an .exe for use on both 32 and 64 bit systems. Do I need to do anything special to make sure that my .exe works on both types of systems?
-
Yep, that fixed it! I'll check out to see if it's mentioned in Bugtrack. That does bring up another point. I'm developing on an x64 system but I want to deploy as an .exe for use on both 32 and 64 bit systems. Do I need to do anything special to make sure that my .exe works on both types of systems?
-
I was wanting to put a listview column sort in my app. So I was trolling the excellent autoit help and found _GUICtrlListView_SimpleSort. Just what I need. So I thought I'd open the example script and run it. BUT, I can't get it to run! I'm on Windows 7 Pro x64 and when I run it I get the following in the execution log: >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Program Files (x86)\AutoIt3\Examples\Helpfile\_GUICtrlListView_SimpleSort.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams +>14:32:09 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0409 Keyboard:00000409 OS:WIN_7/ CPU:X64 OS:X64) >Running AU3Check (1.54.19.0) params:-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 from:C:\Program Files (x86)\AutoIt3 +>14:32:09 AU3Check ended.rc:0 >Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Program Files (x86)\AutoIt3\Examples\Helpfile\_GUICtrlListView_SimpleSort.au3" !=========================================================== +====================================================== -->Line(0061): $LVN_COLUMNCLICK --> hWndFrom: 0x00000000000A0D1C -->IDFrom: 3 -->Code: -108 -->Item: 0 -->SubItem: -1 -->NewState: 2 -->OldState: 0 -->Changed: 0 -->ActionX: 0 -->ActionY: 0 -->Param: 0 +====================================================== C:\Program Files (x86)\AutoIt3\Include\GuiListView.au3 (6769) : ==> Array variable subscript badly formatted.: $b_desc = $vDescending[$iCol] $b_desc = $vDescending[^ ERROR ->14:32:11 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 3.246 It runs great on an XP machine that I have. I even uninstalled autoit and scite and re-downloaded and installed them again but no dice. Always the same problem. I thought I'd take the WM_NOTIFY function and put it in my script anyway and just try and get it to work. It detects the column header click just fine, but the SubItem, which I believe is the indicator of which column was clicked is always -1. So, is there something that doesn't work on x64 (I checked to use it where ever possible on the installation)? Thanks!
-
Thank you SOOOOOO much for this. It's been a HUGE help to me!!!
-
Just tried to run the ToolBar for Any v2.2 setup and it died. Here's the Autoit error (painstakingly recopied): Line 0 (File "C:\Downloads\ToolBar For Any v2.2\ToolBar For Any v2.2 Setup.exe"); $oDest.CopyHere($oItems) $oDest.CopyHere($oItems)^ERROR Error: The request action with this object has failed. ************** Before this autoit error box, I got a windows error (that I'm translating from French) that said: Could not copy the file: The name of the file specified is invalid or too long. Specify a different file name. ***************** I really like the AutoIt version of SciTE but am always looking for ways it could be improved so I'm looking forward to trying your toolbar. Any suggestions for how to make it work? Thanks!
-
Well, in my case, I have all the priviledges necessary (I'm the admin) on both the Windows and Linux side. I tend to work most of the time on the Windows side and a lot with Autoit3 so I'd love to be able to query the DHCP server (DHCP3 running on Linux) via AutoIt3 running on Win2K Pro. I'm just fairly ignorant as to how...i.e. lower level programmatic interfaces. Humanly I have all the info I need...but of course I'm trying automate myself out of human work!
-
Does this mean that if the DHCP server is running on a Linux box, there is no way to query it from Windows?
-
Would this NOT work if the DHCP server is on a Linux box (i.e. Autoit3 on Windows querying the DHCP server on Linux)? Thanks!
-
I found some info and docs about it on this site http://www.macgyver.org/software/quickaccess.html
-
Keyboard macro while coding in SciTE
dleigh replied to dleigh's topic in AutoIt General Help and Support
Just for others' sakes, based on the forum topics recommended, I checked out filerx and eventcorder. Filerx does do macros, but not quite the way I wanted. Eventcorder, while you have to fiddle a bit with what you recorded to make it fast (by default it plays it back EXACTLY as you recorded it...at human speed), is basically just what I needed. I can recommend it for those seeking quick "coding automation". The free version does all I need and it never expires. Eventcorder: http://www.eventcorder.com