This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

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

 All Forums
 Lua Scripts
 Action Scripts Using Alien
 Get Parent Window By Handle
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

cyberalex4life

53 Posts

Posted - 08/02/2012 :  14:53:20  Show Profile
Can you add getParentWindowByHandle() and getOwnerWindowByHandle()?
I think it would solve issues about auto selecting windows on desktop

cyberalex4life

53 Posts

Posted - 08/02/2012 :  15:12:16  Show Profile
acGetWindowByPoint() does a prety good job in locating the subwindow and I think that finding the parent window by the returned handle is very usefull
Go to Top of Page

Rob

USA
2615 Posts

Posted - 08/02/2012 :  16:14:06  Show Profile  Visit Rob's Homepage
This can be accomplished using Alien. Put the script below in your Global Lua:
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

-- ************ GetParent ************

gGetParent = user32.GetParent
gGetParent:types{ ret = 'long', abi = 'stdcall', 'long'}

function aGetParent(iWnd)
	return gGetParent(iWnd)
end

Then you can call them from your action scripts:
aGetAncestor(iHandle,GA_ROOT) --root window
aGetAncestor(iHandle,GA_ROOTOWNER) --absolute owner
aGetAncestor(iHandle,GA_PARENT) --parent window
aGetParent(iHandle) --pretty much the same as the line above, gets parent window
Go to Top of Page

cyberalex4life

53 Posts

Posted - 08/03/2012 :  04:09:12  Show Profile
Thank you very much for your help. Unfortunately, as I found out, the problem why strokes plus is not working corectly is from my mouse program which implements double click by software. When I use the double click button strokes plus does not activate the window properly. Anyway thank you very much, at least I know which is the problem
Go to Top of Page

cyberalex4life

53 Posts

Posted - 08/04/2012 :  13:14:25  Show Profile
Fixed that by chosing Match Precision: 65 points with Match Probility: 75% (same)
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000