Question about Focus

Can I make an object NOT steal focus on click?

Can I create an object in DesktopX, and then via either its options or through scripting, set it so that when I click on it, the object doesn't steal focus from the current open window?

Reason being, I have text objects that get their information from the currently open window, and of course, when I click on the object at the moment, it takes focus and replaces the text with a blank input. Not a massive, massive problem for now, but I have other objects which also interact similarly with the current window, and in their case, they simply won't work if my DesktopX object steals focus.

Can't find anything about this in the help or on the forums. Thanks. I will meanwhile be trying to figure something out for this myself.
3,282 views 2 replies
Reply #1 Top
MMMmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm.....
I can't think of an easy solution..
Maybe something like AutoIt which can set focus of windows, then when your object has it's Object_SetFocus triggered, set the focus back to the window you want. There might even be a 'focus previous window' function in AutoIt? haven't looked at it for a while.

How do you get your text information from the currently open window?



Reply #2 Top
Used this today, playing around with making Console2 slide in/off screen from an object.

In the AutoItX Help file look under Com Interface|Methods|Window Management.

I'm using a variable called winTitle since I'm referencing the same window in multiple functions. What this does is bring the window focus back to the top.

Code: vbscript
  1. Dim winTitle
  2. winTitle="Console"
  3. oAutoIt.WinActivate winTitle, ""