Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sat Dec 13, 2003 3:15 pm Post subject: "@Childexists()" function |
|
|
Hello,
I've made a little function for VDS 5, so that you can lookup the identifier of a child window. This can't be done using @winexists() directly, so that's why I made this code. You can specify the parent window by it's class name, it's identifier or his caption. The child can only be specified by his class name. I hope you can use this...
Code: |
#define function,Childexists
# Usage: @Childexists( [Parent Window Class, Identifier or Caption] , [Child Window Class] )
# With the Parent Window Class...
info @Childexists(#TMainWin,#TSyntaxMemo)
# With the Parent Window Identifier...
info @Childexists(@winexists(#TMainWin),#TSyntaxMemo)
# With the Parent Window Caption...
info @Childexists(@wintext(#TMainWin),#TSyntaxMemo)
exit
:Childexists
if @null(%1)@null(%2)
exit
end
if @equal(@substr(%2,1,1),"#")
%2 = @substr(%2,2,@len(%2))
end
if @equal(@substr(%1,1,1),"%")
%1 = @winclass(%1)
if @unequal(%1,)
%1 = "#"%1
end
end
if @both(@unequal(@substr(%1,1,1),"%"),@unequal(@substr(%1,1,1),"#"))
%1 = @winclass(@winexists(%1))
if @unequal(%1,)
%1 = "#"%1
end
end
repeat
%1 = @window(%1,CHILD)
if @equal(@trim(%1),)
%1 = " "
end
until @equal(@winclass(%1),%2)@equal(%1," ")@equal(%1,"CHILD)")
if @equal(%1," ")@equal(%1,"CHILD)")
exit
end
exit %1 |
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|