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