| View previous topic :: View next topic |
| Author |
Message |
filemakerdev Newbie
Joined: 20 Apr 2004 Posts: 3
|
Posted: Tue Apr 20, 2004 5:39 pm Post subject: Help manipulating child windows |
|
|
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 |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Thu Apr 22, 2004 5:10 pm Post subject: |
|
|
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 |
|
 |
filemakerdev Newbie
Joined: 20 Apr 2004 Posts: 3
|
Posted: Thu Apr 22, 2004 10:40 pm Post subject: |
|
|
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 |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri Apr 23, 2004 12:45 am Post subject: |
|
|
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 |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Fri Apr 23, 2004 3:14 pm Post subject: |
|
|
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 |
|
 |
filemakerdev Newbie
Joined: 20 Apr 2004 Posts: 3
|
Posted: Fri Apr 23, 2004 9:27 pm Post subject: |
|
|
| 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 |
|
 |
|
|
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
|
|