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

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 Lua Scripts
 Action Scripts Using Alien
 Get Parent Window By Handle

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
cyberalex4life Posted - 08/02/2012 : 14:53:20
Can you add getParentWindowByHandle() and getOwnerWindowByHandle()?
I think it would solve issues about auto selecting windows on desktop
4   L A T E S T    R E P L I E S    (Newest First)
cyberalex4life Posted - 08/04/2012 : 13:14:25
Fixed that by chosing Match Precision: 65 points with Match Probility: 75% (same)
cyberalex4life Posted - 08/03/2012 : 04:09:12
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
Rob Posted - 08/02/2012 : 16:14:06
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
cyberalex4life Posted - 08/02/2012 : 15:12:16
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

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000