StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 General Action Scripts
 sometimes the gesture works on another program
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

q469649305

China
25 Posts

Posted - 10/31/2012 :  10:10:45  Show Profile  Reply with Quote
Potplayer is a video player.
I set it on the top when playing video.
When I use chrome meanwhile playing a video file,the gesture draw on the chrome sometimes will work on the potplayer.Strokeit doesn't exist this problem.
S+ has been updated to the latest version,win7 or win8 has the same problem.

Rob

USA
2538 Posts

Posted - 10/31/2012 :  10:47:35  Show Profile  Visit Rob's Homepage  Reply with Quote
By default, S+ does not activate the window under the gesture. This is intentional as sometimes people do not want that to occur.

The easiest solution is to add the following code to the Global Lua tab:
function sp_before_action(gnm, gsx, gsy, gex, gey, gwd, gapp, gact)
	acActivateWindow(aGetAncestor(acGetWindowByPoint(gsx, gsy), GA_ROOT), 0, 0)
end

aliencore = alien.core
user32 = aliencore.load("user32.dll")


-- ************ GetAncestor ************

gGetAncestor = user32.GetAncestor
gGetAncestor:types{ ret = 'long', abi = 'stdcall', 'long', 'uint'}
GA_PARENT = 1
GA_ROOT = 2
GA_ROOTOWNER = 3

function aGetAncestor(iWnd, iFlags)
	return gGetAncestor(iWnd, iFlags)
end


Go to Top of Page

Rob

USA
2538 Posts

Posted - 10/31/2012 :  15:40:51  Show Profile  Visit Rob's Homepage  Reply with Quote
Bah, I forgot to include the code for aGetAncestor.
Go to Top of Page

q469649305

China
25 Posts

Posted - 10/31/2012 :  20:46:54  Show Profile  Reply with Quote
Thank you for your solution!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000