Sign in to follow this  
Followers 0
Fabroni

Works in minimized program window?

15 posts in this topic

#1 ·  Posted (edited)

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!

Edited by Fabroni

Share this post


Link to post
Share on other sites



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.

Other than that, not sure exactly, what you mean.


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

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

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?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I am sorry I did not write clearly.

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 :)

Edited by Fabroni

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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.

There are many VNC scripts, however, on this forum:

So, as you can see, most of the information has already been asked, answered several times :( Edited by zackrspv

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

I am sorry I did not write clearly.

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.

So that should do what you want :(

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thanks bro! You are so helpful.

Anyway what do you mean "Control ID of WindowA"? How can I get that control ID ?

Edited by Fabroni

Share this post


Link to post
Share on other sites

Thanks bro! You are so helpful.

Anyway what do you mean "Control ID of WindowA"? How can I get that control ID ?

Hi, you can use the Au3Info tool, while the other window is open, and hover over the control that you want to interact with. Chances are, it will have an ID for you to play with.


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

Hi, you can use the Au3Info tool, while the other window is open, and hover over the control that you want to interact with. Chances are, it will have an ID for you to play with.

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

Share this post


Link to post
Share on other sites

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.


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

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.

I still couldnt see the ID. It is always blank.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I still couldnt see the ID. It is always blank.

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.

e.g. Send text to the 1st Edit control in the Notepad window

ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", "This is some text")

or

ControlSend("Untitled - Notepad", "", "[CLASSNN:Edit1]", "This is some text")

or

ControlSend("Untitled - Notepad", "", "Edit1", "This is some text")

e.g. Click the 2nd instance of a "Button" control containing the text "Finish"

ControlClick("My Window", "", "[CLASS:Button; TEXT:Finish; INSTANCE:2]")

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.


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

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 by zackrspv

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I think it is nonstandard control but I see the handle control.

Handle: 0x000902A0

Below is the code I am doing. How can I put handle control in?

ControlSend("Client", "", "", "{SPACE DOWN}")
        Sleep(3000);
    ControlSend("Client", "", "", "{SPACE UP}")
        Sleep(10000);
Edited by Fabroni

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0