-
Posts
37 -
Joined
-
Last visited
Everything posted by Max Kipness
-
_GUICtrlRichEdit and button focus
Max Kipness replied to Max Kipness's topic in AutoIt General Help and Support
That worked beautifully. Thanks. -
Hi, In an app I've created I recently I switched from GUICtrlCreateEdit to _GUICtrlRichEdit_Create so I could create bolding, italics on only certain characters in the edit screen. My problem is that I have a B and I button for bold and italic that steal focus. Previously with the standard edit control, when i hit the bold or italic buttons, the focus stayed on the edit control without me having to do anything. But now with _GUICtrlRichEdit_Create, when I click on the bold or italic buttons, those buttons steal the focus. Each of those buttons runs a separate function, but I can't figure out how to return the focus via the functions as GUICtrlSetState($edit,$GUI_FOCUS) doesn't seem to work for this control. Anyone have any ideas of how to fix this? Is there some type of set state command for richedit that I'm missing? Thanks in advance. Max
-
Save clipboard image to jpg file
Max Kipness replied to Max Kipness's topic in AutoIt General Help and Support
Thanks Malkey, your second snippet of code included the function that works. I'm not interested in getting screenshots, but rather wanted to get ANY image that might be in the clipboard. So it worked. Thanks again. -
Hi, Been searching around the forums and found a couple of snippets that other's claim works, but it doesn't seem to be working for me. I'm basically wanting to be able to copy and image to clipboard, or via the snipping tool in Windows 7 and then click a button that saves this to a file so I could do some further processing with it. Here is what I have.\ #include <GUIConstantsEx.au3> #Include <GDIPlus.au3> #include <ClipBoard.au3> #include <ScreenCapture.au3> _Main() Func _Main() Local $hBmp ; Capture full screen $hBmp = _ClipBoard_GetDataEx ($CF_BITMAP ) ; Save bitmap to file _ScreenCapture_SaveImage (@MyDocumentsDir & "\Image.jpg", $hBmp) EndFunc ;==>_Main Can someone please point me in the right direction. Thanks, Max
-
I've got a program that needs to download an xml file from http://rss.cnn.com/services/podcasting/newscast/rss.xml. I'm using inetget in this fashion: $dl_success1 = InetGet("http://rss.cnn.com/services/podcasting/newscast/rss.xml",@ScriptDir & "\" & "test" & ".xml",1) It seems like it used to work, but now I'm getting the same file over and over from 6/11/08. If I download this file manually using PHP and wget it shows the correct file from today 6/16/08. If I use IE 7 directly, I get the correct file from today, 6/16/08. But if I run the AutoIT script with the above command, the file has contents pointing to 6/11/08. Is this being cached somehow? If so, where? Does adding the 1 possibly not work and it's not trying to get a new version? I've tried rebooting, deleting temp files/cache from IE, etc. Any help would be appreciated. Thanks, Max
-
Hi - Does anybody happen to have this UnixTime.zip file. I need to convert a unix time/date stamp to a string date. The link that was posted in 2006 doesn't seem to work anymore. Thanks, Max
-
You know what, as I was watching you and the other guy go back an forth I never noticed your little snippet of code. I will try it and hopefully it will work for what I need. Thanks, Max
-
Cool, thanks. That makes it much easier to read. So, again this is the results from the PHP xml to array function. Works on any xml code you can throw at it. My opinion is that it's easiest to work with the data once it's in this format as it's easy to loop through the data. Max Array ( [make] => Array ( [0] => Array ( [@attributes] => Array ( [name] => Toyota ) [model] => Array ( [0] => Array ( [@attributes] => Array ( [name] => MR2 ) [year] => Array ( [0] => Array ( [@attributes] => Array ( [start] => 1991 [end] => 1995 [filename] => SWF\TOYOTA_MR2_1991-1995.swf ) ) [1] => Array ( [@attributes] => Array ( [start] => 1999 [end] => 2007 ) ) ) ) [1] => Array ( [@attributes] => Array ( [name] => Supra ) ) ) ) [1] => Array ( [@attributes] => Array ( [name] => Ford ) [model] => Array ( [0] => Array ( [@attributes] => Array ( [name] => Mustang ) [year] => Array ( [@attributes] => Array ( [start] => 2006 [end] => 2009 [filename] => SWF\FORD_MUSTANG_2006-2009.swf ) ) ) [1] => Array ( [@attributes] => Array ( [name] => GT ) ) ) ) [2] => Array ( [@attributes] => Array ( [name] => Chevrolet ) [model] => Array ( [0] => Array ( [@attributes] => Array ( [name] => Corvette ) ) [1] => Array ( [@attributes] => Array ( [name] => Cobalt ) ) ) ) ) )
-
The XML code posted by Weaponx is a good starting point. I'm just looking for something that works on any generic xml code. As I stated I use something similar in PHP. Just throw any PHP code to it, and it creates an array. Here are the results from running Weaponx's code through my PHP parser. Sorry, but unfortunately when you post here, it flattens out all the tab spacing, so everything is left justified and hard to read. I've now played around with the XML UDF a bit and was able to extract some of the data, but it just seems like this type of approach is easier?? Array ( [make] => Array ( [0] => Array ( [@attributes] => Array ( [name] => Toyota ) [model] => Array ( [0] => Array ( [@attributes] => Array ( [name] => MR2 ) [year] => Array ( [0] => Array ( [@attributes] => Array ( [start] => 1991 [end] => 1995 [filename] => SWF\TOYOTA_MR2_1991-1995.swf ) ) [1] => Array ( [@attributes] => Array ( [start] => 1999 [end] => 2007 ) ) ) ) [1] => Array ( [@attributes] => Array ( [name] => Supra ) ) ) ) [1] => Array ( [@attributes] => Array ( [name] => Ford ) [model] => Array ( [0] => Array ( [@attributes] => Array ( [name] => Mustang ) [year] => Array ( [@attributes] => Array ( [start] => 2006 [end] => 2009 [filename] => SWF\FORD_MUSTANG_2006-2009.swf ) ) ) [1] => Array ( [@attributes] => Array ( [name] => GT ) ) ) ) [2] => Array ( [@attributes] => Array ( [name] => Chevrolet ) [model] => Array ( [0] => Array ( [@attributes] => Array ( [name] => Corvette ) ) [1] => Array ( [@attributes] => Array ( [name] => Cobalt ) ) ) ) ) )
-
Hello, does anyone know of a simple XML to Array function? I know there is an XML UDF out there and I've looked at it, but it appears to be very complex. I really just want to pull all data out into an associative array like the many XML2Array PHP scripts out there. Or is there an easy way to do this with the XML udf? Thanks, Max
-
Optimize Compiled Script
Max Kipness replied to Max Kipness's topic in AutoIt General Help and Support
Update: Just removed all the lines and comments as I had a space after almost every line and comment everyting (I'm a neat coder). This knocked off 200k roughly as the size is now 508k. Anything else I can do? Max -
Hello - I've been looking through old posts about optimizing code, and have seen some mention of programs like cleanscript and some pre-processor. These appear to clean up comments, remove functions, etc. I basically have a small script, really a wrapper for another executable which has NO includes and totals about 20 lines of code. Really very simple, no file includes, etc. Yet, when compiled, the size is 766kb. Are there any tricks to reduce this in size? Uncompiled the size is 1kb. Thanks, Max
-
Problem with socket connect to AIX
Max Kipness replied to Max Kipness's topic in AutoIt General Help and Support
Anybody have any info on this? After doing some more experimenting, it almost seems like the TCP socket support in AutoIT is not really robust. What I'm basically needing to do is telnet to aix to issue commands based on commands received. As I described below, I can't even get to the command prompt with AIX. Max -
I'm having an issue when trying to connect via port 23 (Telnet) to an AIX system. When connecting to a linux server or a Cisco router, it seems to work fine sending back a login prompt, but when connecting to an AIX server, I get only the following back "ÿþ%ÿý" and nothing else. Sending extra data does nothing, and I've tried issuing both a carriage return and line feed. If I simply drop to a command prompt in XP and type telnet 192.168.0.5, it also works fine returning the AIX server identification, asking for login, etc. Here is the basic code (generic) that I'm using to test. TCPStartup() $socket = TCPConnect("192.168.0.5",23) If $socket = -1 Then msgbox(16,"Error","Could not connect to Telnet Server") Exit Endif While 1 $recv = TCPRecv($socket,2048) TCPSend($socket,@LF) TCPSend($socket,@CR) ConsoleWrite("Received: " & $recv & @LF) sleep(1000) Wend Again, this is just test code to see what I might possibly send to the AIX server to get it to send the proper login prompt string back. When run and allowed to loop several times I get: Received: Received: ÿþ%ÿý Received: Received: Received: Received: But from the XP command prompt I get: telnet (xxx_Corp) telnetd: failed to write to /var/adm/wtmp: A file or directory in the path name does not exist. AIX Version 5 © Copyrights by IBM and by others 1982, 2005. login: As a side note, I'm able to get PHP's fsock commands working with the AIX server just fine, but I need this connection to be made from AutoIT in this case. I will need to actually login to the server, issue command, etc. I think I can handle all of this if I could get past this one issue. Could this be a terminal type problem? I don't see any other options for connecting to the socket or send data to the socket. Is there any way I can get this working? Thanks, Max
-
listview scrolling to right?
Max Kipness replied to Max Kipness's topic in AutoIt GUI Help and Support
Thanks. I was just noticing that in the help file. But now in report style, I have to figure out how to get the column widths wide enough for the text in this field. Padding with spaces only works to a certain width. I guess there is a UDF control for width. Thanks again. Max -
listview scrolling to right?
Max Kipness replied to Max Kipness's topic in AutoIt GUI Help and Support
That puts it back at default for listview. I don't want the column header bar at all. I want a basic list, I just want the ability to have an icon at the beginning of each line. Any other ideas? Max -
I'm trying to create a listview that looks like a list just for the purpose of having an icon image at the beginning of each line. However, now that I have it looking they way I want, when the list fills up vertically, instead of adding a new line below and adding scroll bars on the right side, it's adding the new line to the right and adding scrollbars on the bottom (horizontally). Anybody know why? Here is the relevant code: ; Creating the listview with options $statuslist = GUICtrlCreateListView("",20,270,560,80,$WS_EX_WINDOWEDGE+$LVS_LIST) ; Adding to the listview GUICtrlCreateListViewItem(_NowTime(3) & " Line one, blah, blah...."$statuslist) GUICtrlSetImage(-1,"icons.icl",0) My program of course loops through and creates multiple lines, but again once the listview box fills up vertically, it adds content horizontally (or to the right) instead of continuing downward. Hopefully this makes sense. Any suggestions? Again I don't need columns, but am using listview instead of the standard list, to have an icon at the beginning of each line. Thanks, Max
-
stdoutread status gui without io blocking
Max Kipness replied to Max Kipness's topic in AutoIt General Help and Support
Thanks a bunch... After reviewing your code, it seems like the one statement that made the difference is: If StdoutRead($pid, 0, 1) Then $stream = StdoutRead($pid) So basically, do not read stderr unless by peaking, something appears to be there. That line should be added to the docs as that seems to prevent the IO blocking. Max -
I'm trying to figure out the best approach to creating a live status gui that is fed from a constant stdoutread while maintaining the ability to use controls, mainly a cancel button. For this example I'm trying to create an alternate gui for clamscan.exe. However, this is applicable to any command line program that constantly produces output to stdout/err. As documented in the help file, when using stdoutread with no options, when the stream pauses (as most do), the application freezes until the stream starts getting data again. This is obviously undesirable in all situations most likely as the user will sometimes think the entire application has failed as sometime the gui turns white at the top, or will report the 'application not responding' error. I thought at first the peak option for stdoutread might be the answer, but after working with it, although it seems to prevent the io blocking, it seems that every time it 'peaks' it gets the entire stream. I do not see any way of clearing the stream (which would give me the answer to this problem). So when dealing with a large amount of streaming data, the program would eventually crash after too much data was buffered. So I came up with this idea using the other option of stdoutread that reads the number of characters available in the stream, compares it to last number of characters in the stream in the previous loop, and if changed, engages the default stdoutread option which actually only reads what is in the stream since the last read(rather than what has been in the stream since the beginning). Although it works better, it still freezes once in a while. Also, my desire was to have it always display just the last file that was scanned, but it seems that the stream outputs so fast that by the time the controls are filled in the gui and the loop comes back around there are several lines (files) in the stream and they all get displayed (thus the reason I have a vertically long label). I suppose I can do a string split on @LF and just get the last line in the stream. So my question is whether anyone has dealt with this situation and has a more efficient approach for this process. Like I said above, if there was some way to peak at the stream all the time, but clear the stream afterwards, that would fix this type of problem. If interested in trying this with ClamWin, go to www.clamwin.org. I simply created the AutoIT script in the same dir in which it was installed by default. Oh, and if there is some ridiculously easy answer to this that I just missed, my apologies for wasting the bandwidth... Thanks, Max #include <Constants.au3> #include <process.au3> Local $stdout_stream $gui = GUICreate("ClamScan",500,200) $label = GUICtrlCreateLabel("Current File:",20,20) $cf_label = GUICtrlCreateLabel("",90,20,400,80) $button = GUICtrlCreateButton("Test",200,170,100) GUICtrlSetData($cf_label,"Waiting to start..") GUISetState(@SW_SHOW) $bufcount = 0 $oldbufcount = 0 $pid = run("clamscan.exe c:\dell -d " & '"' & "C:\Documents and Settings\All Users\.clamwin\db" & '"',@ScriptDir,@SW_HIDE,$STDOUT_CHILD) While 1 $msg = GUIGetMsg() if $msg = $button Then MsgBox(0,"","No IO blocking!") Endif $bufcount = StdoutRead($pid,0,1) if $bufcount <> $oldbufcount Then $stream = StdoutRead($pid) $oldbufcount = $bufcount GUICtrlSetData($cf_label,"") GUICtrlSetData($cf_label,$stream) ;ConsoleWrite($stream) ; Determine if scan is finished by looking for last line and the phrase 'Time:' if stringinstr($stream,"Time:") Then GUICtrlSetData($cf_label,"Scan complete...") MsgBox(0,"","Scan Complete...") ExitLoop Endif Endif Wend
-
Thanks, must have missed the guictrldelete() function as I guess I've never needed it before. Works great. Max
-
What is the best approach for deleting or changing a button? For changing, I've tried creating a button over the old, but that causes problems in that once you hover, it changes back to the old. I've also tried using GUICtrlSetData($button,"New Text"), which kind of works. However, you don't see "New Text" until you hover over the button. Also, what about simply deleting/removing the button. Thanks, Max
-
Simple stdout to command line?
Max Kipness replied to Max Kipness's topic in AutoIt GUI Help and Support
Thanks. The editbin conversion program seems to work great. Max -
Been looking through some old posts, and it seems that what I'm trying to do is impossible. I just find it so hard to believe that something so simple cannot be done with such a great tool. Basically I want to run the following command (I'd like to print much more to stdout, but for simplicity I'll use one command): @osversion & @LF I would like to compile it as osversion.exe. Then I would like to open a command prompt and type: osversion.exe and get the response followed by a line feed (and in the same command prompt window): WIN_XP At first when glancing over the docs it seemed like consolewrite would do the trick, but obviously it won't. I saw posts about different crazy hacks to accomplish this, but I'm not interested in that route. Am I missing something? Is this not a useful function? Will it be added at any time in the future? Thanks, Max
-
Run reg query RunAsSet
Max Kipness replied to Max Kipness's topic in AutoIt General Help and Support
Anything? -
Run reg query RunAsSet
Max Kipness replied to Max Kipness's topic in AutoIt General Help and Support
Anyone have any idea on this one? Does RunAsSet work? Thanks, Max