Unfocus current active window

09/19/2014 15:56 fuso98#1
Is there anyway to unfocus the currenct active window?
09/19/2014 16:05 berkay2578#2
Can you explain "why" do you want to do it? A little detail like "I want to do X so I need to unfocus a window" would help.
09/19/2014 23:18 YatoDev#3
focus get lost with a click on taskbar

Quote:
Originally Posted by berkay2578 View Post
Can you explain "why" do you want to do it? A little detail like "I want to do X so I need to unfocus a window" would help.
why would that help?
09/20/2014 00:23 butter123#4
[Only registered and activated users can see links. Click Here To Register...]
09/20/2014 08:27 berkay2578#5
Quote:
Originally Posted by »FlutterShy™ View Post
why would that help?
Well firstly, making a window lose focus sounds really useless and unnecessary.
Secondly, I need to know what OP's goal is, so that I can assist him better. Not everyone thinks the same, you may not need to know this but I do, so don't go all hazin' on me.
09/20/2014 10:44 KDeluxe#6
Set the focus to the desktop:
Code:
WinActivate(_WinAPI_GetDesktopWindow())
09/22/2014 14:50 fuso98#7
I want to make a bakground bot and i make a window trasparent and with control click i click on this window. But if the window where i send click is hidden and i'm writing on another window when i call controlclick the window where i'm writing lose the focus.

For clicking on the hidden window i want to try something like

func Mouseclick_BG($x,$y)
controlclick(....)
;Unfocus the hidden window
endfunc
09/22/2014 16:50 KDeluxe#8
ControlClick() doesn't focus the window. Are you sure that ControlClick() triggers the problem (it might be a bug)?
It should be possible to 'restore' the focus by focusing the second top window:
Code:
;~ ControlClick()
$windows = WinList()
If $windows[0][0] > 1 Then WinActivate($windows[2][1])
09/22/2014 20:18 YatoDev#9
forget that its to slow. already tryed it and i produce faster code than you^^

@SW_HIDE ?
09/24/2014 13:39 fuso98#10
Quote:
Originally Posted by KDeluxe View Post
ControlClick() doesn't focus the window. Are you sure that ControlClick() triggers the problem (it might be a bug)?
It should be possible to 'restore' the focus by focusing the second top window:
Code:
;~ ControlClick()
$windows = WinList()
If $windows[0][0] > 1 Then WinActivate($windows[2][1])
It is too slow, for a click i need like 500ms
Quote:
Originally Posted by »FlutterShy™ View Post
forget that its to slow. already tryed it and i produce faster code than you^^

@SW_HIDE ?
If i hide the window control click will not work anymore, and i can't take a snapshot too.
09/24/2014 20:26 YatoDev#11
move window out of screen like every other background api
09/25/2014 17:09 fuso98#12
I use FastFind to get a screen, and if the widnow is trasparent i can take the screenshot with outscreen window i got black screen.
09/26/2014 14:31 YatoDev#13
Quote:
Originally Posted by fuso98 View Post
I use FastFind to get a screen, and if the widnow is trasparent i can take the screenshot with outscreen window i got black screen.
it doesnt make sense to use fastfind. GDI+ or the build in AutoIt _ScreenShot function is better
09/27/2014 13:53 fuso98#14
I've tryed them, and i got always black screen + it's terrible slow
09/28/2014 00:53 YatoDev#15
if you cant do it by yourself decompile all that background bots