dazza Posted February 25, 2009 Share Posted February 25, 2009 Calling all Gurus. Is there anything AutoIt can do with an AfxWnd? (apart from 'send') On a ControlGetHandle, I managed to obtain 0x000C01D4. Yet I can't do anything else. All I really want is to return the focus to this AFxWnd and continue using key presses. Is there an API way of achieving this? Maybe return every handle of every control in a window and doing clever stuff this way? There's a pint in it for the Einstein who solves this conundrum. I'll send it through eBay. Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 25, 2009 Share Posted February 25, 2009 Calling all Gurus.Is there anything AutoIt can do with an AfxWnd? (apart from 'send')On a ControlGetHandle, I managed to obtain 0x000C01D4. Yet I can't do anything else. All I really want is to return the focus to this AFxWnd and continue using key presses.Is there an API way of achieving this? Maybe return every handle of every control in a window and doing clever stuff this way?There's a pint in it for the Einstein who solves this conundrum. I'll send it through eBay. Did you try just giving it focus with ControlFocus() and then ControlSend() further keyboard actions? That class is "owner drawn", which means the usual Windows API doesn't apply. 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...
junkew Posted February 25, 2009 Share Posted February 25, 2009 Most likely it are all windows where you can iterate over with winlist.Based on that you can retrieve some x,y,width and height properties and if thats unique you know which window is the correct one With mouse movements you can go to right location and then do a click to give focusDo you have a common example for an AfxWnd (on my system couldn't find one so far)You can get a bitmap and based on comparison with a baseline bitmap (see http://www.autoitscript.com/forum/index.php?showtopic=66545)$var = WinList() For $i = 1 to $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1]) EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
dazza Posted February 26, 2009 Author Share Posted February 26, 2009 Good thinking Batman! I'll have a play. 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