marko29 Posted January 21, 2011 Share Posted January 21, 2011 (edited) I am trying to pull it on control but nothing works, i am also trying to click on specified coords of a top lvl window with mousecoord opt set to 0, doesnt work either. ControlClick("top lvl window","","[CLASS:blah; INSTANCE:65]","left", 1, 282, 129) No idea why it wont work, perhaps control is somehow structured inside that it just decieves. Maybe you people know how to debug this or can suggest what else to try? Oh btw i am using coords because clicking only works on specific position of control(left top) Edited January 21, 2011 by marko29 Link to comment Share on other sites More sharing options...
JohnOne Posted January 21, 2011 Share Posted January 21, 2011 Well you could check the return values, you will find them in the helpfile, where you should also read the remarks, which could give you a clue. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 21, 2011 Share Posted January 21, 2011 A few things to try: 1. Make sure you are identifying the window successfully: $hWin = WinGetHandle("top lvl window", "") $sTitle = WinGetTitle($hWin) MsgBox(64, "Debug", "$hWin = " & $hWin & @CRLF & _ "$sTitle = " & $sTitle) 2. Once you have the window handle, get the control handle to verify you have a valid ID: #include <WinAPI.au3> ; ... $hCtrl = ControlGetHandle($hWin, "", "[CLASS:blah; INSTANCE:65]") $idCtrl = _WinAPI_GetDlgCtrlID($hCtrl) $sClass = _WinAPI_GetClassName($hCtrl) MsgBox(64, "Debug", "$hCtrl = " & $hCtrl & @CRLF & _ "$idCtrl = " & $idCtrl & @CRLF & _ "$sClass = " & $sClass) 3. Verify you got the X/Y coordinates correct. What kind of control is it? Did you know the coordinates are relative to the control, not the desktop or window? Is the control really that big, such that 282/129 is a valid coord inside the control? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
marko29 Posted January 28, 2011 Author Share Posted January 28, 2011 Awesome tips psalty but i checked all things you said even before that, even i didnt do it with winapi but great debug tips anyway, i am gonna use it one time for sure. I solved this by using mouseclick() function, and yes of course with x, y relative to window, ControlClick just wouldnt wont to work, either on control or if i just did it on main window handle with setting control para to empty Link to comment Share on other sites More sharing options...
wesb Posted April 26, 2011 Share Posted April 26, 2011 Awesome tips psalty but i checked all things you said even before that, even i didnt do it with winapi but great debug tips anyway, i am gonna use it one time for sure. I solved this by using mouseclick() function, and yes of course with x, y relative to window, ControlClick just wouldnt wont to work, either on control or if i just did it on main window handle with setting control para to emptyI am having a similar issue i know on 64 bit Win7...havent tried it yet on 32 bit to see if the results are the same. A WinWait never identifies the window, the Adlib doesnt do what its supposed to on the windows when they pop up. I am trying to do a silent uninstall of an unapproved software Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 26, 2011 Share Posted April 26, 2011 I am trying to do a silent uninstall of an unapproved software Well now let's just talk about that part. What does "unapproved software" mean? Because it sounds malicious, and costs you any interest in any help you might want. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
wesb Posted April 27, 2011 Share Posted April 27, 2011 Well now let's just talk about that part. What does "unapproved software" mean? Because it sounds malicious, and costs you any interest in any help you might want. Psalty, I am responsible to ensure my end users don't install software that is not approved by the company I work for. We have blocks in place to keep these things from running via ePO etc. but in order to then clean it from the systems remotely without having to force the end user to come into the office is where this comes into play for me. I create the packages to send out via SCCM and we can then do a silent uninstall. Used to be simple up to WinXP...here is the sample I have right now...the first 3 lines should be enough but the uninstall doesnt go silent...causes 3 prompts. This app is considered spyware according to threatexpert: (I am not one to just drop links into forums )#RequireAdminAdlibRegister("MyAdlib")Run(@ProgramFilesDir & '\Software Informer\unins000.exe /S /v')WinWait('Software Informer Uninstall','Software Informer uninstall complete.')Func myadlib() If WinExists('Uninstall', 'Would you like to keep your settings?') Then WinActivate('Uninstall', 'Would you like to keep your settings?') ControlClick('Uninstall', '&No', 1) EndIf If WinExists('Software Informer Uninstall', '&Yes') Then WinActivate('Software Informer Uninstall', '&Yes') ControlClick('Software Informer Uninstall', '&Yes', 1) EndIf If WinExists('Software Informer Uninstall','Software Informer uninstall complete.') Then ControlClick('Software Informer Uninstall', '&Ok', 1) EndIfEndFunc ;==>myadlib Link to comment Share on other sites More sharing options...
Bert Posted April 27, 2011 Share Posted April 27, 2011 You could do a winmove to move the offending window off the screen so the user doesn't see it. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
wesb Posted April 27, 2011 Share Posted April 27, 2011 MPH...thanks but the windows wont close without an action or click on them and i cant get the click to take place... thanks for the idea though Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 27, 2011 Share Posted April 27, 2011 Use the advanced window spec to get the handle first, as in Example 2 of post #3. For class and useful identifying info check out the popup with AU3Info. That will at least verify if you can ID the window and control. If you still can't simply get the window and button control handles, post the Summary Tab info from AU3Info. Since you launched the process in the first place, I don't think you need any more privilege escalation to see and work with the windows. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
wesb Posted April 28, 2011 Share Posted April 28, 2011 My bad...just goes to show you that even when you think you know what youre doing, you (me) can still screw up...controlclick on the control number fixed the whole dang thing...thanks for making me go back and RTM. 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