taren9k3 Posted October 10, 2009 Share Posted October 10, 2009 When I use ControlClick function I have to use WinActivate command before. So I want to ask you are there anyways to use controlclick or some functions else that do not need to use WinActivate. Thanks Link to comment Share on other sites More sharing options...
exodius Posted October 10, 2009 Share Posted October 10, 2009 You don't need to WinActivate windows before you ControlClick them... That's the nice thing about ControlClick? Example: Run ("notepad") WinWait ("Untitled -") Run ("control Sysdm.cpl") WinWait ("System Properties") MsgBox (0, "", "We're going to activate Notepad and controlclick OK on the System Properties window while it's not active.") WinActivate ("Untitled - ") Sleep (2000) ControlClick ("System Properties", "", "OK") Link to comment Share on other sites More sharing options...
taren9k3 Posted October 11, 2009 Author Share Posted October 11, 2009 You don't need to WinActivate windows before you ControlClick them... That's the nice thing about ControlClick? Example: Run ("notepad") WinWait ("Untitled -") Run ("control Sysdm.cpl") WinWait ("System Properties") MsgBox (0, "", "We're going to activate Notepad and controlclick OK on the System Properties window while it's not active.") WinActivate ("Untitled - ") Sleep (2000) ControlClick ("System Properties", "", "OK") I dont understand!! Help me plz. Link to comment Share on other sites More sharing options...
nfaustin Posted October 11, 2009 Share Posted October 11, 2009 (edited) Controlclick has the ability to click the window even the window is not active. But not all. from the helpfile: Remarks Some controls will resist clicking unless they are the active window. Use the WinActivate() function to force the control's window to the top before using ControlClick(). If the your controlclick clicking on a button, try to use Controlcommand. ControlCommand("System Properties", "", "CONTROL ID", "Check", "") Use the AutoIt window info to get the CONTROL ID of the button. Edited October 11, 2009 by nfaustin [font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font] Link to comment Share on other sites More sharing options...
Pandemic Posted October 11, 2009 Share Posted October 11, 2009 (edited) Control Click is like clicking, but that window doesn't have to be active. The ControlClick function takes 3 mandatory parameters: Title of the window Text Control ID What Exodius is doing is: ControlClick ("System Properties", "", "OK") He first tells AutoIT to click on the window with the title "System Properties". For text he makes the parameter null. He finishes by telling AutoIT to click the button that is labeled "OK". This means that even though Notepad is active, it selects the System Properties window and hits the OK button. -Pandemic Edited October 11, 2009 by Pandemic Link to comment Share on other sites More sharing options...
exodius Posted October 11, 2009 Share Posted October 11, 2009 (edited) He first tells AutoIT to click on the window with the title "System Properties". For text he makes the parameter null. He finishes by telling AutoIT to click the button that is labeled "OK". This means that even though Notepad is active, it selects the System Properties window and hits the OK button.Quoted for truth, basically I'm opening two windows (that anyone running Windows XP at least) should be able to open by default, activating one and then showing that you can ControlClick on the other window (the System Properties window) which is inactive.So if it's not working for you taren9k3, then you may have some fundamental issues on your machine. Edited October 11, 2009 by exodius Link to comment Share on other sites More sharing options...
MilesAhead Posted October 12, 2009 Share Posted October 12, 2009 A related question, what's the easiest way to send a left mouse click to the close 'x' on a window frame? The WinInfo gadget doesn't give any control IDs for window frame controls. My Freeware Page Link to comment Share on other sites More sharing options...
exodius Posted October 12, 2009 Share Posted October 12, 2009 Do you need to actually click on the x? As in WinClose won't work? Link to comment Share on other sites More sharing options...
Zedna Posted October 12, 2009 Share Posted October 12, 2009 When I use ControlClick function I have to use WinActivate command before. So I want to ask you are there anyways to use controlclick or some functions else that do not need to use WinActivate. ThanksTry to call ControlFocus() just before ControlClick(). Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
MilesAhead Posted October 12, 2009 Share Posted October 12, 2009 (edited) Do you need to actually click on the x? As in WinClose won't work?Yes. The application is a download manager. afaik there's no option to have it start to tray. I'm launching with an app that launches the browser with it, and kills the download manager when the browser closes. If you click the 'x' it minimizes to tray. But I see no way to do it. A sendmessage to the system menu may work if I can dig out how to do it again. But it would be nice if I could just mouse click the 'x' since some apps do owner draw in the frame and sysmenu close may not work with those.edit: if I send it a 'close' it will shut down instead of hide to tray. If I send it a 'min' then it will show the task bar button. So click on 'x' would be best if it were possible. Edited October 12, 2009 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
MilesAhead Posted October 12, 2009 Share Posted October 12, 2009 Hmmmmmm, thought a NirCmd sending the window a 'hide' would work. It minimizes to tray, but then the icon menu open won't work. It just shows the button in the taskbar without opening the window. You'd think this would be easy. My Freeware Page Link to comment Share on other sites More sharing options...
bo8ster Posted October 13, 2009 Share Posted October 13, 2009 _WinAPI_SetWindowPlacement may do what you need but you will have to know what command to put in the WINDOWPLACEMENT Structure ($tagWINDOWPLACEMENT). Get a handle to window, press the X button then call _WinAPI_GetWindowPlacement to find out what the tagWINDOWPLACEMENT->showCmd is. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
MilesAhead Posted October 13, 2009 Share Posted October 13, 2009 _WinAPI_SetWindowPlacement may do what you need ...Thanks for the reply. Turns out in this case the target program also handles Alt-F4 as minimize to tray. I just wrote a few lines of script to make the window active, then send Alt-F4. Seems to do the job well enough for this purpose. My Freeware Page Link to comment Share on other sites More sharing options...
taren9k3 Posted October 13, 2009 Author Share Posted October 13, 2009 Someone can make the program that can login to Yahoo without activate Yahoo messenger window. Link to comment Share on other sites More sharing options...
bo8ster Posted October 13, 2009 Share Posted October 13, 2009 Someone can make the program that can login to Yahoo without activate Yahoo messenger window.eh? Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
nfaustin Posted October 14, 2009 Share Posted October 14, 2009 (edited) I think he need rentacoder Edited October 14, 2009 by nfaustin [font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font] Link to comment Share on other sites More sharing options...
MilesAhead Posted October 14, 2009 Share Posted October 14, 2009 (edited) I think he need rentacoderHeh. Or he can try http://www.DonationCoder.com in the "Coding Snacks" forum. That's how I ended up doing this one. The minimize to tray thing I'm just doing for myself. Since I wrote the program to launch browser with download manager I figured I might as well use it myself. Edited October 14, 2009 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now