Sign in to follow this  
Followers 0
dazza

AfxWnd - darn things

4 posts in this topic

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.

:)

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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 focus

Do 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

Share this post


Link to post
Share on other sites

Good thinking Batman!

I'll have a play.

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