10-13-2014, 05:44 AM
Dear Gintaras,
This is the report of the analysis of the toolbar on a MS_Word Window produced by the QM-function hereinafter.
Function Manage_Windows_Query
QM Help describes GetAncestor WAPI as it follows :
I wonder whether the flag sequence described in this help file (which it coincides with what MSDN says), is correct or not. Unless I misunderstand something.
Many thanks, Best Regards,
Simos
This is the report of the analysis of the toolbar on a MS_Word Window produced by the QM-function hereinafter.
Quote:Window : LANG_TOOL_WORD
Handle : 2432968
Class : QM_toolbar
Exe : qm
Parent : 5644204
P Name :
P Exe : qm
Ancestors
Parent :
65556 - - csrss
Top-level parent :
2432968 - LANG_TOOL_WORD - qm
Top-level parent or owner :
5644204 - - qm
Function Manage_Windows_Query
#sub WinProperties
function int'h
str si.getmacro(getopt(itemid) 1)
str caller.getmacro(getopt(itemid 1) 1);err caller=si
if ideb; min 0; err out "<>%s : <open ''%s /%i''>%s</open> - Called by : %s" NowT si _error.place si caller
int wp
str spa ste sexe sexep sc smes
ste.getwintext(h)
sc.getwinclass(h)
sexe.getwinexe(h)
wp=GetParent(h)
if wp
,spa.getwintext(wp)
,sexep.getwinexe(wp)
else
,spa=""
,sexep=""
smes.format("Window %c: %s[]Handle %c: %i[]Class %c: %s[]Exe %c: %s[][]Parent %c: %i[]P Name %c: %s[]P Exe %c: %s[][]Ancestors[]" VK_TAB ste VK_TAB h VK_TAB sc VK_TAB sexe VK_TAB wp VK_TAB spa VK_TAB sexep)
;1 parent, 2 , 3 top-level parent or owner
CStrStack st
st.Push("Parent : ")
st.Push("Top-level parent : ")
st.Push("Top-level parent or owner : ")
int i
for i 1 4
,wp=GetAncestor(h i)
,if wp
,,spa.getwintext(wp)
,,sexep.getwinexe(wp)
,else
,,spa=""
,,sexep=""
,smes.formata("%s[]%i - %s - %s[]" st.out(i-1) wp spa sexep)
,
mes smes "Window Properties" "Oi"
_s.format("Window : %s - Handle : %i - Class : %s" ste h sc)
min 0; err out "<>%s : <open ''%s /%i''>%s</open> - %s" NowT si _error.place si _s
QM Help describes GetAncestor WAPI as it follows :
Quote:GetAncestor(hWnd gaFlags) returns handle of container window. gaFlags: 1 parent (the same as GetParent), 2 top-level parent, 3 top-level parent or owner.
I wonder whether the flag sequence described in this help file (which it coincides with what MSDN says), is correct or not. Unless I misunderstand something.
Many thanks, Best Regards,
Simos