Share this post

Link to post

Share on other sites

zackrspv 5

zackrspv 5

Is there anyway let you can minimize one program window but the script still works in that program so I can do other things?

Thanks in advanced!

TBH i'm not sure what your question is. As you already know, i'm sure, that even if you MINIMIZE a window, the program still works. For example, just because you minimize your web browser, doesn't mean the page is refreshed when you maximize it; or when you minimize a cmd window with the command 'dir /s /b /l' on y our root drive, it will still continue w/ that command. Windows doesn't simply STOP the process when you minimize, it just hides the window from view. You can test that out by creating an autoit script with HotkeySet() active inside of it. Minimize the program and press the hotkey, as you'll see, it is still usable.

If you mean, can i interact with a minimized window? Yes. use ControlSend() function for that.

Share this post

Link to post

Share on other sites

Fabroni 0

Fabroni 0

The script always works well whenever I starts it. In order to make it work on the specific window program I have to active that window.

For example I have to active window A so the script will work on window A. And I am looking for way to minimize window A to taskbar but the script still only work on window A. It is like sending key button to only one specific minimized window

Share this post

Link to post

Share on other sites

zackrspv 5

zackrspv 5

n00b question, related: I need to do mouseclicks and such at certain coordinates, so ControlSend() seems not to be helpful.

Is there a way to let everything go on in a different desktop, using Microsoft's "Virtual Desktop Manager" powertoy?

I haven't tested this mind you, so not sure if this will work for you; I deal with VNC/VPN and RDP clients all day lol but i would never assume automated control over them. So dunno. But, as the window DOES have a title, you can still use most if not all Control methods for that.

But since you have mouse coords, you can also use MouseClick() function:

Perform a mouse click operation.
MouseClick ( "button" [, x, y [, clicks [, speed ]]] )
Parameters
button The button to click: "left", "right", "middle", "main", "menu", "primary", "secondary".
x, y [optional] The x/y coordinates to move the mouse to. If no x and y coords are given, the current position is used (default).
clicks [optional] The number of times to click the mouse. Default is 1.
speed [optional] the speed to move the mouse in the range 1 (fastest) to 100 (slowest). A speed of 0 will move the mouse instantly. Default speed is 10.

So if you have the coords, just plug it in there. Aside from that, if you want to send all of your clicks, information, etc to the other machine, it would just be so much easier to compile your autoit script and send it to the remote host and execute there. Just isn't worth the hassle, in my opinion, to a) identify the remote window hook all keyboard/mouse movement on the host machine to the secondary machine and c) write the autoit program to do that for you. That would just be very very tedious.

Share this post

Link to post

Share on other sites

zackrspv 5

zackrspv 5

The script always works well whenever I starts it. In order to make it work on the specific window program I have to active that window.

For example I have to active window A so the script will work on window A. And I am looking for way to minimize window A to taskbar but the script still only work on window A. It is like sending key button to only one specific minimized window

Well, to minimize a window:

WinSetState("Title of WindowA", "", @SW_MINIMIZE)

To interact with that window

ControlSend("Title of WindowA", "", "Control ID of WindowA to mess with", "What you want to do in that window")

Note, on the above: (from help file)

ControlSend works in a similar way to Send but it can send key strokes directly to a window/control, rather than just to the active window.

Share this post

Link to post

Share on other sites

zackrspv 5

zackrspv 5

I am sorry for being noob. Which tab should look in? I see ID is blank.

It should be under the control tab. You'll most likely see that it has a numerical value. For example, almost all programs i have tested on, show numerical values for the ID. If you do start -> run -> calc and use the Au3 info tool and hover over the equal button, as an example, it should be like 121 or something like that.

Share this post

Link to post

Share on other sites

Fabroni 0

Fabroni 0

It should be under the control tab. You'll most likely see that it has a numerical value. For example, almost all programs i have tested on, show numerical values for the ID. If you do start -> run -> calc and use the Au3 info tool and hover over the equal button, as an example, it should be like 121 or something like that.

Share this post

Link to post

Share on other sites

zackrspv 5

zackrspv 5

If you have the window that you want to mess with as a freely available application, I may be able to help you a bit further. What's the name of the program you are trying to automate? If it's not freely available, then unfortunately, this is the only other information that I can provide for you:

Under the help files, and folder -> Controls, you are given this information:

Note: If this special format is not used then the parameter is taken to be a control ID (if numeric) or the ClassnameNN/text of the control (if a string). Although the special format is more longwinded than these methods it is much less ambiguous.

So, as you can see, even if you don't know the ID you could still possibly interact with that control. The bolded quote there, is good reference for you. But one major warning:

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

So, if it is a nonstandard control, your best bet may be to grab the handle of the control and interact that way:

Control Handle (HWND)

Using the ControlGetHandle function you can determine the Handle or HWND of a control. A handle is the unique identifier that Windows gives controls. The handle changes each time the control is created. This method of accessing controls is generally only designed for users who are familar with working with handles.

Share this post

Link to post

Share on other sites

zackrspv 5

zackrspv 5

Thanks, zackrspv. Though it does not solve my problem. (Yeah I was unclear specifying it.)

It may behoove you to start another topic on this with more precise information, i'm sure all of us here would love to help you with this problem, but since i'm helping 2 people in the same thread lol kinda hard to follow.
Edited May 11, 2008 by zackrspv