|
|
|||||||
the biggest problem with setfocus, is that you can't get a return that the window has focus... run "notepad.exe" while not setfocus("untitled - notepad") loop sendkeys("look, I finally have focus") That is like the winwaitactive command in scriptit and autoit. I'd like to use that, but the management doesn't want to trust any 3rd party software (that can't be sued/held liable). They didn't even want to use kixtart, untill I handed them a resource kit CD that said Microsoft and that kixtart was on it... |
||||||||
|
|
|||||||
Hmm.. This seems to work.. code:Kentbreak on cls |
||||||||
|
|
|||||||
but if the window isn't open yet.. process is still running, it doesn't pause/wait for it, nor return a code that it can't find it part 2, it the ability to read some of the contents of that window. Specifically for use in installing apps or completing forms |
||||||||
|
|
|||||||
SetFocus() will in fact return whether it was successful. Not in the same fashion as AutoIT but will if used in a loop. I do it in loops often. It certainly would be an improvement if it would return some of the text in the windo to discern windows with the same title as does AutoIT. |
||||||||
|
|
|||||||
see http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=2;t=003501 for continuance... |
||||||||
|
|
|||||||
rad, there was one problem found and help line given (to me). if you name windows the same, kix may get confused about to which set the focus. help line was: winzip32.exe /noqp /autoinstall cheers, |
||||||||
|
|
|||||||
winzip was just an example... a easy program to install that I had available for development purposes. I know all about ISS files, and the making of MSI packages, and command line options for certain apps. I have serveral in house apps that are deployed with the installers provided with the development tool: VB, Access, whatever. I am more concenrned with the functionality of setfocus and sendkeys than with a specific app... Has any one played with pausing the kbd and mouse devices to block input. |
||||||||
|
|
|||||||
rad, I didn't think you being a novice. but, sendkey gives you the info wether it can set focus or not. so, I don't see any other problem than if you have multiple windows named the same. |
||||||||
|
|
|||||||
Rad, would your management let you use the AutoItX dll? If so, you could incorporate it into your KiX scripts (and use the Block Input function as well). |
||||||||
|
|
|||||||
nope... no 3rd party shareware/freeware at all. only apps from 'reliable' sources. If the app came as a reskit util, then they consider that as a blessing... They allowed be to use scriptit as it says microsoft, but autoit is from an 'unknown' 3rd party. Even though they see that it looks to be functionally identical to scriptit, with more enhancements... scriptit was probably an 'old' version, before the author went his own way and improved it into autoit. So my options are: software from a 'reliable' source (that is also free) scripting it with Kix (which I have pretty much done) I was kind of hoping that there would be a COM method that would have more detail than the setfocus/sendkey methods |
||||||||
|
|
|||||||
No offense to you of course, but that is a ridiculous policy your management has adopted. Do they really think they'll be able to sue Microsoft if Internet Explorer 7.0 has a security bug that allows hackers into their system? They aren't protected any more by using Microsoft's free stuff (COM, WSH, IE, etc.) than they are by not using AutoIt. Of course, I'm probably preaching to the choir. |
||||||||
|
|
|||||||
from management today... quote:It is a government org... virtually everything is stupid, but since we don't have the time/resources to evaluate/test/inspect every app, we assume that a app from a reliable sourse is reliable. CYA |
||||||||
|
|
|||||||
nice. so sweeeeeeet... I love US. btw, our government is using linux side by side with unix&win* [ 19 June 2002, 15:51: Message edited by: Lonkero ] |
||||||||
|
|
|||||||
Well, you can use WSH AppActivate (available in WSH 2.0) to improve upon KiX's Setfocus... quote:Example: code:$rc=setfocus("Internet Explorer provided by The Relizon Company") |