forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help manipulating child windows

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filemakerdev
Newbie


Joined: 20 Apr 2004
Posts: 3

PostPosted: Tue Apr 20, 2004 5:39 pm    Post subject: Help manipulating child windows Reply with quote

I am building little applet to allow manipulation of windows (minimize, maximize, size & position, etc.). It works fine for parent (application) windows -- the first parameter is the partial or complete window title.

However, I can't figure out how to do the same for child windows.

Let's take a simple example... say the app (parent) window name is "FileMaker Pro" and the child window name is "Test.fp5", and I want to POSITION the child window at TOP=100, LEFT=100, WIDTH=400 AND HEIGHT=400.

Let's assume that the parent window is already maximized, and that the child window may or may not currently be maximized. Of course, under Windows 2000 at any rate, if the child window is maximized, then the app title bar will read "FileMaker Pro - [Test.fp5]"

Here are the parameters I'm passing:

"Test.fp5" position 100 100 400 400

Here's my code...

Code:

LIST CREATE,1
LIST WINLIST,1
%%search = %1
if @match(1, %%search)
   %%title = @item(1)
else
   stop
end

if @equal(%2, "position") 
   window normal, %%title
   window position, %%title, %3, %4, %5, %6
   stop
end


Any suggestions would be much appreciated. Thanks in advance.
Back to top
View user's profile Send private message
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Thu Apr 22, 2004 5:10 pm    Post subject: Reply with quote

In order to obtain a handle to the child window of another window, you'll have to use
@WINDOW(<top level window handle>,CHILD).

Once you have that handle, you could use @WINDOW(<child window handle>,FIRST)
and @WINDOW(<child window handle>,NEXT) to browse through all child windows of
that top level window.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
filemakerdev
Newbie


Joined: 20 Apr 2004
Posts: 3

PostPosted: Thu Apr 22, 2004 10:40 pm    Post subject: Reply with quote

I appreciate the reply... in case it's not glaringly obvious, I'm definitely a VDS newbie.

So, can I specify the <top level window handle> by using a window title as per the code in my original message? Or do I have to use the Class Name? Because I'm trying to come up with a scenario where my end users can specify the title of the child window and pass that as a parameter.

Given that I'd like to be able to position a child window, would someone mind posting the code that would allow that to happen?

Reminder: parent window title = "FileMaker Pro"; child window title = "Test.fp5"
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Fri Apr 23, 2004 12:45 am    Post subject: Reply with quote

If you know the title of the child window(or the user inputs it to your program) you just need to use @WINEXISTS(<child window title>). Something similar to your code:
Code:

REM Assuming %1 holds the title of the child window.
%%title = %1
REM Get the handle with @WINEXISTS()
%%handle = @WINEXISTS(%%title)
if @EQUAL(%2, position)
  window normal, %%handle
  window position, %%handle, %3, %4, %5, %6
end

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Fri Apr 23, 2004 3:14 pm    Post subject: Reply with quote

Actually the @winexists() function accepts a second parameter, which I wasn't aware of:

@WINEXISTS(<window>{, <child window>})

S.A.D.E. s.a.r.l. wrote:
To determine whether an MDI child window exists, or obtain its window identifier, the optional <child window> argument must be supplied, giving the full title bar text of the required window which is a child of <window>.


So try to simply pass the main window title as first parameter and the child window's
title as the second parameter.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
filemakerdev
Newbie


Joined: 20 Apr 2004
Posts: 3

PostPosted: Fri Apr 23, 2004 9:27 pm    Post subject: Reply with quote

Quote:
So try to simply pass the main window title as first parameter and the child window's title as the second parameter.


Thanks, I'll give that a shot. I appreciate all the suggestions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group